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 |
| 206 | *" $1 "*) :;; |
Jerry Yu | bbfa1d8 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 207 | *" $1="*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 208 | *) SKIP_NEXT="YES";; |
| 209 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 210 | } |
| 211 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 212 | # skip next test if the flag is enabled in config.h |
| 213 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 214 | case $CONFIGS_ENABLED in |
| 215 | *" $1 "*) SKIP_NEXT="YES";; |
Jerry Yu | bbfa1d8 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 216 | *" $1="*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 217 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 218 | } |
| 219 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 220 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 221 | # This function uses the query_config command line option to query the |
| 222 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 223 | # program. The command will always return a success value if the |
| 224 | # configuration is defined and the value will be printed to stdout. |
| 225 | # |
| 226 | # Note that if the configuration is not defined or is defined to nothing, |
| 227 | # the output of this function will be an empty string. |
| 228 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 232 | VAL="$( get_config_value_or_default "$1" )" |
| 233 | if [ -z "$VAL" ]; then |
| 234 | # Should never happen |
| 235 | echo "Mbed TLS configuration $1 is not defined" |
| 236 | exit 1 |
| 237 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 238 | SKIP_NEXT="YES" |
| 239 | fi |
| 240 | } |
| 241 | |
| 242 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 243 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 244 | if [ -z "$VAL" ]; then |
| 245 | # Should never happen |
| 246 | echo "Mbed TLS configuration $1 is not defined" |
| 247 | exit 1 |
| 248 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 249 | SKIP_NEXT="YES" |
| 250 | fi |
| 251 | } |
| 252 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 253 | requires_config_value_equals() { |
| 254 | VAL=$( get_config_value_or_default "$1" ) |
| 255 | if [ -z "$VAL" ]; then |
| 256 | # Should never happen |
| 257 | echo "Mbed TLS configuration $1 is not defined" |
| 258 | exit 1 |
| 259 | elif [ "$VAL" -ne "$2" ]; then |
| 260 | SKIP_NEXT="YES" |
| 261 | fi |
| 262 | } |
| 263 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 264 | # Space-separated list of ciphersuites supported by this build of |
| 265 | # Mbed TLS. |
| 266 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
| 267 | grep TLS- | |
| 268 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 269 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | case $P_CIPHERSUITES in |
| 271 | *" $1 "*) :;; |
| 272 | *) SKIP_NEXT="YES";; |
| 273 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 274 | } |
| 275 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 276 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 277 | # If CMD (call to a TLS client or server program) requires a specific |
| 278 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
| 279 | # enabled. As an exception, do run the test case if it expects a ciphersuite |
| 280 | # mismatch. |
| 281 | maybe_requires_ciphersuite_enabled() { |
| 282 | case "$1" in |
| 283 | *\ force_ciphersuite=*) :;; |
| 284 | *) return;; # No specific required ciphersuite |
| 285 | esac |
| 286 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 287 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 288 | shift |
| 289 | |
| 290 | case "$*" in |
| 291 | *"-s SSL - The server has no ciphersuites in common"*) |
| 292 | # This test case expects a ciphersuite mismatch, so it doesn't |
| 293 | # require the ciphersuite to be enabled. |
| 294 | ;; |
| 295 | *) |
| 296 | requires_ciphersuite_enabled "$ciphersuite" |
| 297 | ;; |
| 298 | esac |
| 299 | |
| 300 | unset ciphersuite |
| 301 | } |
| 302 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 303 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 304 | requires_openssl_with_fallback_scsv() { |
| 305 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 306 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 307 | then |
| 308 | OPENSSL_HAS_FBSCSV="YES" |
| 309 | else |
| 310 | OPENSSL_HAS_FBSCSV="NO" |
| 311 | fi |
| 312 | fi |
| 313 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 314 | SKIP_NEXT="YES" |
| 315 | fi |
| 316 | } |
| 317 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 318 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 319 | requires_max_content_len() { |
| 320 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 321 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 322 | } |
| 323 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 324 | # skip next test if GnuTLS isn't available |
| 325 | requires_gnutls() { |
| 326 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 327 | if ( which "$GNUTLS_CLI" && which "$GNUTLS_SERV" ) >/dev/null 2>&1; then |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 328 | GNUTLS_AVAILABLE="YES" |
| 329 | else |
| 330 | GNUTLS_AVAILABLE="NO" |
| 331 | fi |
| 332 | fi |
| 333 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 334 | SKIP_NEXT="YES" |
| 335 | fi |
| 336 | } |
| 337 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 338 | # skip next test if GnuTLS-next isn't available |
| 339 | requires_gnutls_next() { |
| 340 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 341 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 342 | GNUTLS_NEXT_AVAILABLE="YES" |
| 343 | else |
| 344 | GNUTLS_NEXT_AVAILABLE="NO" |
| 345 | fi |
| 346 | fi |
| 347 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 348 | SKIP_NEXT="YES" |
| 349 | fi |
| 350 | } |
| 351 | |
| 352 | # skip next test if OpenSSL-legacy isn't available |
| 353 | requires_openssl_legacy() { |
| 354 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 355 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 356 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 357 | else |
| 358 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 359 | fi |
| 360 | fi |
| 361 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 362 | SKIP_NEXT="YES" |
| 363 | fi |
| 364 | } |
| 365 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 366 | requires_openssl_next() { |
| 367 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 368 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 369 | OPENSSL_NEXT_AVAILABLE="YES" |
| 370 | else |
| 371 | OPENSSL_NEXT_AVAILABLE="NO" |
| 372 | fi |
| 373 | fi |
| 374 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 375 | SKIP_NEXT="YES" |
| 376 | fi |
| 377 | } |
| 378 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 379 | # skip next test if IPv6 isn't available on this host |
| 380 | requires_ipv6() { |
| 381 | if [ -z "${HAS_IPV6:-}" ]; then |
| 382 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 383 | SRV_PID=$! |
| 384 | sleep 1 |
| 385 | kill $SRV_PID >/dev/null 2>&1 |
| 386 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 387 | HAS_IPV6="NO" |
| 388 | else |
| 389 | HAS_IPV6="YES" |
| 390 | fi |
| 391 | rm -r $SRV_OUT |
| 392 | fi |
| 393 | |
| 394 | if [ "$HAS_IPV6" = "NO" ]; then |
| 395 | SKIP_NEXT="YES" |
| 396 | fi |
| 397 | } |
| 398 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 399 | # skip next test if it's i686 or uname is not available |
| 400 | requires_not_i686() { |
| 401 | if [ -z "${IS_I686:-}" ]; then |
| 402 | IS_I686="YES" |
| 403 | if which "uname" >/dev/null 2>&1; then |
| 404 | if [ -z "$(uname -a | grep i686)" ]; then |
| 405 | IS_I686="NO" |
| 406 | fi |
| 407 | fi |
| 408 | fi |
| 409 | if [ "$IS_I686" = "YES" ]; then |
| 410 | SKIP_NEXT="YES" |
| 411 | fi |
| 412 | } |
| 413 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 414 | # Calculate the input & output maximum content lengths set in the config |
Yuto Takano | ab9e4333 | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 415 | MAX_CONTENT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_MAX_CONTENT_LEN" ) |
| 416 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 417 | MAX_OUT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN" ) |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 418 | |
Yuto Takano | 18ddccc | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 419 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 420 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 421 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 422 | fi |
| 423 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 424 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 425 | fi |
| 426 | |
| 427 | # skip the next test if the SSL output buffer is less than 16KB |
| 428 | requires_full_size_output_buffer() { |
| 429 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 430 | SKIP_NEXT="YES" |
| 431 | fi |
| 432 | } |
| 433 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 434 | # skip the next test if valgrind is in use |
| 435 | not_with_valgrind() { |
| 436 | if [ "$MEMCHECK" -gt 0 ]; then |
| 437 | SKIP_NEXT="YES" |
| 438 | fi |
| 439 | } |
| 440 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 441 | # skip the next test if valgrind is NOT in use |
| 442 | only_with_valgrind() { |
| 443 | if [ "$MEMCHECK" -eq 0 ]; then |
| 444 | SKIP_NEXT="YES" |
| 445 | fi |
| 446 | } |
| 447 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 448 | # multiply the client timeout delay by the given factor for the next test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 449 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 450 | CLI_DELAY_FACTOR=$1 |
| 451 | } |
| 452 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 453 | # wait for the given seconds after the client finished in the next test |
| 454 | server_needs_more_time() { |
| 455 | SRV_DELAY_SECONDS=$1 |
| 456 | } |
| 457 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 458 | # print_name <name> |
| 459 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 460 | TESTS=$(( $TESTS + 1 )) |
| 461 | LINE="" |
| 462 | |
| 463 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 464 | LINE="$TESTS " |
| 465 | fi |
| 466 | |
| 467 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 468 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 469 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 470 | for i in `seq 1 $LEN`; do printf '.'; done |
| 471 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 472 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 473 | } |
| 474 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 475 | # record_outcome <outcome> [<failure-reason>] |
| 476 | # The test name must be in $NAME. |
| 477 | record_outcome() { |
| 478 | echo "$1" |
| 479 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 480 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 481 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 482 | "ssl-opt" "$NAME" \ |
| 483 | "$1" "${2-}" \ |
| 484 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 485 | fi |
| 486 | } |
| 487 | |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 488 | # True if the presence of the given pattern in a log definitely indicates |
| 489 | # that the test has failed. False if the presence is inconclusive. |
| 490 | # |
| 491 | # Inputs: |
| 492 | # * $1: pattern found in the logs |
| 493 | # * $TIMES_LEFT: >0 if retrying is an option |
| 494 | # |
| 495 | # Outputs: |
| 496 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 497 | # unchanged otherwise. |
| 498 | # * Return value: 1 if the pattern is inconclusive, |
| 499 | # 0 if the failure is definitive. |
| 500 | log_pattern_presence_is_conclusive() { |
| 501 | # If we've run out of attempts, then don't retry no matter what. |
| 502 | if [ $TIMES_LEFT -eq 0 ]; then |
| 503 | return 0 |
| 504 | fi |
| 505 | case $1 in |
| 506 | "resend") |
| 507 | # An undesired resend may have been caused by the OS dropping or |
| 508 | # delaying a packet at an inopportune time. |
| 509 | outcome="RETRY(resend)" |
| 510 | return 1;; |
| 511 | esac |
| 512 | } |
| 513 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 514 | # fail <message> |
| 515 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 516 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 517 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 518 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 519 | mv $SRV_OUT o-srv-${TESTS}.log |
| 520 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 521 | if [ -n "$PXY_CMD" ]; then |
| 522 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 523 | fi |
| 524 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 525 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 526 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 527 | echo " ! server output:" |
| 528 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 529 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 530 | echo " ! client output:" |
| 531 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 532 | if [ -n "$PXY_CMD" ]; then |
| 533 | echo " ! ========================================================" |
| 534 | echo " ! proxy output:" |
| 535 | cat o-pxy-${TESTS}.log |
| 536 | fi |
| 537 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 538 | fi |
| 539 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 540 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 541 | } |
| 542 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 543 | # is_polar <cmd_line> |
| 544 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 545 | case "$1" in |
| 546 | *ssl_client2*) true;; |
| 547 | *ssl_server2*) true;; |
| 548 | *) false;; |
| 549 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 550 | } |
| 551 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 552 | # openssl s_server doesn't have -www with DTLS |
| 553 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 554 | case "$SRV_CMD" in |
| 555 | *s_server*-dtls*) |
| 556 | NEEDS_INPUT=1 |
| 557 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 558 | *) NEEDS_INPUT=0;; |
| 559 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 560 | } |
| 561 | |
| 562 | # provide input to commands that need it |
| 563 | provide_input() { |
| 564 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 565 | return |
| 566 | fi |
| 567 | |
| 568 | while true; do |
| 569 | echo "HTTP/1.0 200 OK" |
| 570 | sleep 1 |
| 571 | done |
| 572 | } |
| 573 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 574 | # has_mem_err <log_file_name> |
| 575 | has_mem_err() { |
| 576 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 577 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 578 | then |
| 579 | return 1 # false: does not have errors |
| 580 | else |
| 581 | return 0 # true: has errors |
| 582 | fi |
| 583 | } |
| 584 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 585 | # Wait for process $2 named $3 to be listening on port $1. Print error to $4. |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 586 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 587 | wait_app_start() { |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 588 | newline=' |
| 589 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 590 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 591 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 592 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 593 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 594 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 595 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 596 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 6cd97ce | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 597 | while true; do |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 598 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p) |
| 599 | # When we use a proxy, it will be listening on the same port we |
| 600 | # are checking for as well as the server and lsof will list both. |
| 601 | # If multiple PIDs are returned, each one will be on a separate |
| 602 | # line, each prepended with 'p'. |
| 603 | case ${newline}${SERVER_PIDS}${newline} in |
| 604 | *${newline}p${2}${newline}*) break;; |
| 605 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 606 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 607 | echo "$3 START TIMEOUT" |
| 608 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 609 | break |
| 610 | fi |
| 611 | # Linux and *BSD support decimal arguments to sleep. On other |
| 612 | # OSes this may be a tight loop. |
| 613 | sleep 0.1 2>/dev/null || true |
| 614 | done |
| 615 | } |
| 616 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 617 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 618 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 619 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 620 | } |
| 621 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 622 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 623 | # Wait for server process $2 to be listening on port $1. |
| 624 | wait_server_start() { |
| 625 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 626 | } |
| 627 | |
| 628 | # Wait for proxy process $2 to be listening on port $1. |
| 629 | wait_proxy_start() { |
| 630 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 631 | } |
| 632 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 633 | # 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] | 634 | # 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] | 635 | # acceptable bounds |
| 636 | check_server_hello_time() { |
| 637 | # 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] | 638 | 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] | 639 | # Get the Unix timestamp for now |
| 640 | CUR_TIME=$(date +'%s') |
| 641 | THRESHOLD_IN_SECS=300 |
| 642 | |
| 643 | # Check if the ServerHello time was printed |
| 644 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 645 | return 1 |
| 646 | fi |
| 647 | |
| 648 | # Check the time in ServerHello is within acceptable bounds |
| 649 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 650 | # The time in ServerHello is at least 5 minutes before now |
| 651 | return 1 |
| 652 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 653 | # 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] | 654 | return 1 |
| 655 | else |
| 656 | return 0 |
| 657 | fi |
| 658 | } |
| 659 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 660 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 661 | handshake_memory_get() { |
| 662 | OUTPUT_VARIABLE="$1" |
| 663 | OUTPUT_FILE="$2" |
| 664 | |
| 665 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 666 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 667 | |
| 668 | # Check if memory usage was read |
| 669 | if [ -z "$MEM_USAGE" ]; then |
| 670 | echo "Error: Can not read the value of handshake memory usage" |
| 671 | return 1 |
| 672 | else |
| 673 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 674 | return 0 |
| 675 | fi |
| 676 | } |
| 677 | |
| 678 | # Get handshake memory usage from server or client output and check if this value |
| 679 | # is not higher than the maximum given by the first argument |
| 680 | handshake_memory_check() { |
| 681 | MAX_MEMORY="$1" |
| 682 | OUTPUT_FILE="$2" |
| 683 | |
| 684 | # Get memory usage |
| 685 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 686 | return 1 |
| 687 | fi |
| 688 | |
| 689 | # Check if memory usage is below max value |
| 690 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 691 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 692 | "but should be below $MAX_MEMORY bytes" |
| 693 | return 1 |
| 694 | else |
| 695 | return 0 |
| 696 | fi |
| 697 | } |
| 698 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 699 | # wait for client to terminate and set CLI_EXIT |
| 700 | # must be called right after starting the client |
| 701 | wait_client_done() { |
| 702 | CLI_PID=$! |
| 703 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 704 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 705 | CLI_DELAY_FACTOR=1 |
| 706 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 707 | ( 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] | 708 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 709 | |
| 710 | wait $CLI_PID |
| 711 | CLI_EXIT=$? |
| 712 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 713 | kill $DOG_PID >/dev/null 2>&1 |
| 714 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 715 | |
| 716 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 717 | |
| 718 | sleep $SRV_DELAY_SECONDS |
| 719 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 720 | } |
| 721 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 722 | # check if the given command uses dtls and sets global variable DTLS |
| 723 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 724 | case "$1" in |
Paul Elliott | 405fccc | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 725 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 726 | *) DTLS=0;; |
| 727 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 728 | } |
| 729 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 730 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 731 | is_gnutls() { |
| 732 | case "$1" in |
| 733 | *gnutls-cli*) |
| 734 | CMD_IS_GNUTLS=1 |
| 735 | ;; |
| 736 | *gnutls-serv*) |
| 737 | CMD_IS_GNUTLS=1 |
| 738 | ;; |
| 739 | *) |
| 740 | CMD_IS_GNUTLS=0 |
| 741 | ;; |
| 742 | esac |
| 743 | } |
| 744 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 745 | # Compare file content |
| 746 | # Usage: find_in_both pattern file1 file2 |
| 747 | # extract from file1 the first line matching the pattern |
| 748 | # check in file2 that the same line can be found |
| 749 | find_in_both() { |
| 750 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 751 | if [ -z "$srv_pattern" ]; then |
| 752 | return 1; |
| 753 | fi |
| 754 | |
| 755 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 756 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 757 | else |
| 758 | return 1; |
| 759 | fi |
| 760 | } |
| 761 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 762 | # Analyze the commands that will be used in a test. |
| 763 | # |
| 764 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 765 | # extra arguments or go through wrappers. |
| 766 | # Set $DTLS (0=TLS, 1=DTLS). |
| 767 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 768 | # update DTLS variable |
| 769 | detect_dtls "$SRV_CMD" |
| 770 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 771 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 772 | # 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] | 773 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 774 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 775 | case " $SRV_CMD " in |
| 776 | *' server_addr=::1 '*) |
| 777 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 778 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 779 | fi |
| 780 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 781 | # update CMD_IS_GNUTLS variable |
| 782 | is_gnutls "$SRV_CMD" |
| 783 | |
| 784 | # if the server uses gnutls but doesn't set priority, explicitly |
| 785 | # set the default priority |
| 786 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 787 | case "$SRV_CMD" in |
| 788 | *--priority*) :;; |
| 789 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 790 | esac |
| 791 | fi |
| 792 | |
| 793 | # update CMD_IS_GNUTLS variable |
| 794 | is_gnutls "$CLI_CMD" |
| 795 | |
| 796 | # if the client uses gnutls but doesn't set priority, explicitly |
| 797 | # set the default priority |
| 798 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 799 | case "$CLI_CMD" in |
| 800 | *--priority*) :;; |
| 801 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 802 | esac |
| 803 | fi |
| 804 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 805 | # fix client port |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 806 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 807 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 808 | else |
| 809 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 810 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 811 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 812 | # prepend valgrind to our commands if active |
| 813 | if [ "$MEMCHECK" -gt 0 ]; then |
| 814 | if is_polar "$SRV_CMD"; then |
| 815 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 816 | fi |
| 817 | if is_polar "$CLI_CMD"; then |
| 818 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 819 | fi |
| 820 | fi |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 821 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 822 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 823 | # Check for failure conditions after a test case. |
| 824 | # |
| 825 | # Inputs from run_test: |
| 826 | # * positional parameters: test options (see run_test documentation) |
| 827 | # * $CLI_EXIT: client return code |
| 828 | # * $CLI_EXPECT: expected client return code |
| 829 | # * $SRV_RET: server return code |
| 830 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 831 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 832 | # |
| 833 | # Outputs: |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 834 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 835 | check_test_failure() { |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 836 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 837 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 838 | if [ $TIMES_LEFT -gt 0 ] && |
| 839 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 840 | then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 841 | outcome="RETRY(client-timeout)" |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 842 | return |
| 843 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 844 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 845 | # check if the client and server went at least to the handshake stage |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 846 | # (useful to avoid tests with only negative assertions and non-zero |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 847 | # expected client exit to incorrectly succeed in case of catastrophic |
| 848 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 849 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 850 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 851 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 852 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 853 | return |
| 854 | fi |
| 855 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 856 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 857 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 858 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 859 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 860 | return |
| 861 | fi |
| 862 | fi |
| 863 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 864 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 865 | # exit with status 0 when interrupted by a signal, and we don't really |
| 866 | # care anyway), in case e.g. the server reports a memory leak. |
| 867 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 868 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 869 | return |
| 870 | fi |
| 871 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 872 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 873 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 874 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 875 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 876 | fail "bad client exit code (expected $CLI_EXPECT, got $CLI_EXIT)" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 877 | return |
| 878 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 879 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 880 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 881 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 882 | # lines with 'Serious error when reading debug info', are valgrind issues as well |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 883 | while [ $# -gt 0 ] |
| 884 | do |
| 885 | case $1 in |
| 886 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 887 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 888 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 889 | return |
| 890 | fi |
| 891 | ;; |
| 892 | |
| 893 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 894 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 895 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 896 | return |
| 897 | fi |
| 898 | ;; |
| 899 | |
| 900 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 901 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 902 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 903 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 904 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 905 | return |
| 906 | fi |
| 907 | ;; |
| 908 | |
| 909 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 910 | 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] | 911 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 912 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 913 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 914 | return |
| 915 | fi |
| 916 | ;; |
| 917 | |
| 918 | # The filtering in the following two options (-u and -U) do the following |
| 919 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 920 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 921 | # - keep one of each non-unique line |
| 922 | # - count how many lines remain |
| 923 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 924 | # if there were no duplicates. |
| 925 | "-U") |
| 926 | 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 |
| 927 | fail "lines following pattern '$2' must be unique in Server output" |
| 928 | return |
| 929 | fi |
| 930 | ;; |
| 931 | |
| 932 | "-u") |
| 933 | 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 |
| 934 | 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] | 935 | return |
| 936 | fi |
| 937 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 938 | "-F") |
| 939 | if ! $2 "$SRV_OUT"; then |
| 940 | fail "function call to '$2' failed on Server output" |
| 941 | return |
| 942 | fi |
| 943 | ;; |
| 944 | "-f") |
| 945 | if ! $2 "$CLI_OUT"; then |
| 946 | fail "function call to '$2' failed on Client output" |
| 947 | return |
| 948 | fi |
| 949 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 950 | "-g") |
| 951 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 952 | fail "function call to '$2' failed on Server and Client output" |
| 953 | return |
| 954 | fi |
| 955 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 956 | |
| 957 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 958 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 959 | exit 1 |
| 960 | esac |
| 961 | shift 2 |
| 962 | done |
| 963 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 964 | # check valgrind's results |
| 965 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 966 | 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] | 967 | fail "Server has memory errors" |
| 968 | return |
| 969 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 970 | 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] | 971 | fail "Client has memory errors" |
| 972 | return |
| 973 | fi |
| 974 | fi |
| 975 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 976 | # if we're here, everything is ok |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 977 | outcome=PASS |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 978 | } |
| 979 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 980 | # Run the current test case: start the server and if applicable the proxy, run |
| 981 | # the client, wait for all processes to finish or time out. |
| 982 | # |
| 983 | # Inputs: |
| 984 | # * $NAME: test case name |
| 985 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 986 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 987 | # |
| 988 | # Outputs: |
| 989 | # * $CLI_EXIT: client return code |
| 990 | # * $SRV_RET: server return code |
| 991 | do_run_test_once() { |
| 992 | # run the commands |
| 993 | if [ -n "$PXY_CMD" ]; then |
| 994 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 995 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 996 | PXY_PID=$! |
| 997 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 998 | fi |
| 999 | |
| 1000 | check_osrv_dtls |
| 1001 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1002 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1003 | SRV_PID=$! |
| 1004 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1005 | |
| 1006 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1007 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1008 | wait_client_done |
| 1009 | |
| 1010 | sleep 0.05 |
| 1011 | |
| 1012 | # terminate the server (and the proxy) |
| 1013 | kill $SRV_PID |
| 1014 | wait $SRV_PID |
| 1015 | SRV_RET=$? |
| 1016 | |
| 1017 | if [ -n "$PXY_CMD" ]; then |
| 1018 | kill $PXY_PID >/dev/null 2>&1 |
| 1019 | wait $PXY_PID |
| 1020 | fi |
| 1021 | } |
| 1022 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1023 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1024 | # Options: -s pattern pattern that must be present in server output |
| 1025 | # -c pattern pattern that must be present in client output |
| 1026 | # -u pattern lines after pattern must be unique in client output |
| 1027 | # -f call shell function on client output |
| 1028 | # -S pattern pattern that must be absent in server output |
| 1029 | # -C pattern pattern that must be absent in client output |
| 1030 | # -U pattern lines after pattern must be unique in server output |
| 1031 | # -F call shell function on server output |
| 1032 | # -g call shell function on server and client output |
| 1033 | run_test() { |
| 1034 | NAME="$1" |
| 1035 | shift 1 |
| 1036 | |
| 1037 | if is_excluded "$NAME"; then |
| 1038 | SKIP_NEXT="NO" |
| 1039 | # There was no request to run the test, so don't record its outcome. |
| 1040 | return |
| 1041 | fi |
| 1042 | |
| 1043 | print_name "$NAME" |
| 1044 | |
| 1045 | # Do we only run numbered tests? |
| 1046 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1047 | case ",$RUN_TEST_NUMBER," in |
| 1048 | *",$TESTS,"*) :;; |
| 1049 | *) SKIP_NEXT="YES";; |
| 1050 | esac |
| 1051 | fi |
| 1052 | |
| 1053 | # does this test use a proxy? |
| 1054 | if [ "X$1" = "X-p" ]; then |
| 1055 | PXY_CMD="$2" |
| 1056 | shift 2 |
| 1057 | else |
| 1058 | PXY_CMD="" |
| 1059 | fi |
| 1060 | |
| 1061 | # get commands and client output |
| 1062 | SRV_CMD="$1" |
| 1063 | CLI_CMD="$2" |
| 1064 | CLI_EXPECT="$3" |
| 1065 | shift 3 |
| 1066 | |
| 1067 | # Check if test uses files |
| 1068 | case "$SRV_CMD $CLI_CMD" in |
| 1069 | *data_files/*) |
| 1070 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1071 | esac |
| 1072 | |
| 1073 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1074 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1075 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1076 | |
| 1077 | # should we skip? |
| 1078 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1079 | SKIP_NEXT="NO" |
| 1080 | record_outcome "SKIP" |
| 1081 | SKIPS=$(( $SKIPS + 1 )) |
| 1082 | return |
| 1083 | fi |
| 1084 | |
| 1085 | analyze_test_commands "$@" |
| 1086 | |
| 1087 | TIMES_LEFT=2 |
| 1088 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1089 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1090 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1091 | do_run_test_once |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1092 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1093 | check_test_failure "$@" |
| 1094 | case $outcome in |
| 1095 | PASS) break;; |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1096 | RETRY*) printf "$outcome ";; |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1097 | FAIL) return;; |
| 1098 | esac |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1099 | done |
| 1100 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1101 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1102 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1103 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1104 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1105 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1106 | if [ -n "$PXY_CMD" ]; then |
| 1107 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1108 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1109 | fi |
| 1110 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1111 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1112 | } |
| 1113 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1114 | run_test_psa() { |
| 1115 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1116 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1117 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1118 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1119 | 0 \ |
| 1120 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1121 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1122 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1123 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1124 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1125 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1126 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1127 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1128 | -C "Failed to setup PSA-based cipher context"\ |
| 1129 | -S "Failed to setup PSA-based cipher context"\ |
| 1130 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1131 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1132 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1133 | -S "error" \ |
| 1134 | -C "error" |
| 1135 | } |
| 1136 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1137 | run_test_psa_force_curve() { |
| 1138 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1139 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1140 | "$P_SRV debug_level=4 force_version=tls12" \ |
| 1141 | "$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] | 1142 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1143 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1144 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1145 | -c "PSA calc verify" \ |
| 1146 | -c "calc PSA finished" \ |
| 1147 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1148 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1149 | -s "PSA calc verify" \ |
| 1150 | -s "calc PSA finished" \ |
| 1151 | -C "Failed to setup PSA-based cipher context"\ |
| 1152 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1153 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1154 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1155 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1156 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1157 | -C "error" |
| 1158 | } |
| 1159 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1160 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1161 | # a maximum fragment length. |
| 1162 | # first argument ($1) is MFL for SSL client |
| 1163 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1164 | run_test_memory_after_hanshake_with_mfl() |
| 1165 | { |
| 1166 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1167 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1168 | |
| 1169 | # Leave some margin for robustness |
| 1170 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1171 | |
| 1172 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1173 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1174 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1175 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1176 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1177 | 0 \ |
| 1178 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1179 | } |
| 1180 | |
| 1181 | |
| 1182 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1183 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1184 | run_tests_memory_after_hanshake() |
| 1185 | { |
| 1186 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1187 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1188 | |
| 1189 | # first test with default MFU is to get reference memory usage |
| 1190 | MEMORY_USAGE_MFL_16K=0 |
| 1191 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1192 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1193 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1194 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1195 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1196 | 0 \ |
| 1197 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1198 | |
| 1199 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1200 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1201 | |
| 1202 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1203 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1204 | |
| 1205 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1206 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1207 | |
| 1208 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1209 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1210 | } |
| 1211 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1212 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1213 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1214 | rm -f context_srv.txt |
| 1215 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1216 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1217 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1218 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1219 | 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] | 1220 | exit 1 |
| 1221 | } |
| 1222 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1223 | # |
| 1224 | # MAIN |
| 1225 | # |
| 1226 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1227 | get_options "$@" |
| 1228 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1229 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1230 | # patterns rather than regular expressions, use a case statement instead |
| 1231 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1232 | # detects simple cases: plain substring, everything, nothing. |
| 1233 | # |
| 1234 | # As an exception, the character '.' is treated as an ordinary character |
| 1235 | # if it is the only special character in the string. This is because it's |
| 1236 | # rare to need "any one character", but needing a literal '.' is common |
| 1237 | # (e.g. '-f "DTLS 1.2"'). |
| 1238 | need_grep= |
| 1239 | case "$FILTER" in |
| 1240 | '^$') simple_filter=;; |
| 1241 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1242 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1243 | need_grep=1;; |
| 1244 | *) # No regexp or shell-pattern special character |
| 1245 | simple_filter="*$FILTER*";; |
| 1246 | esac |
| 1247 | case "$EXCLUDE" in |
| 1248 | '^$') simple_exclude=;; |
| 1249 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1250 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1251 | need_grep=1;; |
| 1252 | *) # No regexp or shell-pattern special character |
| 1253 | simple_exclude="*$EXCLUDE*";; |
| 1254 | esac |
| 1255 | if [ -n "$need_grep" ]; then |
| 1256 | is_excluded () { |
| 1257 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1258 | } |
| 1259 | else |
| 1260 | is_excluded () { |
| 1261 | case "$1" in |
| 1262 | $simple_exclude) true;; |
| 1263 | $simple_filter) false;; |
| 1264 | *) true;; |
| 1265 | esac |
| 1266 | } |
| 1267 | fi |
| 1268 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1269 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1270 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1271 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1272 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1273 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1274 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1275 | exit 1 |
| 1276 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1277 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1278 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1279 | exit 1 |
| 1280 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1281 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1282 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1283 | exit 1 |
| 1284 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1285 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1286 | if which valgrind >/dev/null 2>&1; then :; else |
| 1287 | echo "Memcheck not possible. Valgrind not found" |
| 1288 | exit 1 |
| 1289 | fi |
| 1290 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1291 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1292 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1293 | exit 1 |
| 1294 | fi |
| 1295 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1296 | # used by watchdog |
| 1297 | MAIN_PID="$$" |
| 1298 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1299 | # We use somewhat arbitrary delays for tests: |
| 1300 | # - how long do we wait for the server to start (when lsof not available)? |
| 1301 | # - how long do we allow for the client to finish? |
| 1302 | # (not to check performance, just to avoid waiting indefinitely) |
| 1303 | # Things are slower with valgrind, so give extra time here. |
| 1304 | # |
| 1305 | # Note: without lsof, there is a trade-off between the running time of this |
| 1306 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1307 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1308 | # 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] | 1309 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1310 | START_DELAY=6 |
| 1311 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1312 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1313 | START_DELAY=2 |
| 1314 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1315 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1316 | |
| 1317 | # some particular tests need more time: |
| 1318 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1319 | # - for the server, we sleep for a number of seconds after the client exits |
| 1320 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1321 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1322 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1323 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1324 | # 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] | 1325 | # +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] | 1326 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1327 | # 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] | 1328 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1329 | 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] | 1330 | 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] | 1331 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1332 | 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] | 1333 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1334 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1335 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1336 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1337 | 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] | 1338 | 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] | 1339 | fi |
| 1340 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 1341 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1342 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1343 | 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] | 1344 | fi |
| 1345 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1346 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1347 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1348 | fi |
| 1349 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1350 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1351 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1352 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1353 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1354 | # Allow SHA-1, because many of our test certificates use it |
| 1355 | P_SRV="$P_SRV allow_sha1=1" |
| 1356 | P_CLI="$P_CLI allow_sha1=1" |
| 1357 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1358 | # Also pick a unique name for intermediate files |
| 1359 | SRV_OUT="srv_out.$$" |
| 1360 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1361 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1362 | SESSION="session.$$" |
| 1363 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1364 | SKIP_NEXT="NO" |
| 1365 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1366 | trap cleanup INT TERM HUP |
| 1367 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1368 | # Basic test |
| 1369 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1370 | # Checks that: |
| 1371 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1372 | # - the expected (highest security) parameters are selected |
| 1373 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1374 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1375 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1376 | "$P_CLI" \ |
| 1377 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1378 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1379 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1380 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1381 | -s "ECDHE curve: secp521r1" \ |
| 1382 | -S "error" \ |
| 1383 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1384 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1385 | run_test "Default, DTLS" \ |
| 1386 | "$P_SRV dtls=1" \ |
| 1387 | "$P_CLI dtls=1" \ |
| 1388 | 0 \ |
| 1389 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1390 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1391 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1392 | run_test "TLS client auth: required" \ |
| 1393 | "$P_SRV auth_mode=required" \ |
| 1394 | "$P_CLI" \ |
| 1395 | 0 \ |
| 1396 | -s "Verifying peer X.509 certificate... ok" |
| 1397 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1398 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1399 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1400 | requires_config_enabled MBEDTLS_SHA256_C |
| 1401 | run_test "TLS: password protected client key" \ |
| 1402 | "$P_SRV auth_mode=required" \ |
| 1403 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1404 | 0 |
| 1405 | |
| 1406 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1407 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1408 | requires_config_enabled MBEDTLS_SHA256_C |
| 1409 | run_test "TLS: password protected server key" \ |
| 1410 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1411 | "$P_CLI" \ |
| 1412 | 0 |
| 1413 | |
| 1414 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1415 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1416 | requires_config_enabled MBEDTLS_RSA_C |
| 1417 | requires_config_enabled MBEDTLS_SHA256_C |
| 1418 | run_test "TLS: password protected server key, two certificates" \ |
| 1419 | "$P_SRV \ |
| 1420 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1421 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1422 | "$P_CLI" \ |
| 1423 | 0 |
| 1424 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1425 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1426 | run_test "Default (compression enabled)" \ |
| 1427 | "$P_SRV debug_level=3" \ |
| 1428 | "$P_CLI debug_level=3" \ |
| 1429 | 0 \ |
| 1430 | -s "Allocating compression buffer" \ |
| 1431 | -c "Allocating compression buffer" \ |
| 1432 | -s "Record expansion is unknown (compression)" \ |
| 1433 | -c "Record expansion is unknown (compression)" \ |
| 1434 | -S "error" \ |
| 1435 | -C "error" |
| 1436 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1437 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1438 | run_test "CA callback on client" \ |
| 1439 | "$P_SRV debug_level=3" \ |
| 1440 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1441 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1442 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1443 | -S "error" \ |
| 1444 | -C "error" |
| 1445 | |
| 1446 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1447 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1448 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1449 | requires_config_enabled MBEDTLS_SHA256_C |
| 1450 | run_test "CA callback on server" \ |
| 1451 | "$P_SRV auth_mode=required" \ |
| 1452 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1453 | key_file=data_files/server5.key" \ |
| 1454 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1455 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1456 | -s "Verifying peer X.509 certificate... ok" \ |
| 1457 | -S "error" \ |
| 1458 | -C "error" |
| 1459 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1460 | # Test using an opaque private key for client authentication |
| 1461 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1462 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1463 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1464 | requires_config_enabled MBEDTLS_SHA256_C |
| 1465 | run_test "Opaque key for client authentication" \ |
| 1466 | "$P_SRV auth_mode=required" \ |
| 1467 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1468 | key_file=data_files/server5.key" \ |
| 1469 | 0 \ |
| 1470 | -c "key type: Opaque" \ |
| 1471 | -s "Verifying peer X.509 certificate... ok" \ |
| 1472 | -S "error" \ |
| 1473 | -C "error" |
| 1474 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1475 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1476 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1477 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1478 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1479 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1480 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1481 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1482 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1483 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1484 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1485 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1486 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1487 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1488 | run_test_psa_force_curve "secp521r1" |
| 1489 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1490 | run_test_psa_force_curve "brainpoolP512r1" |
| 1491 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1492 | run_test_psa_force_curve "secp384r1" |
| 1493 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1494 | run_test_psa_force_curve "brainpoolP384r1" |
| 1495 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1496 | run_test_psa_force_curve "secp256r1" |
| 1497 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1498 | run_test_psa_force_curve "secp256k1" |
| 1499 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1500 | run_test_psa_force_curve "brainpoolP256r1" |
| 1501 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1502 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1503 | ## SECP224K1 is buggy via the PSA API |
| 1504 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1505 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1506 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1507 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1508 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1509 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1510 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1511 | run_test_psa_force_curve "secp192r1" |
| 1512 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1513 | run_test_psa_force_curve "secp192k1" |
| 1514 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1515 | # Test current time in ServerHello |
| 1516 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1517 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1518 | "$P_SRV debug_level=3" \ |
| 1519 | "$P_CLI debug_level=3" \ |
| 1520 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1521 | -f "check_server_hello_time" \ |
| 1522 | -F "check_server_hello_time" |
| 1523 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1524 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1525 | run_test "Unique IV in GCM" \ |
| 1526 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1527 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1528 | 0 \ |
| 1529 | -u "IV used" \ |
| 1530 | -U "IV used" |
| 1531 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1532 | # Tests for certificate verification callback |
| 1533 | run_test "Configuration-specific CRT verification callback" \ |
| 1534 | "$P_SRV debug_level=3" \ |
| 1535 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1536 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1537 | -S "error" \ |
| 1538 | -c "Verify requested for " \ |
| 1539 | -c "Use configuration-specific verification callback" \ |
| 1540 | -C "Use context-specific verification callback" \ |
| 1541 | -C "error" |
| 1542 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1543 | run_test "Context-specific CRT verification callback" \ |
| 1544 | "$P_SRV debug_level=3" \ |
| 1545 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1546 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1547 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1548 | -c "Verify requested for " \ |
| 1549 | -c "Use context-specific verification callback" \ |
| 1550 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1551 | -C "error" |
| 1552 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1553 | # Tests for rc4 option |
| 1554 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1555 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1556 | run_test "RC4: server disabled, client enabled" \ |
| 1557 | "$P_SRV" \ |
| 1558 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1559 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1560 | -s "SSL - The server has no ciphersuites in common" |
| 1561 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1562 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1563 | run_test "RC4: server half, client enabled" \ |
| 1564 | "$P_SRV arc4=1" \ |
| 1565 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1566 | 1 \ |
| 1567 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1568 | |
| 1569 | run_test "RC4: server enabled, client disabled" \ |
| 1570 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1571 | "$P_CLI" \ |
| 1572 | 1 \ |
| 1573 | -s "SSL - The server has no ciphersuites in common" |
| 1574 | |
| 1575 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1576 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1577 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1578 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1579 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1580 | -S "SSL - The server has no ciphersuites in common" |
| 1581 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1582 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1583 | |
| 1584 | requires_gnutls |
| 1585 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1586 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1587 | "$G_SRV"\ |
| 1588 | "$P_CLI force_version=tls1_1" \ |
| 1589 | 0 |
| 1590 | |
| 1591 | requires_gnutls |
| 1592 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1593 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1594 | "$G_SRV"\ |
| 1595 | "$P_CLI force_version=tls1" \ |
| 1596 | 0 |
| 1597 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1598 | # Tests for SHA-1 support |
| 1599 | |
| 1600 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1601 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1602 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1603 | 1 \ |
| 1604 | -c "The certificate is signed with an unacceptable hash" |
| 1605 | |
| 1606 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1607 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1608 | "$P_CLI allow_sha1=1" \ |
| 1609 | 0 |
| 1610 | |
| 1611 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1612 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1613 | "$P_CLI allow_sha1=0" \ |
| 1614 | 0 |
| 1615 | |
| 1616 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1617 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1618 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1619 | 1 \ |
| 1620 | -s "The certificate is signed with an unacceptable hash" |
| 1621 | |
| 1622 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1623 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1624 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1625 | 0 |
| 1626 | |
| 1627 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1628 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1629 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1630 | 0 |
| 1631 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1632 | # Tests for datagram packing |
| 1633 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1634 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1635 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1636 | 0 \ |
| 1637 | -c "next record in same datagram" \ |
| 1638 | -s "next record in same datagram" |
| 1639 | |
| 1640 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1641 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1642 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1643 | 0 \ |
| 1644 | -s "next record in same datagram" \ |
| 1645 | -C "next record in same datagram" |
| 1646 | |
| 1647 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1648 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1649 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1650 | 0 \ |
| 1651 | -S "next record in same datagram" \ |
| 1652 | -c "next record in same datagram" |
| 1653 | |
| 1654 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1655 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1656 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1657 | 0 \ |
| 1658 | -S "next record in same datagram" \ |
| 1659 | -C "next record in same datagram" |
| 1660 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1661 | # Tests for Truncated HMAC extension |
| 1662 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1663 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1664 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1665 | "$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] | 1666 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1667 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1668 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1669 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1670 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1671 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1672 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1673 | "$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] | 1674 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1675 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1676 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1677 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1678 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1679 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1680 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1681 | "$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] | 1682 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1683 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1684 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1685 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1686 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1687 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1688 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1689 | "$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] | 1690 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1691 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1692 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1693 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1694 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1695 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1696 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1697 | "$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] | 1698 | 0 \ |
| 1699 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1700 | -S "dumping 'expected mac' (10 bytes)" |
| 1701 | |
| 1702 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1703 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1704 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1705 | "$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] | 1706 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1707 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1708 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1709 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1710 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1711 | "$P_SRV dtls=1 debug_level=4" \ |
| 1712 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1713 | 0 \ |
| 1714 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1715 | -S "dumping 'expected mac' (10 bytes)" |
| 1716 | |
| 1717 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1718 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1719 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1720 | "$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] | 1721 | 0 \ |
| 1722 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1723 | -S "dumping 'expected mac' (10 bytes)" |
| 1724 | |
| 1725 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1726 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1727 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1728 | "$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] | 1729 | 0 \ |
| 1730 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1731 | -S "dumping 'expected mac' (10 bytes)" |
| 1732 | |
| 1733 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1734 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1735 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1736 | "$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] | 1737 | 0 \ |
| 1738 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1739 | -S "dumping 'expected mac' (10 bytes)" |
| 1740 | |
| 1741 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1742 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1743 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1744 | "$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] | 1745 | 0 \ |
| 1746 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1747 | -S "dumping 'expected mac' (10 bytes)" |
| 1748 | |
| 1749 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1750 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1751 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1752 | "$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] | 1753 | 0 \ |
| 1754 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1755 | -s "dumping 'expected mac' (10 bytes)" |
| 1756 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1757 | # Tests for Context serialization |
| 1758 | |
| 1759 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1760 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1761 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1762 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1763 | 0 \ |
| 1764 | -c "Deserializing connection..." \ |
| 1765 | -S "Deserializing connection..." |
| 1766 | |
| 1767 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1768 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1769 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1770 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1771 | 0 \ |
| 1772 | -c "Deserializing connection..." \ |
| 1773 | -S "Deserializing connection..." |
| 1774 | |
| 1775 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1776 | run_test "Context serialization, client serializes, GCM" \ |
| 1777 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1778 | "$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] | 1779 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1780 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1781 | -S "Deserializing connection..." |
| 1782 | |
| 1783 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1784 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1785 | run_test "Context serialization, client serializes, with CID" \ |
| 1786 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1787 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1788 | 0 \ |
| 1789 | -c "Deserializing connection..." \ |
| 1790 | -S "Deserializing connection..." |
| 1791 | |
| 1792 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1793 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1794 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1795 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1796 | 0 \ |
| 1797 | -C "Deserializing connection..." \ |
| 1798 | -s "Deserializing connection..." |
| 1799 | |
| 1800 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1801 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1802 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1803 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1804 | 0 \ |
| 1805 | -C "Deserializing connection..." \ |
| 1806 | -s "Deserializing connection..." |
| 1807 | |
| 1808 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1809 | run_test "Context serialization, server serializes, GCM" \ |
| 1810 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1811 | "$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] | 1812 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1813 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1814 | -s "Deserializing connection..." |
| 1815 | |
| 1816 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1817 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1818 | run_test "Context serialization, server serializes, with CID" \ |
| 1819 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1820 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1821 | 0 \ |
| 1822 | -C "Deserializing connection..." \ |
| 1823 | -s "Deserializing connection..." |
| 1824 | |
| 1825 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1826 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1827 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1828 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1829 | 0 \ |
| 1830 | -c "Deserializing connection..." \ |
| 1831 | -s "Deserializing connection..." |
| 1832 | |
| 1833 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1834 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1835 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1836 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1837 | 0 \ |
| 1838 | -c "Deserializing connection..." \ |
| 1839 | -s "Deserializing connection..." |
| 1840 | |
| 1841 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1842 | run_test "Context serialization, both serialize, GCM" \ |
| 1843 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1844 | "$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] | 1845 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1846 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1847 | -s "Deserializing connection..." |
| 1848 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1849 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1850 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1851 | run_test "Context serialization, both serialize, with CID" \ |
| 1852 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1853 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1854 | 0 \ |
| 1855 | -c "Deserializing connection..." \ |
| 1856 | -s "Deserializing connection..." |
| 1857 | |
| 1858 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1859 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1860 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1861 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1862 | 0 \ |
| 1863 | -c "Deserializing connection..." \ |
| 1864 | -S "Deserializing connection..." |
| 1865 | |
| 1866 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1867 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1868 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1869 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1870 | 0 \ |
| 1871 | -c "Deserializing connection..." \ |
| 1872 | -S "Deserializing connection..." |
| 1873 | |
| 1874 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1875 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1876 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1877 | "$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] | 1878 | 0 \ |
| 1879 | -c "Deserializing connection..." \ |
| 1880 | -S "Deserializing connection..." |
| 1881 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1882 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1883 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1884 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1885 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1886 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1887 | 0 \ |
| 1888 | -c "Deserializing connection..." \ |
| 1889 | -S "Deserializing connection..." |
| 1890 | |
| 1891 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1892 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1893 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1894 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1895 | 0 \ |
| 1896 | -C "Deserializing connection..." \ |
| 1897 | -s "Deserializing connection..." |
| 1898 | |
| 1899 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1900 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1901 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1902 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1903 | 0 \ |
| 1904 | -C "Deserializing connection..." \ |
| 1905 | -s "Deserializing connection..." |
| 1906 | |
| 1907 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1908 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1909 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1910 | "$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] | 1911 | 0 \ |
| 1912 | -C "Deserializing connection..." \ |
| 1913 | -s "Deserializing connection..." |
| 1914 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1915 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1916 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1917 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1918 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1919 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1920 | 0 \ |
| 1921 | -C "Deserializing connection..." \ |
| 1922 | -s "Deserializing connection..." |
| 1923 | |
| 1924 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1925 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1926 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1927 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1928 | 0 \ |
| 1929 | -c "Deserializing connection..." \ |
| 1930 | -s "Deserializing connection..." |
| 1931 | |
| 1932 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1933 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1934 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1935 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1936 | 0 \ |
| 1937 | -c "Deserializing connection..." \ |
| 1938 | -s "Deserializing connection..." |
| 1939 | |
| 1940 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1941 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1942 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1943 | "$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] | 1944 | 0 \ |
| 1945 | -c "Deserializing connection..." \ |
| 1946 | -s "Deserializing connection..." |
| 1947 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1948 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1949 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1950 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1951 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1952 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1953 | 0 \ |
| 1954 | -c "Deserializing connection..." \ |
| 1955 | -s "Deserializing connection..." |
| 1956 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1957 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1958 | run_test "Saving the serialized context to a file" \ |
| 1959 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1960 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1961 | 0 \ |
| 1962 | -s "Save serialized context to a file... ok" \ |
| 1963 | -c "Save serialized context to a file... ok" |
| 1964 | rm -f context_srv.txt |
| 1965 | rm -f context_cli.txt |
| 1966 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1967 | # Tests for DTLS Connection ID extension |
| 1968 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1969 | # So far, the CID API isn't implemented, so we can't |
| 1970 | # grep for output witnessing its use. This needs to be |
| 1971 | # changed once the CID extension is implemented. |
| 1972 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1973 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1974 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1975 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1976 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1977 | 0 \ |
| 1978 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1979 | -s "found CID extension" \ |
| 1980 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1981 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1982 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1983 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1984 | -C "found CID extension" \ |
| 1985 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1986 | -C "Copy CIDs into SSL transform" \ |
| 1987 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1988 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1989 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1990 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1991 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1992 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1993 | 0 \ |
| 1994 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1995 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1996 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1997 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1998 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1999 | -C "found CID extension" \ |
| 2000 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2001 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2002 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2003 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2004 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2005 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2006 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2007 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2008 | 0 \ |
| 2009 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2010 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2011 | -c "client hello, adding CID extension" \ |
| 2012 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2013 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2014 | -s "server hello, adding CID extension" \ |
| 2015 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2016 | -c "Use of CID extension negotiated" \ |
| 2017 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2018 | -c "Copy CIDs into SSL transform" \ |
| 2019 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2020 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2021 | -s "Use of Connection ID has been negotiated" \ |
| 2022 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2023 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2024 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2025 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2026 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2027 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2028 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2029 | 0 \ |
| 2030 | -c "Enable use of CID extension." \ |
| 2031 | -s "Enable use of CID extension." \ |
| 2032 | -c "client hello, adding CID extension" \ |
| 2033 | -s "found CID extension" \ |
| 2034 | -s "Use of CID extension negotiated" \ |
| 2035 | -s "server hello, adding CID extension" \ |
| 2036 | -c "found CID extension" \ |
| 2037 | -c "Use of CID extension negotiated" \ |
| 2038 | -s "Copy CIDs into SSL transform" \ |
| 2039 | -c "Copy CIDs into SSL transform" \ |
| 2040 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2041 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2042 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2043 | -c "Use of Connection ID has been negotiated" \ |
| 2044 | -c "ignoring unexpected CID" \ |
| 2045 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2046 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2047 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2048 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2049 | -p "$P_PXY mtu=800" \ |
| 2050 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2051 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2052 | 0 \ |
| 2053 | -c "Enable use of CID extension." \ |
| 2054 | -s "Enable use of CID extension." \ |
| 2055 | -c "client hello, adding CID extension" \ |
| 2056 | -s "found CID extension" \ |
| 2057 | -s "Use of CID extension negotiated" \ |
| 2058 | -s "server hello, adding CID extension" \ |
| 2059 | -c "found CID extension" \ |
| 2060 | -c "Use of CID extension negotiated" \ |
| 2061 | -s "Copy CIDs into SSL transform" \ |
| 2062 | -c "Copy CIDs into SSL transform" \ |
| 2063 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2064 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2065 | -s "Use of Connection ID has been negotiated" \ |
| 2066 | -c "Use of Connection ID has been negotiated" |
| 2067 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2068 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2069 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2070 | -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] | 2071 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2072 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2073 | 0 \ |
| 2074 | -c "Enable use of CID extension." \ |
| 2075 | -s "Enable use of CID extension." \ |
| 2076 | -c "client hello, adding CID extension" \ |
| 2077 | -s "found CID extension" \ |
| 2078 | -s "Use of CID extension negotiated" \ |
| 2079 | -s "server hello, adding CID extension" \ |
| 2080 | -c "found CID extension" \ |
| 2081 | -c "Use of CID extension negotiated" \ |
| 2082 | -s "Copy CIDs into SSL transform" \ |
| 2083 | -c "Copy CIDs into SSL transform" \ |
| 2084 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2085 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2086 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2087 | -c "Use of Connection ID has been negotiated" \ |
| 2088 | -c "ignoring unexpected CID" \ |
| 2089 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2090 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2091 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2092 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2093 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2094 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2095 | 0 \ |
| 2096 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2097 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2098 | -c "client hello, adding CID extension" \ |
| 2099 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2100 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2101 | -s "server hello, adding CID extension" \ |
| 2102 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2103 | -c "Use of CID extension negotiated" \ |
| 2104 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2105 | -c "Copy CIDs into SSL transform" \ |
| 2106 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2107 | -s "Peer CID (length 0 Bytes):" \ |
| 2108 | -s "Use of Connection ID has been negotiated" \ |
| 2109 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2110 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2111 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2112 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2113 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2114 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2115 | 0 \ |
| 2116 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2117 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2118 | -c "client hello, adding CID extension" \ |
| 2119 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2120 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2121 | -s "server hello, adding CID extension" \ |
| 2122 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2123 | -c "Use of CID extension negotiated" \ |
| 2124 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2125 | -c "Copy CIDs into SSL transform" \ |
| 2126 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2127 | -c "Peer CID (length 0 Bytes):" \ |
| 2128 | -s "Use of Connection ID has been negotiated" \ |
| 2129 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2130 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2131 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2132 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2133 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2134 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2135 | 0 \ |
| 2136 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2137 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2138 | -c "client hello, adding CID extension" \ |
| 2139 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2140 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2141 | -s "server hello, adding CID extension" \ |
| 2142 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2143 | -c "Use of CID extension negotiated" \ |
| 2144 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2145 | -c "Copy CIDs into SSL transform" \ |
| 2146 | -S "Use of Connection ID has been negotiated" \ |
| 2147 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2148 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2149 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2150 | 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] | 2151 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2152 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2153 | 0 \ |
| 2154 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2155 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2156 | -c "client hello, adding CID extension" \ |
| 2157 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2158 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2159 | -s "server hello, adding CID extension" \ |
| 2160 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2161 | -c "Use of CID extension negotiated" \ |
| 2162 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2163 | -c "Copy CIDs into SSL transform" \ |
| 2164 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2165 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2166 | -s "Use of Connection ID has been negotiated" \ |
| 2167 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2168 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2169 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2170 | 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] | 2171 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2172 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2173 | 0 \ |
| 2174 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2175 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2176 | -c "client hello, adding CID extension" \ |
| 2177 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2178 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2179 | -s "server hello, adding CID extension" \ |
| 2180 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2181 | -c "Use of CID extension negotiated" \ |
| 2182 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2183 | -c "Copy CIDs into SSL transform" \ |
| 2184 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2185 | -s "Peer CID (length 0 Bytes):" \ |
| 2186 | -s "Use of Connection ID has been negotiated" \ |
| 2187 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2188 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2189 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2190 | 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] | 2191 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2192 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2193 | 0 \ |
| 2194 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2195 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2196 | -c "client hello, adding CID extension" \ |
| 2197 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2198 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2199 | -s "server hello, adding CID extension" \ |
| 2200 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2201 | -c "Use of CID extension negotiated" \ |
| 2202 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2203 | -c "Copy CIDs into SSL transform" \ |
| 2204 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2205 | -c "Peer CID (length 0 Bytes):" \ |
| 2206 | -s "Use of Connection ID has been negotiated" \ |
| 2207 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2208 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2209 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2210 | 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] | 2211 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2212 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2213 | 0 \ |
| 2214 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2215 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2216 | -c "client hello, adding CID extension" \ |
| 2217 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2218 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2219 | -s "server hello, adding CID extension" \ |
| 2220 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2221 | -c "Use of CID extension negotiated" \ |
| 2222 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2223 | -c "Copy CIDs into SSL transform" \ |
| 2224 | -S "Use of Connection ID has been negotiated" \ |
| 2225 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2226 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2227 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2228 | 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] | 2229 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2230 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2231 | 0 \ |
| 2232 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2233 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2234 | -c "client hello, adding CID extension" \ |
| 2235 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2236 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2237 | -s "server hello, adding CID extension" \ |
| 2238 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2239 | -c "Use of CID extension negotiated" \ |
| 2240 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2241 | -c "Copy CIDs into SSL transform" \ |
| 2242 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2243 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2244 | -s "Use of Connection ID has been negotiated" \ |
| 2245 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2246 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2247 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2248 | 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] | 2249 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2250 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2251 | 0 \ |
| 2252 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2253 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2254 | -c "client hello, adding CID extension" \ |
| 2255 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2256 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2257 | -s "server hello, adding CID extension" \ |
| 2258 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2259 | -c "Use of CID extension negotiated" \ |
| 2260 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2261 | -c "Copy CIDs into SSL transform" \ |
| 2262 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2263 | -s "Peer CID (length 0 Bytes):" \ |
| 2264 | -s "Use of Connection ID has been negotiated" \ |
| 2265 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2266 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2267 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2268 | 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] | 2269 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2270 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2271 | 0 \ |
| 2272 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2273 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2274 | -c "client hello, adding CID extension" \ |
| 2275 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2276 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2277 | -s "server hello, adding CID extension" \ |
| 2278 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2279 | -c "Use of CID extension negotiated" \ |
| 2280 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2281 | -c "Copy CIDs into SSL transform" \ |
| 2282 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2283 | -c "Peer CID (length 0 Bytes):" \ |
| 2284 | -s "Use of Connection ID has been negotiated" \ |
| 2285 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2286 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2287 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2288 | 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] | 2289 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2290 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2291 | 0 \ |
| 2292 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2293 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2294 | -c "client hello, adding CID extension" \ |
| 2295 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2296 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2297 | -s "server hello, adding CID extension" \ |
| 2298 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2299 | -c "Use of CID extension negotiated" \ |
| 2300 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2301 | -c "Copy CIDs into SSL transform" \ |
| 2302 | -S "Use of Connection ID has been negotiated" \ |
| 2303 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2304 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2305 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2306 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2307 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2308 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2309 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2310 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2311 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2312 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2313 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2314 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2315 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2316 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2317 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2318 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2319 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2320 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2321 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2322 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2323 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2324 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2325 | 0 \ |
| 2326 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2327 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2328 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2329 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2330 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2331 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2332 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2333 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2334 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2335 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2336 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2337 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2338 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2339 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2340 | 0 \ |
| 2341 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2342 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2343 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2344 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2345 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2346 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2347 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2348 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2349 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2350 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2351 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2352 | 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] | 2353 | -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] | 2354 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2355 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2356 | 0 \ |
| 2357 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2358 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2359 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2360 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2361 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2362 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2363 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2364 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2365 | -c "ignoring unexpected CID" \ |
| 2366 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2367 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2368 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2369 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2370 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2371 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2372 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2373 | 0 \ |
| 2374 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2375 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2376 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2377 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2378 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2379 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2380 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2381 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2382 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2383 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2384 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2385 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2386 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2387 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2388 | 0 \ |
| 2389 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2390 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2391 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2392 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2393 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2394 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2395 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2396 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2397 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2398 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2399 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2400 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2401 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2402 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2403 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2404 | 0 \ |
| 2405 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2406 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2407 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2408 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2409 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2410 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2411 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2412 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2413 | -c "ignoring unexpected CID" \ |
| 2414 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2415 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2416 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2417 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2418 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2419 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2420 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2421 | 0 \ |
| 2422 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2423 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2424 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2425 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2426 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2427 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2428 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2429 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2430 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2431 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2432 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2433 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2434 | 0 \ |
| 2435 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2436 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2437 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2438 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2439 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2440 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2441 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2442 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2443 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2444 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2445 | -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] | 2446 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2447 | "$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" \ |
| 2448 | 0 \ |
| 2449 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2450 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2451 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2452 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2453 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2454 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2455 | -c "ignoring unexpected CID" \ |
| 2456 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2457 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2458 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2459 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2460 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2461 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2462 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2463 | 0 \ |
| 2464 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2465 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2466 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2467 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2468 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2469 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2470 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2471 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2472 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2473 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2474 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2475 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2476 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2477 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2478 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2479 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2480 | 0 \ |
| 2481 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2482 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2483 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2484 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2485 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2486 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2487 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2488 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2489 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2490 | -c "ignoring unexpected CID" \ |
| 2491 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2492 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2493 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2494 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2495 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2496 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2497 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2498 | 0 \ |
| 2499 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2500 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2501 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2502 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2503 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2504 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2505 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2506 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2507 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2508 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2509 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2510 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2511 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2512 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2513 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2514 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2515 | 0 \ |
| 2516 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2517 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 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" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2524 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2525 | -c "ignoring unexpected CID" \ |
| 2526 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2527 | |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2528 | # This and the test below it require MAX_CONTENT_LEN to be at least MFL+1, because the |
| 2529 | # tests check that the buffer contents are reallocated when the message is |
| 2530 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2531 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2532 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2533 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2534 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2535 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2536 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2537 | 0 \ |
| 2538 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2539 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2540 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2541 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2542 | -s "Reallocating in_buf" \ |
| 2543 | -s "Reallocating out_buf" |
| 2544 | |
| 2545 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2546 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2547 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2548 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2549 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2550 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2551 | 0 \ |
| 2552 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2553 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2554 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2555 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2556 | -s "Reallocating in_buf" \ |
| 2557 | -s "Reallocating out_buf" |
| 2558 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2559 | # Tests for Encrypt-then-MAC extension |
| 2560 | |
| 2561 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2562 | "$P_SRV debug_level=3 \ |
| 2563 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2564 | "$P_CLI debug_level=3" \ |
| 2565 | 0 \ |
| 2566 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2567 | -s "found encrypt then mac extension" \ |
| 2568 | -s "server hello, adding encrypt then mac extension" \ |
| 2569 | -c "found encrypt_then_mac extension" \ |
| 2570 | -c "using encrypt then mac" \ |
| 2571 | -s "using encrypt then mac" |
| 2572 | |
| 2573 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2574 | "$P_SRV debug_level=3 etm=0 \ |
| 2575 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2576 | "$P_CLI debug_level=3 etm=1" \ |
| 2577 | 0 \ |
| 2578 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2579 | -s "found encrypt then mac extension" \ |
| 2580 | -S "server hello, adding encrypt then mac extension" \ |
| 2581 | -C "found encrypt_then_mac extension" \ |
| 2582 | -C "using encrypt then mac" \ |
| 2583 | -S "using encrypt then mac" |
| 2584 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2585 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2586 | "$P_SRV debug_level=3 etm=1 \ |
| 2587 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2588 | "$P_CLI debug_level=3 etm=1" \ |
| 2589 | 0 \ |
| 2590 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2591 | -s "found encrypt then mac extension" \ |
| 2592 | -S "server hello, adding encrypt then mac extension" \ |
| 2593 | -C "found encrypt_then_mac extension" \ |
| 2594 | -C "using encrypt then mac" \ |
| 2595 | -S "using encrypt then mac" |
| 2596 | |
| 2597 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2598 | "$P_SRV debug_level=3 etm=1 \ |
| 2599 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2600 | "$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] | 2601 | 0 \ |
| 2602 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2603 | -s "found encrypt then mac extension" \ |
| 2604 | -S "server hello, adding encrypt then mac extension" \ |
| 2605 | -C "found encrypt_then_mac extension" \ |
| 2606 | -C "using encrypt then mac" \ |
| 2607 | -S "using encrypt then mac" |
| 2608 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2609 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2610 | "$P_SRV debug_level=3 etm=1 \ |
| 2611 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2612 | "$P_CLI debug_level=3 etm=0" \ |
| 2613 | 0 \ |
| 2614 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2615 | -S "found encrypt then mac extension" \ |
| 2616 | -S "server hello, adding encrypt then mac extension" \ |
| 2617 | -C "found encrypt_then_mac extension" \ |
| 2618 | -C "using encrypt then mac" \ |
| 2619 | -S "using encrypt then mac" |
| 2620 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2621 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2622 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2623 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2624 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2625 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2626 | 0 \ |
| 2627 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2628 | -S "found encrypt then mac extension" \ |
| 2629 | -S "server hello, adding encrypt then mac extension" \ |
| 2630 | -C "found encrypt_then_mac extension" \ |
| 2631 | -C "using encrypt then mac" \ |
| 2632 | -S "using encrypt then mac" |
| 2633 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2634 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2635 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2636 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2637 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2638 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2639 | 0 \ |
| 2640 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2641 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2642 | -S "server hello, adding encrypt then mac extension" \ |
| 2643 | -C "found encrypt_then_mac extension" \ |
| 2644 | -C "using encrypt then mac" \ |
| 2645 | -S "using encrypt then mac" |
| 2646 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2647 | # Tests for Extended Master Secret extension |
| 2648 | |
| 2649 | run_test "Extended Master Secret: default" \ |
| 2650 | "$P_SRV debug_level=3" \ |
| 2651 | "$P_CLI debug_level=3" \ |
| 2652 | 0 \ |
| 2653 | -c "client hello, adding extended_master_secret extension" \ |
| 2654 | -s "found extended master secret extension" \ |
| 2655 | -s "server hello, adding extended master secret extension" \ |
| 2656 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2657 | -c "session hash for extended master secret" \ |
| 2658 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2659 | |
| 2660 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2661 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2662 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2663 | 0 \ |
| 2664 | -c "client hello, adding extended_master_secret extension" \ |
| 2665 | -s "found extended master secret extension" \ |
| 2666 | -S "server hello, adding extended master secret extension" \ |
| 2667 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2668 | -C "session hash for extended master secret" \ |
| 2669 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2670 | |
| 2671 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2672 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2673 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2674 | 0 \ |
| 2675 | -C "client hello, adding extended_master_secret extension" \ |
| 2676 | -S "found extended master secret extension" \ |
| 2677 | -S "server hello, adding extended master secret extension" \ |
| 2678 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2679 | -C "session hash for extended master secret" \ |
| 2680 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2681 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2682 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2683 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2684 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2685 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2686 | 0 \ |
| 2687 | -C "client hello, adding extended_master_secret extension" \ |
| 2688 | -S "found extended master secret extension" \ |
| 2689 | -S "server hello, adding extended master secret extension" \ |
| 2690 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2691 | -C "session hash for extended master secret" \ |
| 2692 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2693 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2694 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2695 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2696 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2697 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2698 | 0 \ |
| 2699 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2700 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2701 | -S "server hello, adding extended master secret extension" \ |
| 2702 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2703 | -C "session hash for extended master secret" \ |
| 2704 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2705 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2706 | # Tests for FALLBACK_SCSV |
| 2707 | |
| 2708 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2709 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2710 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2711 | 0 \ |
| 2712 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2713 | -S "received FALLBACK_SCSV" \ |
| 2714 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2715 | -C "is a fatal alert message (msg 86)" |
| 2716 | |
| 2717 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2718 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2719 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2720 | 0 \ |
| 2721 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2722 | -S "received FALLBACK_SCSV" \ |
| 2723 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2724 | -C "is a fatal alert message (msg 86)" |
| 2725 | |
| 2726 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2727 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2728 | "$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] | 2729 | 1 \ |
| 2730 | -c "adding FALLBACK_SCSV" \ |
| 2731 | -s "received FALLBACK_SCSV" \ |
| 2732 | -s "inapropriate fallback" \ |
| 2733 | -c "is a fatal alert message (msg 86)" |
| 2734 | |
| 2735 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2736 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2737 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2738 | 0 \ |
| 2739 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2740 | -s "received FALLBACK_SCSV" \ |
| 2741 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2742 | -C "is a fatal alert message (msg 86)" |
| 2743 | |
| 2744 | requires_openssl_with_fallback_scsv |
| 2745 | run_test "Fallback SCSV: default, openssl server" \ |
| 2746 | "$O_SRV" \ |
| 2747 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2748 | 0 \ |
| 2749 | -C "adding FALLBACK_SCSV" \ |
| 2750 | -C "is a fatal alert message (msg 86)" |
| 2751 | |
| 2752 | requires_openssl_with_fallback_scsv |
| 2753 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2754 | "$O_SRV" \ |
| 2755 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2756 | 1 \ |
| 2757 | -c "adding FALLBACK_SCSV" \ |
| 2758 | -c "is a fatal alert message (msg 86)" |
| 2759 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2760 | requires_openssl_with_fallback_scsv |
| 2761 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2762 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2763 | "$O_CLI -tls1_1" \ |
| 2764 | 0 \ |
| 2765 | -S "received FALLBACK_SCSV" \ |
| 2766 | -S "inapropriate fallback" |
| 2767 | |
| 2768 | requires_openssl_with_fallback_scsv |
| 2769 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2770 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2771 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2772 | 1 \ |
| 2773 | -s "received FALLBACK_SCSV" \ |
| 2774 | -s "inapropriate fallback" |
| 2775 | |
| 2776 | requires_openssl_with_fallback_scsv |
| 2777 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2778 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2779 | "$O_CLI -fallback_scsv" \ |
| 2780 | 0 \ |
| 2781 | -s "received FALLBACK_SCSV" \ |
| 2782 | -S "inapropriate fallback" |
| 2783 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2784 | # Test sending and receiving empty application data records |
| 2785 | |
| 2786 | run_test "Encrypt then MAC: empty application data record" \ |
| 2787 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2788 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2789 | 0 \ |
| 2790 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2791 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2792 | -c "0 bytes written in 1 fragments" |
| 2793 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2794 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2795 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2796 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2797 | 0 \ |
| 2798 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2799 | -c "0 bytes written in 1 fragments" |
| 2800 | |
| 2801 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2802 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2803 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2804 | 0 \ |
| 2805 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2806 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2807 | -c "0 bytes written in 1 fragments" |
| 2808 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2809 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2810 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2811 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2812 | 0 \ |
| 2813 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2814 | -c "0 bytes written in 1 fragments" |
| 2815 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2816 | ## ClientHello generated with |
| 2817 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2818 | ## then manually twiddling the ciphersuite list. |
| 2819 | ## The ClientHello content is spelled out below as a hex string as |
| 2820 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2821 | ## The expected response is an inappropriate_fallback alert. |
| 2822 | requires_openssl_with_fallback_scsv |
| 2823 | run_test "Fallback SCSV: beginning of list" \ |
| 2824 | "$P_SRV debug_level=2" \ |
| 2825 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2826 | 0 \ |
| 2827 | -s "received FALLBACK_SCSV" \ |
| 2828 | -s "inapropriate fallback" |
| 2829 | |
| 2830 | requires_openssl_with_fallback_scsv |
| 2831 | run_test "Fallback SCSV: end of list" \ |
| 2832 | "$P_SRV debug_level=2" \ |
| 2833 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2834 | 0 \ |
| 2835 | -s "received FALLBACK_SCSV" \ |
| 2836 | -s "inapropriate fallback" |
| 2837 | |
| 2838 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2839 | requires_openssl_with_fallback_scsv |
| 2840 | run_test "Fallback SCSV: not in list" \ |
| 2841 | "$P_SRV debug_level=2" \ |
| 2842 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2843 | 0 \ |
| 2844 | -S "received FALLBACK_SCSV" \ |
| 2845 | -S "inapropriate fallback" |
| 2846 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2847 | # Tests for CBC 1/n-1 record splitting |
| 2848 | |
| 2849 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2850 | "$P_SRV" \ |
| 2851 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 2852 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2853 | 0 \ |
| 2854 | -s "Read from client: 123 bytes read" \ |
| 2855 | -S "Read from client: 1 bytes read" \ |
| 2856 | -S "122 bytes read" |
| 2857 | |
| 2858 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2859 | "$P_SRV" \ |
| 2860 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2861 | request_size=123 force_version=tls1_1" \ |
| 2862 | 0 \ |
| 2863 | -s "Read from client: 123 bytes read" \ |
| 2864 | -S "Read from client: 1 bytes read" \ |
| 2865 | -S "122 bytes read" |
| 2866 | |
| 2867 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2868 | "$P_SRV" \ |
| 2869 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2870 | request_size=123 force_version=tls1" \ |
| 2871 | 0 \ |
| 2872 | -S "Read from client: 123 bytes read" \ |
| 2873 | -s "Read from client: 1 bytes read" \ |
| 2874 | -s "122 bytes read" |
| 2875 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2876 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2877 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2878 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2879 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2880 | request_size=123 force_version=ssl3" \ |
| 2881 | 0 \ |
| 2882 | -S "Read from client: 123 bytes read" \ |
| 2883 | -s "Read from client: 1 bytes read" \ |
| 2884 | -s "122 bytes read" |
| 2885 | |
| 2886 | 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] | 2887 | "$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] | 2888 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2889 | request_size=123 force_version=tls1" \ |
| 2890 | 0 \ |
| 2891 | -s "Read from client: 123 bytes read" \ |
| 2892 | -S "Read from client: 1 bytes read" \ |
| 2893 | -S "122 bytes read" |
| 2894 | |
| 2895 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2896 | "$P_SRV" \ |
| 2897 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2898 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2899 | 0 \ |
| 2900 | -s "Read from client: 123 bytes read" \ |
| 2901 | -S "Read from client: 1 bytes read" \ |
| 2902 | -S "122 bytes read" |
| 2903 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2904 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2905 | "$P_SRV nbio=2" \ |
| 2906 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2907 | request_size=123 force_version=tls1" \ |
| 2908 | 0 \ |
| 2909 | -S "Read from client: 123 bytes read" \ |
| 2910 | -s "Read from client: 1 bytes read" \ |
| 2911 | -s "122 bytes read" |
| 2912 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2913 | # Tests for Session Tickets |
| 2914 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2915 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2916 | "$P_SRV debug_level=3 tickets=1" \ |
| 2917 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2918 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2919 | -c "client hello, adding session ticket extension" \ |
| 2920 | -s "found session ticket extension" \ |
| 2921 | -s "server hello, adding session ticket extension" \ |
| 2922 | -c "found session_ticket extension" \ |
| 2923 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2924 | -S "session successfully restored from cache" \ |
| 2925 | -s "session successfully restored from ticket" \ |
| 2926 | -s "a session has been resumed" \ |
| 2927 | -c "a session has been resumed" |
| 2928 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2929 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2930 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2931 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2932 | 0 \ |
| 2933 | -c "client hello, adding session ticket extension" \ |
| 2934 | -s "found session ticket extension" \ |
| 2935 | -s "server hello, adding session ticket extension" \ |
| 2936 | -c "found session_ticket extension" \ |
| 2937 | -c "parse new session ticket" \ |
| 2938 | -S "session successfully restored from cache" \ |
| 2939 | -s "session successfully restored from ticket" \ |
| 2940 | -s "a session has been resumed" \ |
| 2941 | -c "a session has been resumed" |
| 2942 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2943 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2944 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2945 | "$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] | 2946 | 0 \ |
| 2947 | -c "client hello, adding session ticket extension" \ |
| 2948 | -s "found session ticket extension" \ |
| 2949 | -s "server hello, adding session ticket extension" \ |
| 2950 | -c "found session_ticket extension" \ |
| 2951 | -c "parse new session ticket" \ |
| 2952 | -S "session successfully restored from cache" \ |
| 2953 | -S "session successfully restored from ticket" \ |
| 2954 | -S "a session has been resumed" \ |
| 2955 | -C "a session has been resumed" |
| 2956 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2957 | run_test "Session resume using tickets: session copy" \ |
| 2958 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2959 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2960 | 0 \ |
| 2961 | -c "client hello, adding session ticket extension" \ |
| 2962 | -s "found session ticket extension" \ |
| 2963 | -s "server hello, adding session ticket extension" \ |
| 2964 | -c "found session_ticket extension" \ |
| 2965 | -c "parse new session ticket" \ |
| 2966 | -S "session successfully restored from cache" \ |
| 2967 | -s "session successfully restored from ticket" \ |
| 2968 | -s "a session has been resumed" \ |
| 2969 | -c "a session has been resumed" |
| 2970 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2971 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2972 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2973 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2974 | 0 \ |
| 2975 | -c "client hello, adding session ticket extension" \ |
| 2976 | -c "found session_ticket extension" \ |
| 2977 | -c "parse new session ticket" \ |
| 2978 | -c "a session has been resumed" |
| 2979 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2980 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2981 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2982 | "( $O_CLI -sess_out $SESSION; \ |
| 2983 | $O_CLI -sess_in $SESSION; \ |
| 2984 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2985 | 0 \ |
| 2986 | -s "found session ticket extension" \ |
| 2987 | -s "server hello, adding session ticket extension" \ |
| 2988 | -S "session successfully restored from cache" \ |
| 2989 | -s "session successfully restored from ticket" \ |
| 2990 | -s "a session has been resumed" |
| 2991 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2992 | # Tests for Session Tickets with DTLS |
| 2993 | |
| 2994 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2995 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2996 | "$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] | 2997 | 0 \ |
| 2998 | -c "client hello, adding session ticket extension" \ |
| 2999 | -s "found session ticket extension" \ |
| 3000 | -s "server hello, adding session ticket extension" \ |
| 3001 | -c "found session_ticket extension" \ |
| 3002 | -c "parse new session ticket" \ |
| 3003 | -S "session successfully restored from cache" \ |
| 3004 | -s "session successfully restored from ticket" \ |
| 3005 | -s "a session has been resumed" \ |
| 3006 | -c "a session has been resumed" |
| 3007 | |
| 3008 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3009 | "$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] | 3010 | "$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] | 3011 | 0 \ |
| 3012 | -c "client hello, adding session ticket extension" \ |
| 3013 | -s "found session ticket extension" \ |
| 3014 | -s "server hello, adding session ticket extension" \ |
| 3015 | -c "found session_ticket extension" \ |
| 3016 | -c "parse new session ticket" \ |
| 3017 | -S "session successfully restored from cache" \ |
| 3018 | -s "session successfully restored from ticket" \ |
| 3019 | -s "a session has been resumed" \ |
| 3020 | -c "a session has been resumed" |
| 3021 | |
| 3022 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3023 | "$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] | 3024 | "$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] | 3025 | 0 \ |
| 3026 | -c "client hello, adding session ticket extension" \ |
| 3027 | -s "found session ticket extension" \ |
| 3028 | -s "server hello, adding session ticket extension" \ |
| 3029 | -c "found session_ticket extension" \ |
| 3030 | -c "parse new session ticket" \ |
| 3031 | -S "session successfully restored from cache" \ |
| 3032 | -S "session successfully restored from ticket" \ |
| 3033 | -S "a session has been resumed" \ |
| 3034 | -C "a session has been resumed" |
| 3035 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3036 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3037 | "$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] | 3038 | "$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] | 3039 | 0 \ |
| 3040 | -c "client hello, adding session ticket extension" \ |
| 3041 | -s "found session ticket extension" \ |
| 3042 | -s "server hello, adding session ticket extension" \ |
| 3043 | -c "found session_ticket extension" \ |
| 3044 | -c "parse new session ticket" \ |
| 3045 | -S "session successfully restored from cache" \ |
| 3046 | -s "session successfully restored from ticket" \ |
| 3047 | -s "a session has been resumed" \ |
| 3048 | -c "a session has been resumed" |
| 3049 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3050 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3051 | "$O_SRV -dtls1" \ |
| 3052 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3053 | 0 \ |
| 3054 | -c "client hello, adding session ticket extension" \ |
| 3055 | -c "found session_ticket extension" \ |
| 3056 | -c "parse new session ticket" \ |
| 3057 | -c "a session has been resumed" |
| 3058 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3059 | # 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] | 3060 | # 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] | 3061 | requires_openssl_next |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3062 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3063 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3064 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3065 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3066 | rm -f $SESSION )" \ |
| 3067 | 0 \ |
| 3068 | -s "found session ticket extension" \ |
| 3069 | -s "server hello, adding session ticket extension" \ |
| 3070 | -S "session successfully restored from cache" \ |
| 3071 | -s "session successfully restored from ticket" \ |
| 3072 | -s "a session has been resumed" |
| 3073 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3074 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3075 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3076 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3077 | "$P_SRV debug_level=3 tickets=0" \ |
| 3078 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3079 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3080 | -c "client hello, adding session ticket extension" \ |
| 3081 | -s "found session ticket extension" \ |
| 3082 | -S "server hello, adding session ticket extension" \ |
| 3083 | -C "found session_ticket extension" \ |
| 3084 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3085 | -s "session successfully restored from cache" \ |
| 3086 | -S "session successfully restored from ticket" \ |
| 3087 | -s "a session has been resumed" \ |
| 3088 | -c "a session has been resumed" |
| 3089 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3090 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3091 | "$P_SRV debug_level=3 tickets=1" \ |
| 3092 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3093 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3094 | -C "client hello, adding session ticket extension" \ |
| 3095 | -S "found session ticket extension" \ |
| 3096 | -S "server hello, adding session ticket extension" \ |
| 3097 | -C "found session_ticket extension" \ |
| 3098 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3099 | -s "session successfully restored from cache" \ |
| 3100 | -S "session successfully restored from ticket" \ |
| 3101 | -s "a session has been resumed" \ |
| 3102 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3103 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3104 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3105 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3106 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3107 | 0 \ |
| 3108 | -S "session successfully restored from cache" \ |
| 3109 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3110 | -S "a session has been resumed" \ |
| 3111 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3113 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3114 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3115 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3116 | 0 \ |
| 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 | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3122 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3123 | "$P_SRV debug_level=3 tickets=0" \ |
| 3124 | "$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] | 3125 | 0 \ |
| 3126 | -s "session successfully restored from cache" \ |
| 3127 | -S "session successfully restored from ticket" \ |
| 3128 | -s "a session has been resumed" \ |
| 3129 | -c "a session has been resumed" |
| 3130 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3131 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3132 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3133 | "$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] | 3134 | 0 \ |
| 3135 | -S "session successfully restored from cache" \ |
| 3136 | -S "session successfully restored from ticket" \ |
| 3137 | -S "a session has been resumed" \ |
| 3138 | -C "a session has been resumed" |
| 3139 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3140 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3141 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3142 | "$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] | 3143 | 0 \ |
| 3144 | -s "session successfully restored from cache" \ |
| 3145 | -S "session successfully restored from ticket" \ |
| 3146 | -s "a session has been resumed" \ |
| 3147 | -c "a session has been resumed" |
| 3148 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3149 | run_test "Session resume using cache: session copy" \ |
| 3150 | "$P_SRV debug_level=3 tickets=0" \ |
| 3151 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3152 | 0 \ |
| 3153 | -s "session successfully restored from cache" \ |
| 3154 | -S "session successfully restored from ticket" \ |
| 3155 | -s "a session has been resumed" \ |
| 3156 | -c "a session has been resumed" |
| 3157 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3158 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3159 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3160 | "( $O_CLI -sess_out $SESSION; \ |
| 3161 | $O_CLI -sess_in $SESSION; \ |
| 3162 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3163 | 0 \ |
| 3164 | -s "found session ticket extension" \ |
| 3165 | -S "server hello, adding session ticket extension" \ |
| 3166 | -s "session successfully restored from cache" \ |
| 3167 | -S "session successfully restored from ticket" \ |
| 3168 | -s "a session has been resumed" |
| 3169 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3170 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3171 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3172 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3173 | 0 \ |
| 3174 | -C "found session_ticket extension" \ |
| 3175 | -C "parse new session ticket" \ |
| 3176 | -c "a session has been resumed" |
| 3177 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3178 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3179 | |
| 3180 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3181 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3182 | "$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] | 3183 | 0 \ |
| 3184 | -c "client hello, adding session ticket extension" \ |
| 3185 | -s "found session ticket extension" \ |
| 3186 | -S "server hello, adding session ticket extension" \ |
| 3187 | -C "found session_ticket extension" \ |
| 3188 | -C "parse new session ticket" \ |
| 3189 | -s "session successfully restored from cache" \ |
| 3190 | -S "session successfully restored from ticket" \ |
| 3191 | -s "a session has been resumed" \ |
| 3192 | -c "a session has been resumed" |
| 3193 | |
| 3194 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3195 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3196 | "$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] | 3197 | 0 \ |
| 3198 | -C "client hello, adding session ticket extension" \ |
| 3199 | -S "found session ticket extension" \ |
| 3200 | -S "server hello, adding session ticket extension" \ |
| 3201 | -C "found session_ticket extension" \ |
| 3202 | -C "parse new session ticket" \ |
| 3203 | -s "session successfully restored from cache" \ |
| 3204 | -S "session successfully restored from ticket" \ |
| 3205 | -s "a session has been resumed" \ |
| 3206 | -c "a session has been resumed" |
| 3207 | |
| 3208 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3209 | "$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] | 3210 | "$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] | 3211 | 0 \ |
| 3212 | -S "session successfully restored from cache" \ |
| 3213 | -S "session successfully restored from ticket" \ |
| 3214 | -S "a session has been resumed" \ |
| 3215 | -C "a session has been resumed" |
| 3216 | |
| 3217 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3218 | "$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] | 3219 | "$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] | 3220 | 0 \ |
| 3221 | -s "session successfully restored from cache" \ |
| 3222 | -S "session successfully restored from ticket" \ |
| 3223 | -s "a session has been resumed" \ |
| 3224 | -c "a session has been resumed" |
| 3225 | |
| 3226 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3227 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3228 | "$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] | 3229 | 0 \ |
| 3230 | -s "session successfully restored from cache" \ |
| 3231 | -S "session successfully restored from ticket" \ |
| 3232 | -s "a session has been resumed" \ |
| 3233 | -c "a session has been resumed" |
| 3234 | |
| 3235 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3236 | "$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] | 3237 | "$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] | 3238 | 0 \ |
| 3239 | -S "session successfully restored from cache" \ |
| 3240 | -S "session successfully restored from ticket" \ |
| 3241 | -S "a session has been resumed" \ |
| 3242 | -C "a session has been resumed" |
| 3243 | |
| 3244 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3245 | "$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] | 3246 | "$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] | 3247 | 0 \ |
| 3248 | -s "session successfully restored from cache" \ |
| 3249 | -S "session successfully restored from ticket" \ |
| 3250 | -s "a session has been resumed" \ |
| 3251 | -c "a session has been resumed" |
| 3252 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3253 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3254 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3255 | "$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] | 3256 | 0 \ |
| 3257 | -s "session successfully restored from cache" \ |
| 3258 | -S "session successfully restored from ticket" \ |
| 3259 | -s "a session has been resumed" \ |
| 3260 | -c "a session has been resumed" |
| 3261 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3262 | # 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] | 3263 | # 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] | 3264 | requires_openssl_next |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3265 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3266 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3267 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3268 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3269 | rm -f $SESSION )" \ |
| 3270 | 0 \ |
| 3271 | -s "found session ticket extension" \ |
| 3272 | -S "server hello, adding session ticket extension" \ |
| 3273 | -s "session successfully restored from cache" \ |
| 3274 | -S "session successfully restored from ticket" \ |
| 3275 | -s "a session has been resumed" |
| 3276 | |
| 3277 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3278 | "$O_SRV -dtls1" \ |
| 3279 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3280 | 0 \ |
| 3281 | -C "found session_ticket extension" \ |
| 3282 | -C "parse new session ticket" \ |
| 3283 | -c "a session has been resumed" |
| 3284 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3285 | # Tests for Max Fragment Length extension |
| 3286 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3287 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3288 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3289 | "$P_SRV debug_level=3" \ |
| 3290 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3291 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3292 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3293 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3294 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3295 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3296 | -C "client hello, adding max_fragment_length extension" \ |
| 3297 | -S "found max fragment length extension" \ |
| 3298 | -S "server hello, max_fragment_length extension" \ |
| 3299 | -C "found max_fragment_length extension" |
| 3300 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3301 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3302 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3303 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3304 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3305 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3306 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3307 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3308 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3309 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3310 | -C "client hello, adding max_fragment_length extension" \ |
| 3311 | -S "found max fragment length extension" \ |
| 3312 | -S "server hello, max_fragment_length extension" \ |
| 3313 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3314 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3315 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3316 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3317 | |
| 3318 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3319 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3320 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3321 | "$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] | 3322 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3323 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3324 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3325 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3326 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3327 | -C "client hello, adding max_fragment_length extension" \ |
| 3328 | -S "found max fragment length extension" \ |
| 3329 | -S "server hello, max_fragment_length extension" \ |
| 3330 | -C "found max_fragment_length extension" \ |
| 3331 | -c "fragment larger than.*maximum " |
| 3332 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3333 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3334 | # (session fragment length will be 16384 regardless of mbedtls |
| 3335 | # content length configuration.) |
| 3336 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3337 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3338 | run_test "Max fragment length: disabled, larger message" \ |
| 3339 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3340 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3341 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3342 | -C "Maximum input fragment length is 16384" \ |
| 3343 | -C "Maximum output fragment length is 16384" \ |
| 3344 | -S "Maximum input fragment length is 16384" \ |
| 3345 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3346 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3347 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3348 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3349 | |
| 3350 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 18ddccc | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3351 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3352 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3353 | "$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] | 3354 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3355 | -C "Maximum input fragment length is 16384" \ |
| 3356 | -C "Maximum output fragment length is 16384" \ |
| 3357 | -S "Maximum input fragment length is 16384" \ |
| 3358 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3359 | -c "fragment larger than.*maximum " |
| 3360 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3361 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3362 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3363 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3364 | "$P_SRV debug_level=3" \ |
| 3365 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3366 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3367 | -c "Maximum input fragment length is 4096" \ |
| 3368 | -c "Maximum output fragment length is 4096" \ |
| 3369 | -s "Maximum input fragment length is 4096" \ |
| 3370 | -s "Maximum output fragment length is 4096" \ |
| 3371 | -c "client hello, adding max_fragment_length extension" \ |
| 3372 | -s "found max fragment length extension" \ |
| 3373 | -s "server hello, max_fragment_length extension" \ |
| 3374 | -c "found max_fragment_length extension" |
| 3375 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3376 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3377 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3378 | run_test "Max fragment length: client 512, server 1024" \ |
| 3379 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3380 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3381 | 0 \ |
| 3382 | -c "Maximum input fragment length is 512" \ |
| 3383 | -c "Maximum output fragment length is 512" \ |
| 3384 | -s "Maximum input fragment length is 512" \ |
| 3385 | -s "Maximum output fragment length is 512" \ |
| 3386 | -c "client hello, adding max_fragment_length extension" \ |
| 3387 | -s "found max fragment length extension" \ |
| 3388 | -s "server hello, max_fragment_length extension" \ |
| 3389 | -c "found max_fragment_length extension" |
| 3390 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3391 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3392 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3393 | run_test "Max fragment length: client 512, server 2048" \ |
| 3394 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3395 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3396 | 0 \ |
| 3397 | -c "Maximum input fragment length is 512" \ |
| 3398 | -c "Maximum output fragment length is 512" \ |
| 3399 | -s "Maximum input fragment length is 512" \ |
| 3400 | -s "Maximum output fragment length is 512" \ |
| 3401 | -c "client hello, adding max_fragment_length extension" \ |
| 3402 | -s "found max fragment length extension" \ |
| 3403 | -s "server hello, max_fragment_length extension" \ |
| 3404 | -c "found max_fragment_length extension" |
| 3405 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3406 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3407 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3408 | run_test "Max fragment length: client 512, server 4096" \ |
| 3409 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3410 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3411 | 0 \ |
| 3412 | -c "Maximum input fragment length is 512" \ |
| 3413 | -c "Maximum output fragment length is 512" \ |
| 3414 | -s "Maximum input fragment length is 512" \ |
| 3415 | -s "Maximum output fragment length is 512" \ |
| 3416 | -c "client hello, adding max_fragment_length extension" \ |
| 3417 | -s "found max fragment length extension" \ |
| 3418 | -s "server hello, max_fragment_length extension" \ |
| 3419 | -c "found max_fragment_length extension" |
| 3420 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3421 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3422 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3423 | run_test "Max fragment length: client 1024, server 512" \ |
| 3424 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3425 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3426 | 0 \ |
| 3427 | -c "Maximum input fragment length is 1024" \ |
| 3428 | -c "Maximum output fragment length is 1024" \ |
| 3429 | -s "Maximum input fragment length is 1024" \ |
| 3430 | -s "Maximum output fragment length is 512" \ |
| 3431 | -c "client hello, adding max_fragment_length extension" \ |
| 3432 | -s "found max fragment length extension" \ |
| 3433 | -s "server hello, max_fragment_length extension" \ |
| 3434 | -c "found max_fragment_length extension" |
| 3435 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3436 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3437 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3438 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3439 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3440 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3441 | 0 \ |
| 3442 | -c "Maximum input fragment length is 1024" \ |
| 3443 | -c "Maximum output fragment length is 1024" \ |
| 3444 | -s "Maximum input fragment length is 1024" \ |
| 3445 | -s "Maximum output fragment length is 1024" \ |
| 3446 | -c "client hello, adding max_fragment_length extension" \ |
| 3447 | -s "found max fragment length extension" \ |
| 3448 | -s "server hello, max_fragment_length extension" \ |
| 3449 | -c "found max_fragment_length extension" |
| 3450 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3451 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3452 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3453 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3454 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3455 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3456 | 0 \ |
| 3457 | -c "Maximum input fragment length is 1024" \ |
| 3458 | -c "Maximum output fragment length is 1024" \ |
| 3459 | -s "Maximum input fragment length is 1024" \ |
| 3460 | -s "Maximum output fragment length is 1024" \ |
| 3461 | -c "client hello, adding max_fragment_length extension" \ |
| 3462 | -s "found max fragment length extension" \ |
| 3463 | -s "server hello, max_fragment_length extension" \ |
| 3464 | -c "found max_fragment_length extension" |
| 3465 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3466 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3467 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3468 | run_test "Max fragment length: client 2048, server 512" \ |
| 3469 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3470 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3471 | 0 \ |
| 3472 | -c "Maximum input fragment length is 2048" \ |
| 3473 | -c "Maximum output fragment length is 2048" \ |
| 3474 | -s "Maximum input fragment length is 2048" \ |
| 3475 | -s "Maximum output fragment length is 512" \ |
| 3476 | -c "client hello, adding max_fragment_length extension" \ |
| 3477 | -s "found max fragment length extension" \ |
| 3478 | -s "server hello, max_fragment_length extension" \ |
| 3479 | -c "found max_fragment_length extension" |
| 3480 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3481 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3482 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3483 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3484 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3485 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3486 | 0 \ |
| 3487 | -c "Maximum input fragment length is 2048" \ |
| 3488 | -c "Maximum output fragment length is 2048" \ |
| 3489 | -s "Maximum input fragment length is 2048" \ |
| 3490 | -s "Maximum output fragment length is 1024" \ |
| 3491 | -c "client hello, adding max_fragment_length extension" \ |
| 3492 | -s "found max fragment length extension" \ |
| 3493 | -s "server hello, max_fragment_length extension" \ |
| 3494 | -c "found max_fragment_length extension" |
| 3495 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3496 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3497 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3498 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3499 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3500 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3501 | 0 \ |
| 3502 | -c "Maximum input fragment length is 2048" \ |
| 3503 | -c "Maximum output fragment length is 2048" \ |
| 3504 | -s "Maximum input fragment length is 2048" \ |
| 3505 | -s "Maximum output fragment length is 2048" \ |
| 3506 | -c "client hello, adding max_fragment_length extension" \ |
| 3507 | -s "found max fragment length extension" \ |
| 3508 | -s "server hello, max_fragment_length extension" \ |
| 3509 | -c "found max_fragment_length extension" |
| 3510 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3511 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3512 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3513 | run_test "Max fragment length: client 4096, server 512" \ |
| 3514 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3515 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3516 | 0 \ |
| 3517 | -c "Maximum input fragment length is 4096" \ |
| 3518 | -c "Maximum output fragment length is 4096" \ |
| 3519 | -s "Maximum input fragment length is 4096" \ |
| 3520 | -s "Maximum output fragment length is 512" \ |
| 3521 | -c "client hello, adding max_fragment_length extension" \ |
| 3522 | -s "found max fragment length extension" \ |
| 3523 | -s "server hello, max_fragment_length extension" \ |
| 3524 | -c "found max_fragment_length extension" |
| 3525 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3526 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3527 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3528 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3529 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3530 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3531 | 0 \ |
| 3532 | -c "Maximum input fragment length is 4096" \ |
| 3533 | -c "Maximum output fragment length is 4096" \ |
| 3534 | -s "Maximum input fragment length is 4096" \ |
| 3535 | -s "Maximum output fragment length is 1024" \ |
| 3536 | -c "client hello, adding max_fragment_length extension" \ |
| 3537 | -s "found max fragment length extension" \ |
| 3538 | -s "server hello, max_fragment_length extension" \ |
| 3539 | -c "found max_fragment_length extension" |
| 3540 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3541 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3542 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3543 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3544 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3545 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3546 | 0 \ |
| 3547 | -c "Maximum input fragment length is 4096" \ |
| 3548 | -c "Maximum output fragment length is 4096" \ |
| 3549 | -s "Maximum input fragment length is 4096" \ |
| 3550 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3551 | -c "client hello, adding max_fragment_length extension" \ |
| 3552 | -s "found max fragment length extension" \ |
| 3553 | -s "server hello, max_fragment_length extension" \ |
| 3554 | -c "found max_fragment_length extension" |
| 3555 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3556 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3557 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3558 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3559 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3560 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3561 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3562 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3563 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3564 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3565 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3566 | -C "client hello, adding max_fragment_length extension" \ |
| 3567 | -S "found max fragment length extension" \ |
| 3568 | -S "server hello, max_fragment_length extension" \ |
| 3569 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3570 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3571 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3572 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3573 | requires_gnutls |
| 3574 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3575 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3576 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3577 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3578 | -c "Maximum input fragment length is 4096" \ |
| 3579 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3580 | -c "client hello, adding max_fragment_length extension" \ |
| 3581 | -c "found max_fragment_length extension" |
| 3582 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3583 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3584 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3585 | run_test "Max fragment length: client, message just fits" \ |
| 3586 | "$P_SRV debug_level=3" \ |
| 3587 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3588 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3589 | -c "Maximum input fragment length is 2048" \ |
| 3590 | -c "Maximum output fragment length is 2048" \ |
| 3591 | -s "Maximum input fragment length is 2048" \ |
| 3592 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3593 | -c "client hello, adding max_fragment_length extension" \ |
| 3594 | -s "found max fragment length extension" \ |
| 3595 | -s "server hello, max_fragment_length extension" \ |
| 3596 | -c "found max_fragment_length extension" \ |
| 3597 | -c "2048 bytes written in 1 fragments" \ |
| 3598 | -s "2048 bytes read" |
| 3599 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3600 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3601 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3602 | run_test "Max fragment length: client, larger message" \ |
| 3603 | "$P_SRV debug_level=3" \ |
| 3604 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3605 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3606 | -c "Maximum input fragment length is 2048" \ |
| 3607 | -c "Maximum output fragment length is 2048" \ |
| 3608 | -s "Maximum input fragment length is 2048" \ |
| 3609 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3610 | -c "client hello, adding max_fragment_length extension" \ |
| 3611 | -s "found max fragment length extension" \ |
| 3612 | -s "server hello, max_fragment_length extension" \ |
| 3613 | -c "found max_fragment_length extension" \ |
| 3614 | -c "2345 bytes written in 2 fragments" \ |
| 3615 | -s "2048 bytes read" \ |
| 3616 | -s "297 bytes read" |
| 3617 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3618 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3619 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3620 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3621 | "$P_SRV debug_level=3 dtls=1" \ |
| 3622 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3623 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3624 | -c "Maximum input fragment length is 2048" \ |
| 3625 | -c "Maximum output fragment length is 2048" \ |
| 3626 | -s "Maximum input fragment length is 2048" \ |
| 3627 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3628 | -c "client hello, adding max_fragment_length extension" \ |
| 3629 | -s "found max fragment length extension" \ |
| 3630 | -s "server hello, max_fragment_length extension" \ |
| 3631 | -c "found max_fragment_length extension" \ |
| 3632 | -c "fragment larger than.*maximum" |
| 3633 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3634 | # Tests for renegotiation |
| 3635 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3636 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3637 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3638 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3639 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3640 | 0 \ |
| 3641 | -C "client hello, adding renegotiation extension" \ |
| 3642 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3643 | -S "found renegotiation extension" \ |
| 3644 | -s "server hello, secure renegotiation extension" \ |
| 3645 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3646 | -C "=> renegotiate" \ |
| 3647 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3648 | -S "write hello request" |
| 3649 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3650 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3651 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3652 | "$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] | 3653 | "$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] | 3654 | 0 \ |
| 3655 | -c "client hello, adding renegotiation extension" \ |
| 3656 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3657 | -s "found renegotiation extension" \ |
| 3658 | -s "server hello, secure renegotiation extension" \ |
| 3659 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3660 | -c "=> renegotiate" \ |
| 3661 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3662 | -S "write hello request" |
| 3663 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3664 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3665 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3666 | "$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] | 3667 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3668 | 0 \ |
| 3669 | -c "client hello, adding renegotiation extension" \ |
| 3670 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3671 | -s "found renegotiation extension" \ |
| 3672 | -s "server hello, secure renegotiation extension" \ |
| 3673 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3674 | -c "=> renegotiate" \ |
| 3675 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3676 | -s "write hello request" |
| 3677 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3678 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3679 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3680 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3681 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3682 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3683 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3684 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3685 | 0 \ |
| 3686 | -c "client hello, adding renegotiation extension" \ |
| 3687 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3688 | -s "found renegotiation extension" \ |
| 3689 | -s "server hello, secure renegotiation extension" \ |
| 3690 | -c "found renegotiation extension" \ |
| 3691 | -c "=> renegotiate" \ |
| 3692 | -s "=> renegotiate" \ |
| 3693 | -S "write hello request" \ |
| 3694 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3695 | |
| 3696 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3697 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3698 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3699 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3700 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3701 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3702 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3703 | 0 \ |
| 3704 | -c "client hello, adding renegotiation extension" \ |
| 3705 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3706 | -s "found renegotiation extension" \ |
| 3707 | -s "server hello, secure renegotiation extension" \ |
| 3708 | -c "found renegotiation extension" \ |
| 3709 | -c "=> renegotiate" \ |
| 3710 | -s "=> renegotiate" \ |
| 3711 | -s "write hello request" \ |
| 3712 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3713 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3714 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3715 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3716 | "$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] | 3717 | "$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] | 3718 | 0 \ |
| 3719 | -c "client hello, adding renegotiation extension" \ |
| 3720 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3721 | -s "found renegotiation extension" \ |
| 3722 | -s "server hello, secure renegotiation extension" \ |
| 3723 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3724 | -c "=> renegotiate" \ |
| 3725 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3726 | -s "write hello request" |
| 3727 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3728 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3729 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3730 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3731 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3732 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3733 | "$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" \ |
| 3734 | 0 \ |
| 3735 | -c "Maximum input fragment length is 2048" \ |
| 3736 | -c "Maximum output fragment length is 2048" \ |
| 3737 | -s "Maximum input fragment length is 2048" \ |
| 3738 | -s "Maximum output fragment length is 512" \ |
| 3739 | -c "client hello, adding max_fragment_length extension" \ |
| 3740 | -s "found max fragment length extension" \ |
| 3741 | -s "server hello, max_fragment_length extension" \ |
| 3742 | -c "found max_fragment_length extension" \ |
| 3743 | -c "client hello, adding renegotiation extension" \ |
| 3744 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3745 | -s "found renegotiation extension" \ |
| 3746 | -s "server hello, secure renegotiation extension" \ |
| 3747 | -c "found renegotiation extension" \ |
| 3748 | -c "=> renegotiate" \ |
| 3749 | -s "=> renegotiate" \ |
| 3750 | -s "write hello request" |
| 3751 | |
| 3752 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3753 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3754 | "$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] | 3755 | "$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] | 3756 | 1 \ |
| 3757 | -c "client hello, adding renegotiation extension" \ |
| 3758 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3759 | -S "found renegotiation extension" \ |
| 3760 | -s "server hello, secure renegotiation extension" \ |
| 3761 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3762 | -c "=> renegotiate" \ |
| 3763 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3764 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3765 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3766 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3767 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3768 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3769 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3770 | "$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] | 3771 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3772 | 0 \ |
| 3773 | -C "client hello, adding renegotiation extension" \ |
| 3774 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3775 | -S "found renegotiation extension" \ |
| 3776 | -s "server hello, secure renegotiation extension" \ |
| 3777 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3778 | -C "=> renegotiate" \ |
| 3779 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3780 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3781 | -S "SSL - An unexpected message was received from our peer" \ |
| 3782 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3783 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3784 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3785 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3786 | "$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] | 3787 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3788 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3789 | 0 \ |
| 3790 | -C "client hello, adding renegotiation extension" \ |
| 3791 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3792 | -S "found renegotiation extension" \ |
| 3793 | -s "server hello, secure renegotiation extension" \ |
| 3794 | -c "found renegotiation extension" \ |
| 3795 | -C "=> renegotiate" \ |
| 3796 | -S "=> renegotiate" \ |
| 3797 | -s "write hello request" \ |
| 3798 | -S "SSL - An unexpected message was received from our peer" \ |
| 3799 | -S "failed" |
| 3800 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3801 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3802 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3803 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3804 | "$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] | 3805 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3806 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3807 | 0 \ |
| 3808 | -C "client hello, adding renegotiation extension" \ |
| 3809 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3810 | -S "found renegotiation extension" \ |
| 3811 | -s "server hello, secure renegotiation extension" \ |
| 3812 | -c "found renegotiation extension" \ |
| 3813 | -C "=> renegotiate" \ |
| 3814 | -S "=> renegotiate" \ |
| 3815 | -s "write hello request" \ |
| 3816 | -S "SSL - An unexpected message was received from our peer" \ |
| 3817 | -S "failed" |
| 3818 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3819 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3820 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3821 | "$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] | 3822 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3823 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3824 | 0 \ |
| 3825 | -C "client hello, adding renegotiation extension" \ |
| 3826 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3827 | -S "found renegotiation extension" \ |
| 3828 | -s "server hello, secure renegotiation extension" \ |
| 3829 | -c "found renegotiation extension" \ |
| 3830 | -C "=> renegotiate" \ |
| 3831 | -S "=> renegotiate" \ |
| 3832 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3833 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3834 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3835 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3836 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3837 | "$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] | 3838 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3839 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3840 | 0 \ |
| 3841 | -c "client hello, adding renegotiation extension" \ |
| 3842 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3843 | -s "found renegotiation extension" \ |
| 3844 | -s "server hello, secure renegotiation extension" \ |
| 3845 | -c "found renegotiation extension" \ |
| 3846 | -c "=> renegotiate" \ |
| 3847 | -s "=> renegotiate" \ |
| 3848 | -s "write hello request" \ |
| 3849 | -S "SSL - An unexpected message was received from our peer" \ |
| 3850 | -S "failed" |
| 3851 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3852 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3853 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3854 | "$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] | 3855 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3856 | 0 \ |
| 3857 | -C "client hello, adding renegotiation extension" \ |
| 3858 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3859 | -S "found renegotiation extension" \ |
| 3860 | -s "server hello, secure renegotiation extension" \ |
| 3861 | -c "found renegotiation extension" \ |
| 3862 | -S "record counter limit reached: renegotiate" \ |
| 3863 | -C "=> renegotiate" \ |
| 3864 | -S "=> renegotiate" \ |
| 3865 | -S "write hello request" \ |
| 3866 | -S "SSL - An unexpected message was received from our peer" \ |
| 3867 | -S "failed" |
| 3868 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3869 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3870 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3871 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3872 | "$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] | 3873 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3874 | 0 \ |
| 3875 | -c "client hello, adding renegotiation extension" \ |
| 3876 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3877 | -s "found renegotiation extension" \ |
| 3878 | -s "server hello, secure renegotiation extension" \ |
| 3879 | -c "found renegotiation extension" \ |
| 3880 | -s "record counter limit reached: renegotiate" \ |
| 3881 | -c "=> renegotiate" \ |
| 3882 | -s "=> renegotiate" \ |
| 3883 | -s "write hello request" \ |
| 3884 | -S "SSL - An unexpected message was received from our peer" \ |
| 3885 | -S "failed" |
| 3886 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3887 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3888 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3889 | "$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] | 3890 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3891 | 0 \ |
| 3892 | -c "client hello, adding renegotiation extension" \ |
| 3893 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3894 | -s "found renegotiation extension" \ |
| 3895 | -s "server hello, secure renegotiation extension" \ |
| 3896 | -c "found renegotiation extension" \ |
| 3897 | -s "record counter limit reached: renegotiate" \ |
| 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 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3904 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3905 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3906 | "$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] | 3907 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3908 | 0 \ |
| 3909 | -C "client hello, adding renegotiation extension" \ |
| 3910 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3911 | -S "found renegotiation extension" \ |
| 3912 | -s "server hello, secure renegotiation extension" \ |
| 3913 | -c "found renegotiation extension" \ |
| 3914 | -S "record counter limit reached: renegotiate" \ |
| 3915 | -C "=> renegotiate" \ |
| 3916 | -S "=> renegotiate" \ |
| 3917 | -S "write hello request" \ |
| 3918 | -S "SSL - An unexpected message was received from our peer" \ |
| 3919 | -S "failed" |
| 3920 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3921 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3922 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3923 | "$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] | 3924 | "$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] | 3925 | 0 \ |
| 3926 | -c "client hello, adding renegotiation extension" \ |
| 3927 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3928 | -s "found renegotiation extension" \ |
| 3929 | -s "server hello, secure renegotiation extension" \ |
| 3930 | -c "found renegotiation extension" \ |
| 3931 | -c "=> renegotiate" \ |
| 3932 | -s "=> renegotiate" \ |
| 3933 | -S "write hello request" |
| 3934 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3935 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3936 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3937 | "$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] | 3938 | "$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] | 3939 | 0 \ |
| 3940 | -c "client hello, adding renegotiation extension" \ |
| 3941 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3942 | -s "found renegotiation extension" \ |
| 3943 | -s "server hello, secure renegotiation extension" \ |
| 3944 | -c "found renegotiation extension" \ |
| 3945 | -c "=> renegotiate" \ |
| 3946 | -s "=> renegotiate" \ |
| 3947 | -s "write hello request" |
| 3948 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3949 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3950 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3951 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3952 | "$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] | 3953 | 0 \ |
| 3954 | -c "client hello, adding renegotiation extension" \ |
| 3955 | -c "found renegotiation extension" \ |
| 3956 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3957 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3958 | -C "error" \ |
| 3959 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3960 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3961 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3962 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3963 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3964 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3965 | "$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] | 3966 | 0 \ |
| 3967 | -c "client hello, adding renegotiation extension" \ |
| 3968 | -c "found renegotiation extension" \ |
| 3969 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3970 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3971 | -C "error" \ |
| 3972 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3973 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3974 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3975 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3976 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3977 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3978 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3979 | 1 \ |
| 3980 | -c "client hello, adding renegotiation extension" \ |
| 3981 | -C "found renegotiation extension" \ |
| 3982 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3983 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3984 | -c "error" \ |
| 3985 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3986 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3987 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3988 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3989 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3990 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3991 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3992 | allow_legacy=0" \ |
| 3993 | 1 \ |
| 3994 | -c "client hello, adding renegotiation extension" \ |
| 3995 | -C "found renegotiation extension" \ |
| 3996 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3997 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3998 | -c "error" \ |
| 3999 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4000 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4001 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4002 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4003 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 4004 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4005 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4006 | allow_legacy=1" \ |
| 4007 | 0 \ |
| 4008 | -c "client hello, adding renegotiation extension" \ |
| 4009 | -C "found renegotiation extension" \ |
| 4010 | -c "=> renegotiate" \ |
| 4011 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4012 | -C "error" \ |
| 4013 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4014 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4015 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4016 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4017 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4018 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4019 | 0 \ |
| 4020 | -c "client hello, adding renegotiation extension" \ |
| 4021 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4022 | -s "found renegotiation extension" \ |
| 4023 | -s "server hello, secure renegotiation extension" \ |
| 4024 | -c "found renegotiation extension" \ |
| 4025 | -c "=> renegotiate" \ |
| 4026 | -s "=> renegotiate" \ |
| 4027 | -S "write hello request" |
| 4028 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4029 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4030 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4031 | "$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] | 4032 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4033 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4034 | 0 \ |
| 4035 | -c "client hello, adding renegotiation extension" \ |
| 4036 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4037 | -s "found renegotiation extension" \ |
| 4038 | -s "server hello, secure renegotiation extension" \ |
| 4039 | -c "found renegotiation extension" \ |
| 4040 | -c "=> renegotiate" \ |
| 4041 | -s "=> renegotiate" \ |
| 4042 | -s "write hello request" |
| 4043 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4044 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4045 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4046 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4047 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4048 | 0 \ |
| 4049 | -c "client hello, adding renegotiation extension" \ |
| 4050 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4051 | -s "found renegotiation extension" \ |
| 4052 | -s "server hello, secure renegotiation extension" \ |
| 4053 | -s "record counter limit reached: renegotiate" \ |
| 4054 | -c "=> renegotiate" \ |
| 4055 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4056 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4057 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4058 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4059 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4060 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4061 | "$G_SRV -u --mtu 4096" \ |
| 4062 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4063 | 0 \ |
| 4064 | -c "client hello, adding renegotiation extension" \ |
| 4065 | -c "found renegotiation extension" \ |
| 4066 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4067 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4068 | -C "error" \ |
| 4069 | -s "Extra-header:" |
| 4070 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4071 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 4072 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4073 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4074 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4075 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4076 | "$P_CLI debug_level=3" \ |
| 4077 | 0 \ |
| 4078 | -c "found renegotiation extension" \ |
| 4079 | -C "error" \ |
| 4080 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4081 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4082 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4083 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4084 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4085 | "$P_CLI debug_level=3" \ |
| 4086 | 0 \ |
| 4087 | -C "found renegotiation extension" \ |
| 4088 | -C "error" \ |
| 4089 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4090 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4091 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4092 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 4093 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4094 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4095 | 1 \ |
| 4096 | -C "found renegotiation extension" \ |
| 4097 | -c "error" \ |
| 4098 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4099 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4100 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4101 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4102 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4103 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4104 | 0 \ |
| 4105 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4106 | -s "server hello, secure renegotiation extension" |
| 4107 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4108 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4109 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4110 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4111 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4112 | 0 \ |
| 4113 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4114 | -S "server hello, secure renegotiation extension" |
| 4115 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4116 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4117 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4118 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4119 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4120 | 1 \ |
| 4121 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4122 | -S "server hello, secure renegotiation extension" |
| 4123 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4124 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4125 | |
| 4126 | requires_gnutls |
| 4127 | run_test "DER format: no trailing bytes" \ |
| 4128 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4129 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4130 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4131 | 0 \ |
| 4132 | -c "Handshake was completed" \ |
| 4133 | |
| 4134 | requires_gnutls |
| 4135 | run_test "DER format: with a trailing zero byte" \ |
| 4136 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4137 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4138 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4139 | 0 \ |
| 4140 | -c "Handshake was completed" \ |
| 4141 | |
| 4142 | requires_gnutls |
| 4143 | run_test "DER format: with a trailing random byte" \ |
| 4144 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4145 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4146 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4147 | 0 \ |
| 4148 | -c "Handshake was completed" \ |
| 4149 | |
| 4150 | requires_gnutls |
| 4151 | run_test "DER format: with 2 trailing random bytes" \ |
| 4152 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4153 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4154 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4155 | 0 \ |
| 4156 | -c "Handshake was completed" \ |
| 4157 | |
| 4158 | requires_gnutls |
| 4159 | run_test "DER format: with 4 trailing random bytes" \ |
| 4160 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4161 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4162 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4163 | 0 \ |
| 4164 | -c "Handshake was completed" \ |
| 4165 | |
| 4166 | requires_gnutls |
| 4167 | run_test "DER format: with 8 trailing random bytes" \ |
| 4168 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4169 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4170 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4171 | 0 \ |
| 4172 | -c "Handshake was completed" \ |
| 4173 | |
| 4174 | requires_gnutls |
| 4175 | run_test "DER format: with 9 trailing random bytes" \ |
| 4176 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4177 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4178 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4179 | 0 \ |
| 4180 | -c "Handshake was completed" \ |
| 4181 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4182 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4183 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4184 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4185 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4186 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4187 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4188 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4189 | 1 \ |
| 4190 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4191 | -c "! The certificate is not correctly signed by the trusted CA" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4192 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4193 | -c "X509 - Certificate verification failed" |
| 4194 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4195 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4196 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4197 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4198 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4199 | 0 \ |
| 4200 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4201 | -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] | 4202 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4203 | -C "X509 - Certificate verification failed" |
| 4204 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4205 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4206 | "$P_SRV" \ |
| 4207 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4208 | 0 \ |
| 4209 | -c "x509_verify_cert() returned" \ |
| 4210 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4211 | -c "! Certificate verification flags"\ |
| 4212 | -C "! mbedtls_ssl_handshake returned" \ |
| 4213 | -C "X509 - Certificate verification failed" \ |
| 4214 | -C "SSL - No CA Chain is set, but required to operate" |
| 4215 | |
| 4216 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4217 | "$P_SRV" \ |
| 4218 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4219 | 1 \ |
| 4220 | -c "x509_verify_cert() returned" \ |
| 4221 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4222 | -c "! Certificate verification flags"\ |
| 4223 | -c "! mbedtls_ssl_handshake returned" \ |
| 4224 | -c "SSL - No CA Chain is set, but required to operate" |
| 4225 | |
| 4226 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4227 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4228 | # the client informs the server about the supported curves - it does, though, in the |
| 4229 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4230 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4231 | # different means to have the server ignoring the client's supported curve list. |
| 4232 | |
| 4233 | requires_config_enabled MBEDTLS_ECP_C |
| 4234 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4235 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4236 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4237 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4238 | 1 \ |
| 4239 | -c "bad certificate (EC key curve)"\ |
| 4240 | -c "! Certificate verification flags"\ |
| 4241 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4242 | |
| 4243 | requires_config_enabled MBEDTLS_ECP_C |
| 4244 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4245 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4246 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4247 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4248 | 1 \ |
| 4249 | -c "bad certificate (EC key curve)"\ |
| 4250 | -c "! Certificate verification flags"\ |
| 4251 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4252 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4253 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4254 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4255 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4256 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4257 | 0 \ |
| 4258 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4259 | -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] | 4260 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4261 | -C "X509 - Certificate verification failed" |
| 4262 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4263 | run_test "Authentication: client SHA256, server required" \ |
| 4264 | "$P_SRV auth_mode=required" \ |
| 4265 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4266 | key_file=data_files/server6.key \ |
| 4267 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4268 | 0 \ |
| 4269 | -c "Supported Signature Algorithm found: 4," \ |
| 4270 | -c "Supported Signature Algorithm found: 5," |
| 4271 | |
| 4272 | run_test "Authentication: client SHA384, server required" \ |
| 4273 | "$P_SRV auth_mode=required" \ |
| 4274 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4275 | key_file=data_files/server6.key \ |
| 4276 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4277 | 0 \ |
| 4278 | -c "Supported Signature Algorithm found: 4," \ |
| 4279 | -c "Supported Signature Algorithm found: 5," |
| 4280 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4281 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4282 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 4283 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 4284 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 4285 | key_file=data_files/server5.key" \ |
| 4286 | 1 \ |
| 4287 | -S "skip write certificate request" \ |
| 4288 | -C "skip parse certificate request" \ |
| 4289 | -c "got a certificate request" \ |
| 4290 | -c "got no certificate to send" \ |
| 4291 | -S "x509_verify_cert() returned" \ |
| 4292 | -s "client has no certificate" \ |
| 4293 | -s "! mbedtls_ssl_handshake returned" \ |
| 4294 | -c "! mbedtls_ssl_handshake returned" \ |
| 4295 | -s "No client certification received from the client, but required by the authentication mode" |
| 4296 | |
| 4297 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4298 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4299 | "$P_CLI debug_level=3 crt_file=none \ |
| 4300 | key_file=data_files/server5.key" \ |
| 4301 | 1 \ |
| 4302 | -S "skip write certificate request" \ |
| 4303 | -C "skip parse certificate request" \ |
| 4304 | -c "got a certificate request" \ |
| 4305 | -c "= write certificate$" \ |
| 4306 | -C "skip write certificate$" \ |
| 4307 | -S "x509_verify_cert() returned" \ |
| 4308 | -s "client has no certificate" \ |
| 4309 | -s "! mbedtls_ssl_handshake returned" \ |
| 4310 | -c "! mbedtls_ssl_handshake returned" \ |
| 4311 | -s "No client certification received from the client, but required by the authentication mode" |
| 4312 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4313 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4314 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4315 | "$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] | 4316 | key_file=data_files/server5.key" \ |
| 4317 | 1 \ |
| 4318 | -S "skip write certificate request" \ |
| 4319 | -C "skip parse certificate request" \ |
| 4320 | -c "got a certificate request" \ |
| 4321 | -C "skip write certificate" \ |
| 4322 | -C "skip write certificate verify" \ |
| 4323 | -S "skip parse certificate verify" \ |
| 4324 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4325 | -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] | 4326 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4327 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4328 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4329 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4330 | # We don't check that the client receives the alert because it might |
| 4331 | # detect that its write end of the connection is closed and abort |
| 4332 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4333 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4334 | run_test "Authentication: client cert not trusted, server required" \ |
| 4335 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4336 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4337 | key_file=data_files/server5.key" \ |
| 4338 | 1 \ |
| 4339 | -S "skip write certificate request" \ |
| 4340 | -C "skip parse certificate request" \ |
| 4341 | -c "got a certificate request" \ |
| 4342 | -C "skip write certificate" \ |
| 4343 | -C "skip write certificate verify" \ |
| 4344 | -S "skip parse certificate verify" \ |
| 4345 | -s "x509_verify_cert() returned" \ |
| 4346 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4347 | -s "! mbedtls_ssl_handshake returned" \ |
| 4348 | -c "! mbedtls_ssl_handshake returned" \ |
| 4349 | -s "X509 - Certificate verification failed" |
| 4350 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4351 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4352 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4353 | "$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] | 4354 | key_file=data_files/server5.key" \ |
| 4355 | 0 \ |
| 4356 | -S "skip write certificate request" \ |
| 4357 | -C "skip parse certificate request" \ |
| 4358 | -c "got a certificate request" \ |
| 4359 | -C "skip write certificate" \ |
| 4360 | -C "skip write certificate verify" \ |
| 4361 | -S "skip parse certificate verify" \ |
| 4362 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4363 | -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] | 4364 | -S "! mbedtls_ssl_handshake returned" \ |
| 4365 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4366 | -S "X509 - Certificate verification failed" |
| 4367 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4368 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4369 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4370 | "$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] | 4371 | key_file=data_files/server5.key" \ |
| 4372 | 0 \ |
| 4373 | -s "skip write certificate request" \ |
| 4374 | -C "skip parse certificate request" \ |
| 4375 | -c "got no certificate request" \ |
| 4376 | -c "skip write certificate" \ |
| 4377 | -c "skip write certificate verify" \ |
| 4378 | -s "skip parse certificate verify" \ |
| 4379 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4380 | -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] | 4381 | -S "! mbedtls_ssl_handshake returned" \ |
| 4382 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4383 | -S "X509 - Certificate verification failed" |
| 4384 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4385 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4386 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4387 | "$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] | 4388 | 0 \ |
| 4389 | -S "skip write certificate request" \ |
| 4390 | -C "skip parse certificate request" \ |
| 4391 | -c "got a certificate request" \ |
| 4392 | -C "skip write certificate$" \ |
| 4393 | -C "got no certificate to send" \ |
| 4394 | -S "SSLv3 client has no certificate" \ |
| 4395 | -c "skip write certificate verify" \ |
| 4396 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4397 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4398 | -S "! mbedtls_ssl_handshake returned" \ |
| 4399 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4400 | -S "X509 - Certificate verification failed" |
| 4401 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4402 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4403 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4404 | "$O_CLI" \ |
| 4405 | 0 \ |
| 4406 | -S "skip write certificate request" \ |
| 4407 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4408 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4409 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4410 | -S "X509 - Certificate verification failed" |
| 4411 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4412 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4413 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4414 | "$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] | 4415 | 0 \ |
| 4416 | -C "skip parse certificate request" \ |
| 4417 | -c "got a certificate request" \ |
| 4418 | -C "skip write certificate$" \ |
| 4419 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4420 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4421 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4422 | run_test "Authentication: client no cert, openssl server required" \ |
| 4423 | "$O_SRV -Verify 10" \ |
| 4424 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4425 | 1 \ |
| 4426 | -C "skip parse certificate request" \ |
| 4427 | -c "got a certificate request" \ |
| 4428 | -C "skip write certificate$" \ |
| 4429 | -c "skip write certificate verify" \ |
| 4430 | -c "! mbedtls_ssl_handshake returned" |
| 4431 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4432 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4433 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4434 | "$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] | 4435 | "$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] | 4436 | 0 \ |
| 4437 | -S "skip write certificate request" \ |
| 4438 | -C "skip parse certificate request" \ |
| 4439 | -c "got a certificate request" \ |
| 4440 | -C "skip write certificate$" \ |
| 4441 | -c "skip write certificate verify" \ |
| 4442 | -c "got no certificate to send" \ |
| 4443 | -s "SSLv3 client has no certificate" \ |
| 4444 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4445 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4446 | -S "! mbedtls_ssl_handshake returned" \ |
| 4447 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4448 | -S "X509 - Certificate verification failed" |
| 4449 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4450 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4451 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4452 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4453 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4454 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4455 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4456 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4457 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4458 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4459 | # 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] | 4460 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4461 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4462 | run_test "Authentication: server max_int chain, client default" \ |
| 4463 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4464 | key_file=data_files/dir-maxpath/09.key" \ |
| 4465 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4466 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4467 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4468 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4469 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4470 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4471 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4472 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4473 | key_file=data_files/dir-maxpath/10.key" \ |
| 4474 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4475 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4476 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4477 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4478 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4479 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4480 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4481 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4482 | key_file=data_files/dir-maxpath/10.key" \ |
| 4483 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4484 | auth_mode=optional" \ |
| 4485 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4486 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4487 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4488 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4489 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4490 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4491 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4492 | key_file=data_files/dir-maxpath/10.key" \ |
| 4493 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4494 | auth_mode=none" \ |
| 4495 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4496 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4497 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4498 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4499 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4500 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4501 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4502 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4503 | key_file=data_files/dir-maxpath/10.key" \ |
| 4504 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4505 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4506 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4507 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4508 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4509 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4510 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4511 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4512 | key_file=data_files/dir-maxpath/10.key" \ |
| 4513 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4514 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4515 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4516 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4517 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4518 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4519 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4520 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4521 | key_file=data_files/dir-maxpath/10.key" \ |
| 4522 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4523 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4524 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4525 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4526 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4527 | run_test "Authentication: client max_int chain, server required" \ |
| 4528 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4529 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4530 | key_file=data_files/dir-maxpath/09.key" \ |
| 4531 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4532 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4533 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4534 | # Tests for CA list in CertificateRequest messages |
| 4535 | |
| 4536 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4537 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4538 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4539 | key_file=data_files/server6.key" \ |
| 4540 | 0 \ |
| 4541 | -s "requested DN" |
| 4542 | |
| 4543 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4544 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4545 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4546 | key_file=data_files/server6.key" \ |
| 4547 | 0 \ |
| 4548 | -S "requested DN" |
| 4549 | |
| 4550 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4551 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4552 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4553 | key_file=data_files/server5.key" \ |
| 4554 | 1 \ |
| 4555 | -S "requested DN" \ |
| 4556 | -s "x509_verify_cert() returned" \ |
| 4557 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4558 | -s "! mbedtls_ssl_handshake returned" \ |
| 4559 | -c "! mbedtls_ssl_handshake returned" \ |
| 4560 | -s "X509 - Certificate verification failed" |
| 4561 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4562 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4563 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4564 | |
| 4565 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4566 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4567 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4568 | key_file=data_files/server5.key" \ |
| 4569 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4570 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4571 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4572 | -c "x509_verify_cert() returned" \ |
| 4573 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4574 | -c "! mbedtls_ssl_handshake returned" \ |
| 4575 | -c "X509 - Certificate verification failed" |
| 4576 | |
| 4577 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4578 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4579 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4580 | key_file=data_files/server5.key" \ |
| 4581 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4582 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4583 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4584 | -c "x509_verify_cert() returned" \ |
| 4585 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4586 | -C "! mbedtls_ssl_handshake returned" \ |
| 4587 | -C "X509 - Certificate verification failed" |
| 4588 | |
| 4589 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4590 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4591 | # the client informs the server about the supported curves - it does, though, in the |
| 4592 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4593 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4594 | # different means to have the server ignoring the client's supported curve list. |
| 4595 | |
| 4596 | requires_config_enabled MBEDTLS_ECP_C |
| 4597 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4598 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4599 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4600 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4601 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4602 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4603 | -c "use CA callback for X.509 CRT verification" \ |
| 4604 | -c "bad certificate (EC key curve)" \ |
| 4605 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4606 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4607 | |
| 4608 | requires_config_enabled MBEDTLS_ECP_C |
| 4609 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4610 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4611 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4612 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4613 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4614 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4615 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4616 | -c "bad certificate (EC key curve)"\ |
| 4617 | -c "! Certificate verification flags"\ |
| 4618 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4619 | |
| 4620 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4621 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4622 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4623 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4624 | key_file=data_files/server6.key \ |
| 4625 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4626 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4627 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4628 | -c "Supported Signature Algorithm found: 4," \ |
| 4629 | -c "Supported Signature Algorithm found: 5," |
| 4630 | |
| 4631 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4632 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4633 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4634 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4635 | key_file=data_files/server6.key \ |
| 4636 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4637 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4638 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4639 | -c "Supported Signature Algorithm found: 4," \ |
| 4640 | -c "Supported Signature Algorithm found: 5," |
| 4641 | |
| 4642 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4643 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4644 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4645 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4646 | key_file=data_files/server5.key" \ |
| 4647 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4648 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4649 | -S "skip write certificate request" \ |
| 4650 | -C "skip parse certificate request" \ |
| 4651 | -c "got a certificate request" \ |
| 4652 | -C "skip write certificate" \ |
| 4653 | -C "skip write certificate verify" \ |
| 4654 | -S "skip parse certificate verify" \ |
| 4655 | -s "x509_verify_cert() returned" \ |
| 4656 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4657 | -s "! mbedtls_ssl_handshake returned" \ |
| 4658 | -s "send alert level=2 message=48" \ |
| 4659 | -c "! mbedtls_ssl_handshake returned" \ |
| 4660 | -s "X509 - Certificate verification failed" |
| 4661 | # We don't check that the client receives the alert because it might |
| 4662 | # detect that its write end of the connection is closed and abort |
| 4663 | # before reading the alert message. |
| 4664 | |
| 4665 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4666 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4667 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4668 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4669 | key_file=data_files/server5.key" \ |
| 4670 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4671 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4672 | -S "skip write certificate request" \ |
| 4673 | -C "skip parse certificate request" \ |
| 4674 | -c "got a certificate request" \ |
| 4675 | -C "skip write certificate" \ |
| 4676 | -C "skip write certificate verify" \ |
| 4677 | -S "skip parse certificate verify" \ |
| 4678 | -s "x509_verify_cert() returned" \ |
| 4679 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4680 | -s "! mbedtls_ssl_handshake returned" \ |
| 4681 | -c "! mbedtls_ssl_handshake returned" \ |
| 4682 | -s "X509 - Certificate verification failed" |
| 4683 | |
| 4684 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4685 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4686 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4687 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4688 | key_file=data_files/server5.key" \ |
| 4689 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4690 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4691 | -S "skip write certificate request" \ |
| 4692 | -C "skip parse certificate request" \ |
| 4693 | -c "got a certificate request" \ |
| 4694 | -C "skip write certificate" \ |
| 4695 | -C "skip write certificate verify" \ |
| 4696 | -S "skip parse certificate verify" \ |
| 4697 | -s "x509_verify_cert() returned" \ |
| 4698 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4699 | -S "! mbedtls_ssl_handshake returned" \ |
| 4700 | -C "! mbedtls_ssl_handshake returned" \ |
| 4701 | -S "X509 - Certificate verification failed" |
| 4702 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4703 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4704 | requires_full_size_output_buffer |
| 4705 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4706 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4707 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4708 | key_file=data_files/dir-maxpath/09.key" \ |
| 4709 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4710 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4711 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4712 | -C "X509 - A fatal error occurred" |
| 4713 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4714 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4715 | requires_full_size_output_buffer |
| 4716 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4717 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4718 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4719 | key_file=data_files/dir-maxpath/10.key" \ |
| 4720 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4721 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4722 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4723 | -c "X509 - A fatal error occurred" |
| 4724 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4725 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4726 | requires_full_size_output_buffer |
| 4727 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4728 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4729 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4730 | key_file=data_files/dir-maxpath/10.key" \ |
| 4731 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4732 | debug_level=3 auth_mode=optional" \ |
| 4733 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4734 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4735 | -c "X509 - A fatal error occurred" |
| 4736 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4737 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4738 | requires_full_size_output_buffer |
| 4739 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4740 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4741 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4742 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4743 | key_file=data_files/dir-maxpath/10.key" \ |
| 4744 | 1 \ |
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 | -s "X509 - A fatal error occurred" |
| 4747 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4748 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4749 | requires_full_size_output_buffer |
| 4750 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4751 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4752 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4753 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4754 | key_file=data_files/dir-maxpath/10.key" \ |
| 4755 | 1 \ |
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 | -s "X509 - A fatal error occurred" |
| 4758 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4759 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4760 | requires_full_size_output_buffer |
| 4761 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4762 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4763 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4764 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4765 | key_file=data_files/dir-maxpath/09.key" \ |
| 4766 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4767 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4768 | -S "X509 - A fatal error occurred" |
| 4769 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4770 | # Tests for certificate selection based on SHA verson |
| 4771 | |
| 4772 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4773 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4774 | key_file=data_files/server5.key \ |
| 4775 | crt_file2=data_files/server5-sha1.crt \ |
| 4776 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 4777 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4778 | 0 \ |
| 4779 | -c "signed using.*ECDSA with SHA256" \ |
| 4780 | -C "signed using.*ECDSA with SHA1" |
| 4781 | |
| 4782 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4783 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4784 | key_file=data_files/server5.key \ |
| 4785 | crt_file2=data_files/server5-sha1.crt \ |
| 4786 | key_file2=data_files/server5.key" \ |
| 4787 | "$P_CLI force_version=tls1_1" \ |
| 4788 | 0 \ |
| 4789 | -C "signed using.*ECDSA with SHA256" \ |
| 4790 | -c "signed using.*ECDSA with SHA1" |
| 4791 | |
| 4792 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4793 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4794 | key_file=data_files/server5.key \ |
| 4795 | crt_file2=data_files/server5-sha1.crt \ |
| 4796 | key_file2=data_files/server5.key" \ |
| 4797 | "$P_CLI force_version=tls1" \ |
| 4798 | 0 \ |
| 4799 | -C "signed using.*ECDSA with SHA256" \ |
| 4800 | -c "signed using.*ECDSA with SHA1" |
| 4801 | |
| 4802 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4803 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4804 | key_file=data_files/server5.key \ |
| 4805 | crt_file2=data_files/server6.crt \ |
| 4806 | key_file2=data_files/server6.key" \ |
| 4807 | "$P_CLI force_version=tls1_1" \ |
| 4808 | 0 \ |
| 4809 | -c "serial number.*09" \ |
| 4810 | -c "signed using.*ECDSA with SHA256" \ |
| 4811 | -C "signed using.*ECDSA with SHA1" |
| 4812 | |
| 4813 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4814 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4815 | key_file=data_files/server6.key \ |
| 4816 | crt_file2=data_files/server5.crt \ |
| 4817 | key_file2=data_files/server5.key" \ |
| 4818 | "$P_CLI force_version=tls1_1" \ |
| 4819 | 0 \ |
| 4820 | -c "serial number.*0A" \ |
| 4821 | -c "signed using.*ECDSA with SHA256" \ |
| 4822 | -C "signed using.*ECDSA with SHA1" |
| 4823 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4824 | # tests for SNI |
| 4825 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4826 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4827 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4828 | 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] | 4829 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4830 | 0 \ |
| 4831 | -S "parse ServerName extension" \ |
| 4832 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4833 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4834 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4835 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4836 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4837 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 4838 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4839 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4840 | 0 \ |
| 4841 | -s "parse ServerName extension" \ |
| 4842 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4843 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4844 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4845 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4846 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4847 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 4848 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4849 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4850 | 0 \ |
| 4851 | -s "parse ServerName extension" \ |
| 4852 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4853 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4854 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4855 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4856 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4857 | 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] | 4858 | 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] | 4859 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4860 | 1 \ |
| 4861 | -s "parse ServerName extension" \ |
| 4862 | -s "ssl_sni_wrapper() returned" \ |
| 4863 | -s "mbedtls_ssl_handshake returned" \ |
| 4864 | -c "mbedtls_ssl_handshake returned" \ |
| 4865 | -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] | 4866 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4867 | run_test "SNI: client auth no override: optional" \ |
| 4868 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4869 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4870 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4871 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4872 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4873 | -S "skip write certificate request" \ |
| 4874 | -C "skip parse certificate request" \ |
| 4875 | -c "got a certificate request" \ |
| 4876 | -C "skip write certificate" \ |
| 4877 | -C "skip write certificate verify" \ |
| 4878 | -S "skip parse certificate verify" |
| 4879 | |
| 4880 | run_test "SNI: client auth override: none -> optional" \ |
| 4881 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4882 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4883 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4884 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4885 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4886 | -S "skip write certificate request" \ |
| 4887 | -C "skip parse certificate request" \ |
| 4888 | -c "got a certificate request" \ |
| 4889 | -C "skip write certificate" \ |
| 4890 | -C "skip write certificate verify" \ |
| 4891 | -S "skip parse certificate verify" |
| 4892 | |
| 4893 | run_test "SNI: client auth override: optional -> none" \ |
| 4894 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4895 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4896 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4897 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4898 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4899 | -s "skip write certificate request" \ |
| 4900 | -C "skip parse certificate request" \ |
| 4901 | -c "got no certificate request" \ |
| 4902 | -c "skip write certificate" \ |
| 4903 | -c "skip write certificate verify" \ |
| 4904 | -s "skip parse certificate verify" |
| 4905 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4906 | run_test "SNI: CA no override" \ |
| 4907 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4908 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4909 | ca_file=data_files/test-ca.crt \ |
| 4910 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4911 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4912 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4913 | 1 \ |
| 4914 | -S "skip write certificate request" \ |
| 4915 | -C "skip parse certificate request" \ |
| 4916 | -c "got a certificate request" \ |
| 4917 | -C "skip write certificate" \ |
| 4918 | -C "skip write certificate verify" \ |
| 4919 | -S "skip parse certificate verify" \ |
| 4920 | -s "x509_verify_cert() returned" \ |
| 4921 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4922 | -S "The certificate has been revoked (is on a CRL)" |
| 4923 | |
| 4924 | run_test "SNI: CA override" \ |
| 4925 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4926 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4927 | ca_file=data_files/test-ca.crt \ |
| 4928 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4929 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4930 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4931 | 0 \ |
| 4932 | -S "skip write certificate request" \ |
| 4933 | -C "skip parse certificate request" \ |
| 4934 | -c "got a certificate request" \ |
| 4935 | -C "skip write certificate" \ |
| 4936 | -C "skip write certificate verify" \ |
| 4937 | -S "skip parse certificate verify" \ |
| 4938 | -S "x509_verify_cert() returned" \ |
| 4939 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4940 | -S "The certificate has been revoked (is on a CRL)" |
| 4941 | |
| 4942 | run_test "SNI: CA override with CRL" \ |
| 4943 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4944 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4945 | ca_file=data_files/test-ca.crt \ |
| 4946 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4947 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4948 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4949 | 1 \ |
| 4950 | -S "skip write certificate request" \ |
| 4951 | -C "skip parse certificate request" \ |
| 4952 | -c "got a certificate request" \ |
| 4953 | -C "skip write certificate" \ |
| 4954 | -C "skip write certificate verify" \ |
| 4955 | -S "skip parse certificate verify" \ |
| 4956 | -s "x509_verify_cert() returned" \ |
| 4957 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4958 | -s "The certificate has been revoked (is on a CRL)" |
| 4959 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4960 | # Tests for SNI and DTLS |
| 4961 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4962 | run_test "SNI: DTLS, no SNI callback" \ |
| 4963 | "$P_SRV debug_level=3 dtls=1 \ |
| 4964 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4965 | "$P_CLI server_name=localhost dtls=1" \ |
| 4966 | 0 \ |
| 4967 | -S "parse ServerName extension" \ |
| 4968 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4969 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4970 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4971 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4972 | "$P_SRV debug_level=3 dtls=1 \ |
| 4973 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4974 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4975 | "$P_CLI server_name=localhost dtls=1" \ |
| 4976 | 0 \ |
| 4977 | -s "parse ServerName extension" \ |
| 4978 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4979 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4980 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4981 | run_test "SNI: DTLS, matching cert 2" \ |
| 4982 | "$P_SRV debug_level=3 dtls=1 \ |
| 4983 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4984 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4985 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4986 | 0 \ |
| 4987 | -s "parse ServerName extension" \ |
| 4988 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4989 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4990 | |
| 4991 | run_test "SNI: DTLS, no matching cert" \ |
| 4992 | "$P_SRV debug_level=3 dtls=1 \ |
| 4993 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4994 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4995 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4996 | 1 \ |
| 4997 | -s "parse ServerName extension" \ |
| 4998 | -s "ssl_sni_wrapper() returned" \ |
| 4999 | -s "mbedtls_ssl_handshake returned" \ |
| 5000 | -c "mbedtls_ssl_handshake returned" \ |
| 5001 | -c "SSL - A fatal alert message was received from our peer" |
| 5002 | |
| 5003 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5004 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5005 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5006 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5007 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5008 | 0 \ |
| 5009 | -S "skip write certificate request" \ |
| 5010 | -C "skip parse certificate request" \ |
| 5011 | -c "got a certificate request" \ |
| 5012 | -C "skip write certificate" \ |
| 5013 | -C "skip write certificate verify" \ |
| 5014 | -S "skip parse certificate verify" |
| 5015 | |
| 5016 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5017 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5018 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5019 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5020 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5021 | 0 \ |
| 5022 | -S "skip write certificate request" \ |
| 5023 | -C "skip parse certificate request" \ |
| 5024 | -c "got a certificate request" \ |
| 5025 | -C "skip write certificate" \ |
| 5026 | -C "skip write certificate verify" \ |
| 5027 | -S "skip parse certificate verify" |
| 5028 | |
| 5029 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5030 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5031 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5032 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5033 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5034 | 0 \ |
| 5035 | -s "skip write certificate request" \ |
| 5036 | -C "skip parse certificate request" \ |
| 5037 | -c "got no certificate request" \ |
| 5038 | -c "skip write certificate" \ |
| 5039 | -c "skip write certificate verify" \ |
| 5040 | -s "skip parse certificate verify" |
| 5041 | |
| 5042 | run_test "SNI: DTLS, CA no override" \ |
| 5043 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 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,-,-,required" \ |
| 5047 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5048 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5049 | 1 \ |
| 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 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5060 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5061 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 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,-,required" \ |
| 5065 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5066 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5067 | 0 \ |
| 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 Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5078 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5079 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5080 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5081 | ca_file=data_files/test-ca.crt \ |
| 5082 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5083 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5084 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5085 | 1 \ |
| 5086 | -S "skip write certificate request" \ |
| 5087 | -C "skip parse certificate request" \ |
| 5088 | -c "got a certificate request" \ |
| 5089 | -C "skip write certificate" \ |
| 5090 | -C "skip write certificate verify" \ |
| 5091 | -S "skip parse certificate verify" \ |
| 5092 | -s "x509_verify_cert() returned" \ |
| 5093 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5094 | -s "The certificate has been revoked (is on a CRL)" |
| 5095 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5096 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5097 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5098 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5099 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5100 | "$P_CLI nbio=2 tickets=0" \ |
| 5101 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5102 | -S "mbedtls_ssl_handshake returned" \ |
| 5103 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5104 | -c "Read from server: .* bytes read" |
| 5105 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5106 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5107 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5108 | "$P_CLI nbio=2 tickets=0" \ |
| 5109 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5110 | -S "mbedtls_ssl_handshake returned" \ |
| 5111 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5112 | -c "Read from server: .* bytes read" |
| 5113 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5114 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5115 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5116 | "$P_CLI nbio=2 tickets=1" \ |
| 5117 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5118 | -S "mbedtls_ssl_handshake returned" \ |
| 5119 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5120 | -c "Read from server: .* bytes read" |
| 5121 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5122 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5123 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5124 | "$P_CLI nbio=2 tickets=1" \ |
| 5125 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5126 | -S "mbedtls_ssl_handshake returned" \ |
| 5127 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5128 | -c "Read from server: .* bytes read" |
| 5129 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5130 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5131 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5132 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5133 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5134 | -S "mbedtls_ssl_handshake returned" \ |
| 5135 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5136 | -c "Read from server: .* bytes read" |
| 5137 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5138 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5139 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5140 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5141 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5142 | -S "mbedtls_ssl_handshake returned" \ |
| 5143 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5144 | -c "Read from server: .* bytes read" |
| 5145 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5146 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5147 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5148 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5149 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5150 | -S "mbedtls_ssl_handshake returned" \ |
| 5151 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5152 | -c "Read from server: .* bytes read" |
| 5153 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5154 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5155 | |
| 5156 | run_test "Event-driven I/O: basic handshake" \ |
| 5157 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5158 | "$P_CLI event=1 tickets=0" \ |
| 5159 | 0 \ |
| 5160 | -S "mbedtls_ssl_handshake returned" \ |
| 5161 | -C "mbedtls_ssl_handshake returned" \ |
| 5162 | -c "Read from server: .* bytes read" |
| 5163 | |
| 5164 | run_test "Event-driven I/O: client auth" \ |
| 5165 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5166 | "$P_CLI event=1 tickets=0" \ |
| 5167 | 0 \ |
| 5168 | -S "mbedtls_ssl_handshake returned" \ |
| 5169 | -C "mbedtls_ssl_handshake returned" \ |
| 5170 | -c "Read from server: .* bytes read" |
| 5171 | |
| 5172 | run_test "Event-driven I/O: ticket" \ |
| 5173 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5174 | "$P_CLI event=1 tickets=1" \ |
| 5175 | 0 \ |
| 5176 | -S "mbedtls_ssl_handshake returned" \ |
| 5177 | -C "mbedtls_ssl_handshake returned" \ |
| 5178 | -c "Read from server: .* bytes read" |
| 5179 | |
| 5180 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5181 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5182 | "$P_CLI event=1 tickets=1" \ |
| 5183 | 0 \ |
| 5184 | -S "mbedtls_ssl_handshake returned" \ |
| 5185 | -C "mbedtls_ssl_handshake returned" \ |
| 5186 | -c "Read from server: .* bytes read" |
| 5187 | |
| 5188 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5189 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5190 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5191 | 0 \ |
| 5192 | -S "mbedtls_ssl_handshake returned" \ |
| 5193 | -C "mbedtls_ssl_handshake returned" \ |
| 5194 | -c "Read from server: .* bytes read" |
| 5195 | |
| 5196 | run_test "Event-driven I/O: ticket + resume" \ |
| 5197 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5198 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5199 | 0 \ |
| 5200 | -S "mbedtls_ssl_handshake returned" \ |
| 5201 | -C "mbedtls_ssl_handshake returned" \ |
| 5202 | -c "Read from server: .* bytes read" |
| 5203 | |
| 5204 | run_test "Event-driven I/O: session-id resume" \ |
| 5205 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5206 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5207 | 0 \ |
| 5208 | -S "mbedtls_ssl_handshake returned" \ |
| 5209 | -C "mbedtls_ssl_handshake returned" \ |
| 5210 | -c "Read from server: .* bytes read" |
| 5211 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5212 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5213 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5214 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5215 | 0 \ |
| 5216 | -c "Read from server: .* bytes read" |
| 5217 | |
| 5218 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5219 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5220 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5221 | 0 \ |
| 5222 | -c "Read from server: .* bytes read" |
| 5223 | |
| 5224 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5225 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5226 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5227 | 0 \ |
| 5228 | -c "Read from server: .* bytes read" |
| 5229 | |
| 5230 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5231 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5232 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5233 | 0 \ |
| 5234 | -c "Read from server: .* bytes read" |
| 5235 | |
| 5236 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5237 | "$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] | 5238 | "$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] | 5239 | 0 \ |
| 5240 | -c "Read from server: .* bytes read" |
| 5241 | |
| 5242 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5243 | "$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] | 5244 | "$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] | 5245 | 0 \ |
| 5246 | -c "Read from server: .* bytes read" |
| 5247 | |
| 5248 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5249 | "$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] | 5250 | "$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] | 5251 | 0 \ |
| 5252 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5253 | |
| 5254 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5255 | # During session resumption, the client will send its ApplicationData record |
| 5256 | # within the same datagram as the Finished messages. In this situation, the |
| 5257 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5258 | # because the ApplicationData request has already been queued internally. |
| 5259 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5260 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5261 | "$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] | 5262 | "$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] | 5263 | 0 \ |
| 5264 | -c "Read from server: .* bytes read" |
| 5265 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5266 | # Tests for version negotiation |
| 5267 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5268 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5269 | "$P_SRV" \ |
| 5270 | "$P_CLI" \ |
| 5271 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5272 | -S "mbedtls_ssl_handshake returned" \ |
| 5273 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5274 | -s "Protocol is TLSv1.2" \ |
| 5275 | -c "Protocol is TLSv1.2" |
| 5276 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5277 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5278 | "$P_SRV" \ |
| 5279 | "$P_CLI max_version=tls1_1" \ |
| 5280 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5281 | -S "mbedtls_ssl_handshake returned" \ |
| 5282 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5283 | -s "Protocol is TLSv1.1" \ |
| 5284 | -c "Protocol is TLSv1.1" |
| 5285 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5286 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5287 | "$P_SRV max_version=tls1_1" \ |
| 5288 | "$P_CLI" \ |
| 5289 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5290 | -S "mbedtls_ssl_handshake returned" \ |
| 5291 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5292 | -s "Protocol is TLSv1.1" \ |
| 5293 | -c "Protocol is TLSv1.1" |
| 5294 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5295 | 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] | 5296 | "$P_SRV max_version=tls1_1" \ |
| 5297 | "$P_CLI max_version=tls1_1" \ |
| 5298 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5299 | -S "mbedtls_ssl_handshake returned" \ |
| 5300 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5301 | -s "Protocol is TLSv1.1" \ |
| 5302 | -c "Protocol is TLSv1.1" |
| 5303 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5304 | 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] | 5305 | "$P_SRV min_version=tls1_1" \ |
| 5306 | "$P_CLI max_version=tls1_1" \ |
| 5307 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5308 | -S "mbedtls_ssl_handshake returned" \ |
| 5309 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5310 | -s "Protocol is TLSv1.1" \ |
| 5311 | -c "Protocol is TLSv1.1" |
| 5312 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5313 | 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] | 5314 | "$P_SRV max_version=tls1_1" \ |
| 5315 | "$P_CLI min_version=tls1_1" \ |
| 5316 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5317 | -S "mbedtls_ssl_handshake returned" \ |
| 5318 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5319 | -s "Protocol is TLSv1.1" \ |
| 5320 | -c "Protocol is TLSv1.1" |
| 5321 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5322 | 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] | 5323 | "$P_SRV max_version=tls1_1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5324 | "$P_CLI min_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5325 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5326 | -s "mbedtls_ssl_handshake returned" \ |
| 5327 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5328 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5329 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5330 | 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] | 5331 | "$P_SRV min_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5332 | "$P_CLI max_version=tls1_1" \ |
| 5333 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5334 | -s "mbedtls_ssl_handshake returned" \ |
| 5335 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5336 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5337 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5338 | # Tests for ALPN extension |
| 5339 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5340 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5341 | "$P_SRV debug_level=3" \ |
| 5342 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5343 | 0 \ |
| 5344 | -C "client hello, adding alpn extension" \ |
| 5345 | -S "found alpn extension" \ |
| 5346 | -C "got an alert message, type: \\[2:120]" \ |
| 5347 | -S "server hello, adding alpn extension" \ |
| 5348 | -C "found alpn extension " \ |
| 5349 | -C "Application Layer Protocol is" \ |
| 5350 | -S "Application Layer Protocol is" |
| 5351 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5352 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5353 | "$P_SRV debug_level=3" \ |
| 5354 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5355 | 0 \ |
| 5356 | -c "client hello, adding alpn extension" \ |
| 5357 | -s "found alpn extension" \ |
| 5358 | -C "got an alert message, type: \\[2:120]" \ |
| 5359 | -S "server hello, adding alpn extension" \ |
| 5360 | -C "found alpn extension " \ |
| 5361 | -c "Application Layer Protocol is (none)" \ |
| 5362 | -S "Application Layer Protocol is" |
| 5363 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5364 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5365 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5366 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5367 | 0 \ |
| 5368 | -C "client hello, adding alpn extension" \ |
| 5369 | -S "found alpn extension" \ |
| 5370 | -C "got an alert message, type: \\[2:120]" \ |
| 5371 | -S "server hello, adding alpn extension" \ |
| 5372 | -C "found alpn extension " \ |
| 5373 | -C "Application Layer Protocol is" \ |
| 5374 | -s "Application Layer Protocol is (none)" |
| 5375 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5376 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5377 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5378 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5379 | 0 \ |
| 5380 | -c "client hello, adding alpn extension" \ |
| 5381 | -s "found alpn extension" \ |
| 5382 | -C "got an alert message, type: \\[2:120]" \ |
| 5383 | -s "server hello, adding alpn extension" \ |
| 5384 | -c "found alpn extension" \ |
| 5385 | -c "Application Layer Protocol is abc" \ |
| 5386 | -s "Application Layer Protocol is abc" |
| 5387 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5388 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5389 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5390 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5391 | 0 \ |
| 5392 | -c "client hello, adding alpn extension" \ |
| 5393 | -s "found alpn extension" \ |
| 5394 | -C "got an alert message, type: \\[2:120]" \ |
| 5395 | -s "server hello, adding alpn extension" \ |
| 5396 | -c "found alpn extension" \ |
| 5397 | -c "Application Layer Protocol is abc" \ |
| 5398 | -s "Application Layer Protocol is abc" |
| 5399 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5400 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5401 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5402 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5403 | 0 \ |
| 5404 | -c "client hello, adding alpn extension" \ |
| 5405 | -s "found alpn extension" \ |
| 5406 | -C "got an alert message, type: \\[2:120]" \ |
| 5407 | -s "server hello, adding alpn extension" \ |
| 5408 | -c "found alpn extension" \ |
| 5409 | -c "Application Layer Protocol is 1234" \ |
| 5410 | -s "Application Layer Protocol is 1234" |
| 5411 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5412 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5413 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5414 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5415 | 1 \ |
| 5416 | -c "client hello, adding alpn extension" \ |
| 5417 | -s "found alpn extension" \ |
| 5418 | -c "got an alert message, type: \\[2:120]" \ |
| 5419 | -S "server hello, adding alpn extension" \ |
| 5420 | -C "found alpn extension" \ |
| 5421 | -C "Application Layer Protocol is 1234" \ |
| 5422 | -S "Application Layer Protocol is 1234" |
| 5423 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5424 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5425 | # Tests for keyUsage in leaf certificates, part 1: |
| 5426 | # server-side certificate/suite selection |
| 5427 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5428 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5429 | "$P_SRV key_file=data_files/server2.key \ |
| 5430 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5431 | "$P_CLI" \ |
| 5432 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5433 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5434 | |
| 5435 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5436 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5437 | "$P_SRV key_file=data_files/server2.key \ |
| 5438 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5439 | "$P_CLI" \ |
| 5440 | 0 \ |
| 5441 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5442 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5443 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5444 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5445 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5446 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5447 | 1 \ |
| 5448 | -C "Ciphersuite is " |
| 5449 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5450 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5451 | "$P_SRV key_file=data_files/server5.key \ |
| 5452 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5453 | "$P_CLI" \ |
| 5454 | 0 \ |
| 5455 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5456 | |
| 5457 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5458 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5459 | "$P_SRV key_file=data_files/server5.key \ |
| 5460 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5461 | "$P_CLI" \ |
| 5462 | 0 \ |
| 5463 | -c "Ciphersuite is TLS-ECDH-" |
| 5464 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5465 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5466 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5467 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5468 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5469 | 1 \ |
| 5470 | -C "Ciphersuite is " |
| 5471 | |
| 5472 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5473 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5474 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5475 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5476 | "$O_SRV -key data_files/server2.key \ |
| 5477 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5478 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5479 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5480 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5481 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5482 | -C "Processing of the Certificate handshake message failed" \ |
| 5483 | -c "Ciphersuite is TLS-" |
| 5484 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5485 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5486 | "$O_SRV -key data_files/server2.key \ |
| 5487 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5488 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5489 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5490 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5491 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5492 | -C "Processing of the Certificate handshake message failed" \ |
| 5493 | -c "Ciphersuite is TLS-" |
| 5494 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5495 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5496 | "$O_SRV -key data_files/server2.key \ |
| 5497 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5498 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5499 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5500 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5501 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5502 | -C "Processing of the Certificate handshake message failed" \ |
| 5503 | -c "Ciphersuite is TLS-" |
| 5504 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5505 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5506 | "$O_SRV -key data_files/server2.key \ |
| 5507 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5508 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5509 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5510 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5511 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5512 | -c "Processing of the Certificate handshake message failed" \ |
| 5513 | -C "Ciphersuite is TLS-" |
| 5514 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5515 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5516 | "$O_SRV -key data_files/server2.key \ |
| 5517 | -cert data_files/server2.ku-ke.crt" \ |
| 5518 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5519 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5520 | 0 \ |
| 5521 | -c "bad certificate (usage extensions)" \ |
| 5522 | -C "Processing of the Certificate handshake message failed" \ |
| 5523 | -c "Ciphersuite is TLS-" \ |
| 5524 | -c "! Usage does not match the keyUsage extension" |
| 5525 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5526 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5527 | "$O_SRV -key data_files/server2.key \ |
| 5528 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5529 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5530 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5531 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5532 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5533 | -C "Processing of the Certificate handshake message failed" \ |
| 5534 | -c "Ciphersuite is TLS-" |
| 5535 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5536 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5537 | "$O_SRV -key data_files/server2.key \ |
| 5538 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5539 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5540 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5541 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5542 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5543 | -c "Processing of the Certificate handshake message failed" \ |
| 5544 | -C "Ciphersuite is TLS-" |
| 5545 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5546 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5547 | "$O_SRV -key data_files/server2.key \ |
| 5548 | -cert data_files/server2.ku-ds.crt" \ |
| 5549 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5550 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5551 | 0 \ |
| 5552 | -c "bad certificate (usage extensions)" \ |
| 5553 | -C "Processing of the Certificate handshake message failed" \ |
| 5554 | -c "Ciphersuite is TLS-" \ |
| 5555 | -c "! Usage does not match the keyUsage extension" |
| 5556 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5557 | # Tests for keyUsage in leaf certificates, part 3: |
| 5558 | # server-side checking of client cert |
| 5559 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5560 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5561 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5562 | "$O_CLI -key data_files/server2.key \ |
| 5563 | -cert data_files/server2.ku-ds.crt" \ |
| 5564 | 0 \ |
| 5565 | -S "bad certificate (usage extensions)" \ |
| 5566 | -S "Processing of the Certificate handshake message failed" |
| 5567 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5568 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5569 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5570 | "$O_CLI -key data_files/server2.key \ |
| 5571 | -cert data_files/server2.ku-ke.crt" \ |
| 5572 | 0 \ |
| 5573 | -s "bad certificate (usage extensions)" \ |
| 5574 | -S "Processing of the Certificate handshake message failed" |
| 5575 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5576 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5577 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5578 | "$O_CLI -key data_files/server2.key \ |
| 5579 | -cert data_files/server2.ku-ke.crt" \ |
| 5580 | 1 \ |
| 5581 | -s "bad certificate (usage extensions)" \ |
| 5582 | -s "Processing of the Certificate handshake message failed" |
| 5583 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5584 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5585 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5586 | "$O_CLI -key data_files/server5.key \ |
| 5587 | -cert data_files/server5.ku-ds.crt" \ |
| 5588 | 0 \ |
| 5589 | -S "bad certificate (usage extensions)" \ |
| 5590 | -S "Processing of the Certificate handshake message failed" |
| 5591 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5592 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5593 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5594 | "$O_CLI -key data_files/server5.key \ |
| 5595 | -cert data_files/server5.ku-ka.crt" \ |
| 5596 | 0 \ |
| 5597 | -s "bad certificate (usage extensions)" \ |
| 5598 | -S "Processing of the Certificate handshake message failed" |
| 5599 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5600 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5601 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5602 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5603 | "$P_SRV key_file=data_files/server5.key \ |
| 5604 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5605 | "$P_CLI" \ |
| 5606 | 0 |
| 5607 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5608 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5609 | "$P_SRV key_file=data_files/server5.key \ |
| 5610 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5611 | "$P_CLI" \ |
| 5612 | 0 |
| 5613 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5614 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5615 | "$P_SRV key_file=data_files/server5.key \ |
| 5616 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5617 | "$P_CLI" \ |
| 5618 | 0 |
| 5619 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5620 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5621 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5622 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5623 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5624 | 1 |
| 5625 | |
| 5626 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5627 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5628 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5629 | "$O_SRV -key data_files/server5.key \ |
| 5630 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5631 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5632 | 0 \ |
| 5633 | -C "bad certificate (usage extensions)" \ |
| 5634 | -C "Processing of the Certificate handshake message failed" \ |
| 5635 | -c "Ciphersuite is TLS-" |
| 5636 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5637 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5638 | "$O_SRV -key data_files/server5.key \ |
| 5639 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5640 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5641 | 0 \ |
| 5642 | -C "bad certificate (usage extensions)" \ |
| 5643 | -C "Processing of the Certificate handshake message failed" \ |
| 5644 | -c "Ciphersuite is TLS-" |
| 5645 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5646 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5647 | "$O_SRV -key data_files/server5.key \ |
| 5648 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5649 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5650 | 0 \ |
| 5651 | -C "bad certificate (usage extensions)" \ |
| 5652 | -C "Processing of the Certificate handshake message failed" \ |
| 5653 | -c "Ciphersuite is TLS-" |
| 5654 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5655 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5656 | "$O_SRV -key data_files/server5.key \ |
| 5657 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5658 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5659 | 1 \ |
| 5660 | -c "bad certificate (usage extensions)" \ |
| 5661 | -c "Processing of the Certificate handshake message failed" \ |
| 5662 | -C "Ciphersuite is TLS-" |
| 5663 | |
| 5664 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5665 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5666 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5667 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5668 | "$O_CLI -key data_files/server5.key \ |
| 5669 | -cert data_files/server5.eku-cli.crt" \ |
| 5670 | 0 \ |
| 5671 | -S "bad certificate (usage extensions)" \ |
| 5672 | -S "Processing of the Certificate handshake message failed" |
| 5673 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5674 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5675 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5676 | "$O_CLI -key data_files/server5.key \ |
| 5677 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5678 | 0 \ |
| 5679 | -S "bad certificate (usage extensions)" \ |
| 5680 | -S "Processing of the Certificate handshake message failed" |
| 5681 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5682 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5683 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5684 | "$O_CLI -key data_files/server5.key \ |
| 5685 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5686 | 0 \ |
| 5687 | -S "bad certificate (usage extensions)" \ |
| 5688 | -S "Processing of the Certificate handshake message failed" |
| 5689 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5690 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5691 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5692 | "$O_CLI -key data_files/server5.key \ |
| 5693 | -cert data_files/server5.eku-cs.crt" \ |
| 5694 | 0 \ |
| 5695 | -s "bad certificate (usage extensions)" \ |
| 5696 | -S "Processing of the Certificate handshake message failed" |
| 5697 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5698 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5699 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5700 | "$O_CLI -key data_files/server5.key \ |
| 5701 | -cert data_files/server5.eku-cs.crt" \ |
| 5702 | 1 \ |
| 5703 | -s "bad certificate (usage extensions)" \ |
| 5704 | -s "Processing of the Certificate handshake message failed" |
| 5705 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5706 | # Tests for DHM parameters loading |
| 5707 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5708 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5709 | "$P_SRV" \ |
| 5710 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5711 | debug_level=3" \ |
| 5712 | 0 \ |
| 5713 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5714 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5715 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5716 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5717 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5718 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5719 | debug_level=3" \ |
| 5720 | 0 \ |
| 5721 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5722 | -c "value of 'DHM: G ' (2 bits)" |
| 5723 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5724 | # Tests for DHM client-side size checking |
| 5725 | |
| 5726 | run_test "DHM size: server default, client default, OK" \ |
| 5727 | "$P_SRV" \ |
| 5728 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5729 | debug_level=1" \ |
| 5730 | 0 \ |
| 5731 | -C "DHM prime too short:" |
| 5732 | |
| 5733 | run_test "DHM size: server default, client 2048, OK" \ |
| 5734 | "$P_SRV" \ |
| 5735 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5736 | debug_level=1 dhmlen=2048" \ |
| 5737 | 0 \ |
| 5738 | -C "DHM prime too short:" |
| 5739 | |
| 5740 | run_test "DHM size: server 1024, client default, OK" \ |
| 5741 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5742 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5743 | debug_level=1" \ |
| 5744 | 0 \ |
| 5745 | -C "DHM prime too short:" |
| 5746 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5747 | run_test "DHM size: server 999, client 999, OK" \ |
| 5748 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5749 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5750 | debug_level=1 dhmlen=999" \ |
| 5751 | 0 \ |
| 5752 | -C "DHM prime too short:" |
| 5753 | |
| 5754 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5755 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5756 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5757 | debug_level=1 dhmlen=1000" \ |
| 5758 | 0 \ |
| 5759 | -C "DHM prime too short:" |
| 5760 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5761 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5762 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5763 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5764 | debug_level=1" \ |
| 5765 | 1 \ |
| 5766 | -c "DHM prime too short:" |
| 5767 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5768 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5769 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5770 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5771 | debug_level=1 dhmlen=1001" \ |
| 5772 | 1 \ |
| 5773 | -c "DHM prime too short:" |
| 5774 | |
| 5775 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5776 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5777 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5778 | debug_level=1 dhmlen=1000" \ |
| 5779 | 1 \ |
| 5780 | -c "DHM prime too short:" |
| 5781 | |
| 5782 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5783 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5784 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5785 | debug_level=1 dhmlen=999" \ |
| 5786 | 1 \ |
| 5787 | -c "DHM prime too short:" |
| 5788 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5789 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5790 | "$P_SRV" \ |
| 5791 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5792 | debug_level=1 dhmlen=2049" \ |
| 5793 | 1 \ |
| 5794 | -c "DHM prime too short:" |
| 5795 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5796 | # Tests for PSK callback |
| 5797 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5798 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5799 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5800 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5801 | psk_identity=foo psk=abc123" \ |
| 5802 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5803 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5804 | -S "SSL - Unknown identity received" \ |
| 5805 | -S "SSL - Verification of the message MAC failed" |
| 5806 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5807 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5808 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5809 | "$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] | 5810 | "$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] | 5811 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5812 | 0 \ |
| 5813 | -c "skip PMS generation for opaque PSK"\ |
| 5814 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5815 | -C "session hash for extended master secret"\ |
| 5816 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5817 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5818 | -S "SSL - Unknown identity received" \ |
| 5819 | -S "SSL - Verification of the message MAC failed" |
| 5820 | |
| 5821 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5822 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5823 | "$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] | 5824 | "$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] | 5825 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5826 | 0 \ |
| 5827 | -c "skip PMS generation for opaque PSK"\ |
| 5828 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5829 | -C "session hash for extended master secret"\ |
| 5830 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5831 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5832 | -S "SSL - Unknown identity received" \ |
| 5833 | -S "SSL - Verification of the message MAC failed" |
| 5834 | |
| 5835 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5836 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5837 | "$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] | 5838 | "$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] | 5839 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5840 | 0 \ |
| 5841 | -c "skip PMS generation for opaque PSK"\ |
| 5842 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5843 | -c "session hash for extended master secret"\ |
| 5844 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5845 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5846 | -S "SSL - Unknown identity received" \ |
| 5847 | -S "SSL - Verification of the message MAC failed" |
| 5848 | |
| 5849 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5850 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5851 | "$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] | 5852 | "$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] | 5853 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5854 | 0 \ |
| 5855 | -c "skip PMS generation for opaque PSK"\ |
| 5856 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5857 | -c "session hash for extended master secret"\ |
| 5858 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5859 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5860 | -S "SSL - Unknown identity received" \ |
| 5861 | -S "SSL - Verification of the message MAC failed" |
| 5862 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5863 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5864 | 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] | 5865 | "$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" \ |
| 5866 | "$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] | 5867 | psk_identity=foo psk=abc123" \ |
| 5868 | 0 \ |
| 5869 | -C "skip PMS generation for opaque PSK"\ |
| 5870 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5871 | -C "session hash for extended master secret"\ |
| 5872 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5873 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5874 | -S "SSL - Unknown identity received" \ |
| 5875 | -S "SSL - Verification of the message MAC failed" |
| 5876 | |
| 5877 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5878 | 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] | 5879 | "$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" \ |
| 5880 | "$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] | 5881 | psk_identity=foo psk=abc123" \ |
| 5882 | 0 \ |
| 5883 | -C "skip PMS generation for opaque PSK"\ |
| 5884 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5885 | -C "session hash for extended master secret"\ |
| 5886 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5887 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5888 | -S "SSL - Unknown identity received" \ |
| 5889 | -S "SSL - Verification of the message MAC failed" |
| 5890 | |
| 5891 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5892 | 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] | 5893 | "$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] | 5894 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5895 | "$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] | 5896 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5897 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5898 | -c "session hash for extended master secret"\ |
| 5899 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5900 | -C "skip PMS generation for opaque PSK"\ |
| 5901 | -s "skip PMS generation for opaque PSK"\ |
| 5902 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5903 | -S "SSL - Unknown identity received" \ |
| 5904 | -S "SSL - Verification of the message MAC failed" |
| 5905 | |
| 5906 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5907 | 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] | 5908 | "$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] | 5909 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5910 | "$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] | 5911 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5912 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5913 | -c "session hash for extended master secret"\ |
| 5914 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5915 | -C "skip PMS generation for opaque PSK"\ |
| 5916 | -s "skip PMS generation for opaque PSK"\ |
| 5917 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5918 | -S "SSL - Unknown identity received" \ |
| 5919 | -S "SSL - Verification of the message MAC failed" |
| 5920 | |
| 5921 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5922 | 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] | 5923 | "$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" \ |
| 5924 | "$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] | 5925 | psk_identity=def psk=beef" \ |
| 5926 | 0 \ |
| 5927 | -C "skip PMS generation for opaque PSK"\ |
| 5928 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5929 | -C "session hash for extended master secret"\ |
| 5930 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5931 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5932 | -S "SSL - Unknown identity received" \ |
| 5933 | -S "SSL - Verification of the message MAC failed" |
| 5934 | |
| 5935 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5936 | 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] | 5937 | "$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" \ |
| 5938 | "$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] | 5939 | psk_identity=def psk=beef" \ |
| 5940 | 0 \ |
| 5941 | -C "skip PMS generation for opaque PSK"\ |
| 5942 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5943 | -C "session hash for extended master secret"\ |
| 5944 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5945 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5946 | -S "SSL - Unknown identity received" \ |
| 5947 | -S "SSL - Verification of the message MAC failed" |
| 5948 | |
| 5949 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5950 | 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] | 5951 | "$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] | 5952 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5953 | "$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] | 5954 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5955 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5956 | -c "session hash for extended master secret"\ |
| 5957 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5958 | -C "skip PMS generation for opaque PSK"\ |
| 5959 | -s "skip PMS generation for opaque PSK"\ |
| 5960 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5961 | -S "SSL - Unknown identity received" \ |
| 5962 | -S "SSL - Verification of the message MAC failed" |
| 5963 | |
| 5964 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5965 | 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] | 5966 | "$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] | 5967 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5968 | "$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] | 5969 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5970 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5971 | -c "session hash for extended master secret"\ |
| 5972 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5973 | -C "skip PMS generation for opaque PSK"\ |
| 5974 | -s "skip PMS generation for opaque PSK"\ |
| 5975 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5976 | -S "SSL - Unknown identity received" \ |
| 5977 | -S "SSL - Verification of the message MAC failed" |
| 5978 | |
| 5979 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5980 | 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] | 5981 | "$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" \ |
| 5982 | "$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] | 5983 | psk_identity=def psk=beef" \ |
| 5984 | 0 \ |
| 5985 | -C "skip PMS generation for opaque PSK"\ |
| 5986 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5987 | -C "session hash for extended master secret"\ |
| 5988 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5989 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5990 | -S "SSL - Unknown identity received" \ |
| 5991 | -S "SSL - Verification of the message MAC failed" |
| 5992 | |
| 5993 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5994 | 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] | 5995 | "$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" \ |
| 5996 | "$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] | 5997 | psk_identity=def psk=beef" \ |
| 5998 | 0 \ |
| 5999 | -C "skip PMS generation for opaque PSK"\ |
| 6000 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6001 | -C "session hash for extended master secret"\ |
| 6002 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6003 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6004 | -S "SSL - Unknown identity received" \ |
| 6005 | -S "SSL - Verification of the message MAC failed" |
| 6006 | |
| 6007 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6008 | 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] | 6009 | "$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" \ |
| 6010 | "$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] | 6011 | psk_identity=def psk=beef" \ |
| 6012 | 0 \ |
| 6013 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6014 | -C "session hash for extended master secret"\ |
| 6015 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6016 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6017 | -S "SSL - Unknown identity received" \ |
| 6018 | -S "SSL - Verification of the message MAC failed" |
| 6019 | |
| 6020 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6021 | 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] | 6022 | "$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" \ |
| 6023 | "$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] | 6024 | psk_identity=def psk=beef" \ |
| 6025 | 0 \ |
| 6026 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6027 | -C "session hash for extended master secret"\ |
| 6028 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6029 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6030 | -S "SSL - Unknown identity received" \ |
| 6031 | -S "SSL - Verification of the message MAC failed" |
| 6032 | |
| 6033 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6034 | 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] | 6035 | "$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" \ |
| 6036 | "$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] | 6037 | psk_identity=def psk=beef" \ |
| 6038 | 1 \ |
| 6039 | -s "SSL - Verification of the message MAC failed" |
| 6040 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6041 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6042 | "$P_SRV" \ |
| 6043 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6044 | psk_identity=foo psk=abc123" \ |
| 6045 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6046 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6047 | -S "SSL - Unknown identity received" \ |
| 6048 | -S "SSL - Verification of the message MAC failed" |
| 6049 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6050 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6051 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 6052 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6053 | psk_identity=foo psk=abc123" \ |
| 6054 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6055 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6056 | -s "SSL - Unknown identity received" \ |
| 6057 | -S "SSL - Verification of the message MAC failed" |
| 6058 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6059 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6060 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6061 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6062 | psk_identity=abc psk=dead" \ |
| 6063 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6064 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6065 | -S "SSL - Unknown identity received" \ |
| 6066 | -S "SSL - Verification of the message MAC failed" |
| 6067 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6068 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6069 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6070 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6071 | psk_identity=def psk=beef" \ |
| 6072 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6073 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6074 | -S "SSL - Unknown identity received" \ |
| 6075 | -S "SSL - Verification of the message MAC failed" |
| 6076 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6077 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6078 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6079 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6080 | psk_identity=ghi psk=beef" \ |
| 6081 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6082 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6083 | -s "SSL - Unknown identity received" \ |
| 6084 | -S "SSL - Verification of the message MAC failed" |
| 6085 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6086 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6087 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6088 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6089 | psk_identity=abc psk=beef" \ |
| 6090 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6091 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6092 | -S "SSL - Unknown identity received" \ |
| 6093 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6094 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6095 | # Tests for EC J-PAKE |
| 6096 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6097 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6098 | run_test "ECJPAKE: client not configured" \ |
| 6099 | "$P_SRV debug_level=3" \ |
| 6100 | "$P_CLI debug_level=3" \ |
| 6101 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6102 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6103 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6104 | -S "found ecjpake kkpp extension" \ |
| 6105 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6106 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6107 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6108 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6109 | -S "None of the common ciphersuites is usable" |
| 6110 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6111 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6112 | run_test "ECJPAKE: server not configured" \ |
| 6113 | "$P_SRV debug_level=3" \ |
| 6114 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6115 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6116 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6117 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6118 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6119 | -s "found ecjpake kkpp extension" \ |
| 6120 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6121 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6122 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6123 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6124 | -s "None of the common ciphersuites is usable" |
| 6125 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6126 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6127 | run_test "ECJPAKE: working, TLS" \ |
| 6128 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6129 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6130 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6131 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6132 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6133 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6134 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6135 | -s "found ecjpake kkpp extension" \ |
| 6136 | -S "skip ecjpake kkpp extension" \ |
| 6137 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6138 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6139 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6140 | -S "None of the common ciphersuites is usable" \ |
| 6141 | -S "SSL - Verification of the message MAC failed" |
| 6142 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6143 | server_needs_more_time 1 |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6144 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6145 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6146 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6147 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6148 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6149 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6150 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6151 | -s "SSL - Verification of the message MAC failed" |
| 6152 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6153 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6154 | run_test "ECJPAKE: working, DTLS" \ |
| 6155 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6156 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6157 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6158 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6159 | -c "re-using cached ecjpake parameters" \ |
| 6160 | -S "SSL - Verification of the message MAC failed" |
| 6161 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6162 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6163 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6164 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6165 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6166 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6167 | 0 \ |
| 6168 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6169 | -S "SSL - Verification of the message MAC failed" |
| 6170 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6171 | server_needs_more_time 1 |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6172 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6173 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6174 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6175 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6176 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6177 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6178 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6179 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6180 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6181 | # for tests with configs/config-thread.h |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6182 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6183 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6184 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6185 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6186 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6187 | 0 |
| 6188 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6189 | # Tests for ciphersuites per version |
| 6190 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6191 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6192 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6193 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6194 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6195 | "$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] | 6196 | "$P_CLI force_version=ssl3" \ |
| 6197 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6198 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6199 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6200 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 6201 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6202 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6203 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6204 | "$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] | 6205 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6206 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6207 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6208 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6209 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6210 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6211 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6212 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6213 | "$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] | 6214 | "$P_CLI force_version=tls1_1" \ |
| 6215 | 0 \ |
| 6216 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 6217 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6218 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6219 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6220 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6221 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6222 | "$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] | 6223 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6224 | 0 \ |
| 6225 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 6226 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6227 | # Test for ClientHello without extensions |
| 6228 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6229 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6230 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6231 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6232 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6233 | 0 \ |
| 6234 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6235 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6236 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6237 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6238 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6239 | "$P_SRV" \ |
| 6240 | "$P_CLI request_size=100" \ |
| 6241 | 0 \ |
| 6242 | -s "Read from client: 100 bytes read$" |
| 6243 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6244 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6245 | "$P_SRV" \ |
| 6246 | "$P_CLI request_size=500" \ |
| 6247 | 0 \ |
| 6248 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6249 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6250 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6251 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6252 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6253 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6254 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6255 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6256 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6257 | 0 \ |
| 6258 | -s "Read from client: 1 bytes read" |
| 6259 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6260 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6261 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6262 | "$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] | 6263 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6264 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6265 | 0 \ |
| 6266 | -s "Read from client: 1 bytes read" |
| 6267 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6268 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6269 | "$P_SRV" \ |
| 6270 | "$P_CLI request_size=1 force_version=tls1 \ |
| 6271 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6272 | 0 \ |
| 6273 | -s "Read from client: 1 bytes read" |
| 6274 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6275 | 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] | 6276 | "$P_SRV" \ |
| 6277 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 6278 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6279 | 0 \ |
| 6280 | -s "Read from client: 1 bytes read" |
| 6281 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6282 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6283 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6284 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6285 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6286 | 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] | 6287 | 0 \ |
| 6288 | -s "Read from client: 1 bytes read" |
| 6289 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6290 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6291 | 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] | 6292 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6293 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6294 | 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] | 6295 | 0 \ |
| 6296 | -s "Read from client: 1 bytes read" |
| 6297 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6298 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6299 | "$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] | 6300 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6301 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6302 | 0 \ |
| 6303 | -s "Read from client: 1 bytes read" |
| 6304 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6305 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6306 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6307 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6308 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6309 | 0 \ |
| 6310 | -s "Read from client: 1 bytes read" |
| 6311 | |
| 6312 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6313 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6314 | "$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] | 6315 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6316 | 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] | 6317 | 0 \ |
| 6318 | -s "Read from client: 1 bytes read" |
| 6319 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6320 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6321 | 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] | 6322 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6323 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6324 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6325 | 0 \ |
| 6326 | -s "Read from client: 1 bytes read" |
| 6327 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6328 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6329 | "$P_SRV" \ |
| 6330 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6331 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6332 | 0 \ |
| 6333 | -s "Read from client: 1 bytes read" |
| 6334 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6335 | 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] | 6336 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6337 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6338 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6339 | 0 \ |
| 6340 | -s "Read from client: 1 bytes read" |
| 6341 | |
| 6342 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6343 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6344 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6345 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6346 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6347 | 0 \ |
| 6348 | -s "Read from client: 1 bytes read" |
| 6349 | |
| 6350 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6351 | 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] | 6352 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6353 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6354 | 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] | 6355 | 0 \ |
| 6356 | -s "Read from client: 1 bytes read" |
| 6357 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6358 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6359 | "$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] | 6360 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6361 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6362 | 0 \ |
| 6363 | -s "Read from client: 1 bytes read" |
| 6364 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6365 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6366 | "$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] | 6367 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6368 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6369 | 0 \ |
| 6370 | -s "Read from client: 1 bytes read" |
| 6371 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6372 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6373 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6374 | "$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] | 6375 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6376 | 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] | 6377 | 0 \ |
| 6378 | -s "Read from client: 1 bytes read" |
| 6379 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6380 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6381 | 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] | 6382 | "$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] | 6383 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6384 | 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] | 6385 | 0 \ |
| 6386 | -s "Read from client: 1 bytes read" |
| 6387 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6388 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6389 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6390 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6391 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6392 | 0 \ |
| 6393 | -s "Read from client: 1 bytes read" |
| 6394 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6395 | 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] | 6396 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6397 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6398 | 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] | 6399 | 0 \ |
| 6400 | -s "Read from client: 1 bytes read" |
| 6401 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6402 | 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] | 6403 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6404 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6405 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6406 | 0 \ |
| 6407 | -s "Read from client: 1 bytes read" |
| 6408 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6409 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6410 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6411 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6412 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6413 | 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] | 6414 | 0 \ |
| 6415 | -s "Read from client: 1 bytes read" |
| 6416 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6417 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6418 | 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] | 6419 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6420 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6421 | 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] | 6422 | 0 \ |
| 6423 | -s "Read from client: 1 bytes read" |
| 6424 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6425 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6426 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6427 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6428 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6429 | 0 \ |
| 6430 | -s "Read from client: 1 bytes read" |
| 6431 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6432 | 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] | 6433 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6434 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6435 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6436 | 0 \ |
| 6437 | -s "Read from client: 1 bytes read" |
| 6438 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6439 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6440 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6441 | "$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] | 6442 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6443 | 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] | 6444 | 0 \ |
| 6445 | -s "Read from client: 1 bytes read" |
| 6446 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6447 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6448 | 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] | 6449 | "$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] | 6450 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6451 | 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] | 6452 | 0 \ |
| 6453 | -s "Read from client: 1 bytes read" |
| 6454 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6455 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6456 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6457 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6458 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6459 | 0 \ |
| 6460 | -s "Read from client: 1 bytes read" |
| 6461 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6462 | 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] | 6463 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6464 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6465 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6466 | 0 \ |
| 6467 | -s "Read from client: 1 bytes read" |
| 6468 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6469 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6470 | |
| 6471 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6472 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6473 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6474 | "$P_CLI dtls=1 request_size=1 \ |
| 6475 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6476 | 0 \ |
| 6477 | -s "Read from client: 1 bytes read" |
| 6478 | |
| 6479 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6480 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6481 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6482 | "$P_CLI dtls=1 request_size=1 \ |
| 6483 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6484 | 0 \ |
| 6485 | -s "Read from client: 1 bytes read" |
| 6486 | |
| 6487 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6488 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6489 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6490 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6491 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6492 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6493 | 0 \ |
| 6494 | -s "Read from client: 1 bytes read" |
| 6495 | |
| 6496 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6497 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6498 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6499 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6500 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6501 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6502 | 0 \ |
| 6503 | -s "Read from client: 1 bytes read" |
| 6504 | |
| 6505 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6506 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6507 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6508 | "$P_CLI dtls=1 request_size=1 \ |
| 6509 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6510 | 0 \ |
| 6511 | -s "Read from client: 1 bytes read" |
| 6512 | |
| 6513 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6514 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6515 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6516 | "$P_CLI dtls=1 request_size=1 \ |
| 6517 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6518 | 0 \ |
| 6519 | -s "Read from client: 1 bytes read" |
| 6520 | |
| 6521 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6522 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6523 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6524 | "$P_SRV dtls=1 force_version=dtls12 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6525 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6526 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6527 | 0 \ |
| 6528 | -s "Read from client: 1 bytes read" |
| 6529 | |
| 6530 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6531 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6532 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6533 | "$P_SRV dtls=1 force_version=dtls12 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6534 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6535 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6536 | 0 \ |
| 6537 | -s "Read from client: 1 bytes read" |
| 6538 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6539 | # Tests for small server packets |
| 6540 | |
| 6541 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6542 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 6543 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 6544 | "$P_CLI force_version=ssl3 \ |
| 6545 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6546 | 0 \ |
| 6547 | -c "Read from server: 1 bytes read" |
| 6548 | |
| 6549 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6550 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 6551 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6552 | "$P_CLI force_version=ssl3 \ |
| 6553 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6554 | 0 \ |
| 6555 | -c "Read from server: 1 bytes read" |
| 6556 | |
| 6557 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6558 | "$P_SRV response_size=1" \ |
| 6559 | "$P_CLI force_version=tls1 \ |
| 6560 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6561 | 0 \ |
| 6562 | -c "Read from server: 1 bytes read" |
| 6563 | |
| 6564 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6565 | "$P_SRV response_size=1" \ |
| 6566 | "$P_CLI force_version=tls1 etm=0 \ |
| 6567 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6568 | 0 \ |
| 6569 | -c "Read from server: 1 bytes read" |
| 6570 | |
| 6571 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6572 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6573 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6574 | "$P_CLI force_version=tls1 \ |
| 6575 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6576 | 0 \ |
| 6577 | -c "Read from server: 1 bytes read" |
| 6578 | |
| 6579 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6580 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6581 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6582 | "$P_CLI force_version=tls1 \ |
| 6583 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6584 | 0 \ |
| 6585 | -c "Read from server: 1 bytes read" |
| 6586 | |
| 6587 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 6588 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6589 | "$P_CLI force_version=tls1 \ |
| 6590 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6591 | 0 \ |
| 6592 | -c "Read from server: 1 bytes read" |
| 6593 | |
| 6594 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6595 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6596 | "$P_CLI force_version=tls1 \ |
| 6597 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6598 | 0 \ |
| 6599 | -c "Read from server: 1 bytes read" |
| 6600 | |
| 6601 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6602 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6603 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6604 | "$P_CLI force_version=tls1 \ |
| 6605 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6606 | 0 \ |
| 6607 | -c "Read from server: 1 bytes read" |
| 6608 | |
| 6609 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6610 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6611 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6612 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6613 | trunc_hmac=1 etm=0" \ |
| 6614 | 0 \ |
| 6615 | -c "Read from server: 1 bytes read" |
| 6616 | |
| 6617 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6618 | "$P_SRV response_size=1" \ |
| 6619 | "$P_CLI force_version=tls1_1 \ |
| 6620 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6621 | 0 \ |
| 6622 | -c "Read from server: 1 bytes read" |
| 6623 | |
| 6624 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6625 | "$P_SRV response_size=1" \ |
| 6626 | "$P_CLI force_version=tls1_1 \ |
| 6627 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6628 | 0 \ |
| 6629 | -c "Read from server: 1 bytes read" |
| 6630 | |
| 6631 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6632 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 6633 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6634 | "$P_CLI force_version=tls1_1 \ |
| 6635 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6636 | 0 \ |
| 6637 | -c "Read from server: 1 bytes read" |
| 6638 | |
| 6639 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6640 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6641 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6642 | "$P_CLI force_version=tls1_1 \ |
| 6643 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6644 | 0 \ |
| 6645 | -c "Read from server: 1 bytes read" |
| 6646 | |
| 6647 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 6648 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6649 | "$P_CLI force_version=tls1_1 \ |
| 6650 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6651 | 0 \ |
| 6652 | -c "Read from server: 1 bytes read" |
| 6653 | |
| 6654 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6655 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6656 | "$P_CLI force_version=tls1_1 \ |
| 6657 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6658 | 0 \ |
| 6659 | -c "Read from server: 1 bytes read" |
| 6660 | |
| 6661 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6662 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 6663 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6664 | "$P_CLI force_version=tls1_1 \ |
| 6665 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6666 | 0 \ |
| 6667 | -c "Read from server: 1 bytes read" |
| 6668 | |
| 6669 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6670 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6671 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6672 | "$P_CLI force_version=tls1_1 \ |
| 6673 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6674 | 0 \ |
| 6675 | -c "Read from server: 1 bytes read" |
| 6676 | |
| 6677 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6678 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6679 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6680 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6681 | 0 \ |
| 6682 | -c "Read from server: 1 bytes read" |
| 6683 | |
| 6684 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6685 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6686 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6687 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6688 | 0 \ |
| 6689 | -c "Read from server: 1 bytes read" |
| 6690 | |
| 6691 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6692 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6693 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6694 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6695 | 0 \ |
| 6696 | -c "Read from server: 1 bytes read" |
| 6697 | |
| 6698 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6699 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6700 | "$P_SRV response_size=1 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6701 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6702 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6703 | 0 \ |
| 6704 | -c "Read from server: 1 bytes read" |
| 6705 | |
| 6706 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6707 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6708 | "$P_SRV response_size=1 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6709 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6710 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6711 | 0 \ |
| 6712 | -c "Read from server: 1 bytes read" |
| 6713 | |
| 6714 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 6715 | "$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] | 6716 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6717 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6718 | 0 \ |
| 6719 | -c "Read from server: 1 bytes read" |
| 6720 | |
| 6721 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6722 | "$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] | 6723 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6724 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6725 | 0 \ |
| 6726 | -c "Read from server: 1 bytes read" |
| 6727 | |
| 6728 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6729 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6730 | "$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] | 6731 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6732 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6733 | 0 \ |
| 6734 | -c "Read from server: 1 bytes read" |
| 6735 | |
| 6736 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6737 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6738 | "$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] | 6739 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6740 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6741 | 0 \ |
| 6742 | -c "Read from server: 1 bytes read" |
| 6743 | |
| 6744 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6745 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6746 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6747 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6748 | 0 \ |
| 6749 | -c "Read from server: 1 bytes read" |
| 6750 | |
| 6751 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6752 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6753 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6754 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6755 | 0 \ |
| 6756 | -c "Read from server: 1 bytes read" |
| 6757 | |
| 6758 | # Tests for small server packets in DTLS |
| 6759 | |
| 6760 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6761 | run_test "Small server packet DTLS 1.0" \ |
| 6762 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6763 | "$P_CLI dtls=1 \ |
| 6764 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6765 | 0 \ |
| 6766 | -c "Read from server: 1 bytes read" |
| 6767 | |
| 6768 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6769 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6770 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6771 | "$P_CLI dtls=1 \ |
| 6772 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6773 | 0 \ |
| 6774 | -c "Read from server: 1 bytes read" |
| 6775 | |
| 6776 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6777 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6778 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6779 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6780 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6781 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6782 | 0 \ |
| 6783 | -c "Read from server: 1 bytes read" |
| 6784 | |
| 6785 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6786 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6787 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6788 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6789 | "$P_CLI dtls=1 \ |
| 6790 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6791 | 0 \ |
| 6792 | -c "Read from server: 1 bytes read" |
| 6793 | |
| 6794 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6795 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6796 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6797 | "$P_CLI dtls=1 \ |
| 6798 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6799 | 0 \ |
| 6800 | -c "Read from server: 1 bytes read" |
| 6801 | |
| 6802 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6803 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6804 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6805 | "$P_CLI dtls=1 \ |
| 6806 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6807 | 0 \ |
| 6808 | -c "Read from server: 1 bytes read" |
| 6809 | |
| 6810 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6811 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6812 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6813 | "$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] | 6814 | "$P_CLI dtls=1 \ |
| 6815 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6816 | 0 \ |
| 6817 | -c "Read from server: 1 bytes read" |
| 6818 | |
| 6819 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6820 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6821 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6822 | "$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] | 6823 | "$P_CLI dtls=1 \ |
| 6824 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6825 | 0 \ |
| 6826 | -c "Read from server: 1 bytes read" |
| 6827 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6828 | # A test for extensions in SSLv3 |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6829 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6830 | requires_max_content_len 4096 |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6831 | run_test "SSLv3 with extensions, server side" \ |
| 6832 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 6833 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 6834 | 0 \ |
| 6835 | -S "dumping 'client hello extensions'" \ |
| 6836 | -S "server hello, total extension length:" |
| 6837 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6838 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6839 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6840 | # How many fragments do we expect to write $1 bytes? |
| 6841 | fragments_for_write() { |
| 6842 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6843 | } |
| 6844 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6845 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6846 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6847 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6848 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6849 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6850 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6851 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6852 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6853 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6854 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6855 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6856 | "$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] | 6857 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 6858 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6859 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6860 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6861 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6862 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6863 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6864 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6865 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6866 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6867 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6868 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6869 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6870 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6871 | 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] | 6872 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6873 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6874 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6875 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6876 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6877 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6878 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6879 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6880 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6881 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6882 | 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] | 6883 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6884 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6885 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6886 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6887 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6888 | 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] | 6889 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6890 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6891 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6892 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6893 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6894 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6895 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6896 | "$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] | 6897 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6898 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6899 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6900 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6901 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6902 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6903 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6904 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6905 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6906 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6907 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6908 | |
| 6909 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6910 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6911 | "$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] | 6912 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6913 | 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] | 6914 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6915 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6916 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6917 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6918 | 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] | 6919 | "$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] | 6920 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6921 | 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] | 6922 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6923 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6924 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6925 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6926 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6927 | "$P_SRV" \ |
| 6928 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6929 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6930 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6931 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6932 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6933 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6934 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6935 | "$P_SRV" \ |
| 6936 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6937 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6938 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6939 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6940 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6941 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6942 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6943 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6944 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6945 | 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] | 6946 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6947 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6948 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6949 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6950 | 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] | 6951 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6952 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6953 | 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] | 6954 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6955 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6956 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6957 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6958 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6959 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6960 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6961 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6962 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6963 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6964 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6965 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6966 | "$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] | 6967 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6968 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6969 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6970 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6971 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6972 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6973 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6974 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6975 | "$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] | 6976 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6977 | 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] | 6978 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6979 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6980 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6981 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6982 | 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] | 6983 | "$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] | 6984 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6985 | 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] | 6986 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6987 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6988 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6989 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6990 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6991 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6992 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6993 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6994 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6995 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6996 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6997 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6998 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6999 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7000 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7001 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7002 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7003 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7004 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7005 | 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] | 7006 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7007 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7008 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7009 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7010 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7011 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7012 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7013 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7014 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7015 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7016 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7017 | 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] | 7018 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7019 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7020 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7021 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7022 | 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] | 7023 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7024 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7025 | 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] | 7026 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7027 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7028 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7029 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7030 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7031 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7032 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7033 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7034 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7035 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7036 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7037 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7038 | 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] | 7039 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7040 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7041 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7042 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7043 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7044 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7045 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7046 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7047 | "$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] | 7048 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7049 | 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] | 7050 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7051 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7052 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7053 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7054 | 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] | 7055 | "$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] | 7056 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7057 | 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] | 7058 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7059 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7060 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7061 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7062 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7063 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7064 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7065 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7066 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7067 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7068 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7069 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7070 | 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] | 7071 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7072 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7073 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7074 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7075 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7076 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7077 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7078 | # Test for large server packets |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7079 | # 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] | 7080 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 7081 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 7082 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7083 | "$P_CLI force_version=ssl3 \ |
| 7084 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7085 | 0 \ |
| 7086 | -c "Read from server: 16384 bytes read" |
| 7087 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 7088 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 7089 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 7090 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 7091 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 7092 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 7093 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7094 | 0 \ |
| 7095 | -c "Read from server: 1 bytes read"\ |
| 7096 | -c "16383 bytes read"\ |
| 7097 | -C "Read from server: 16384 bytes read" |
| 7098 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7099 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 7100 | "$P_SRV response_size=16384" \ |
| 7101 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7102 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7103 | 0 \ |
| 7104 | -c "Read from server: 1 bytes read"\ |
| 7105 | -c "16383 bytes read"\ |
| 7106 | -C "Read from server: 16384 bytes read" |
| 7107 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7108 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 7109 | "$P_SRV response_size=16384" \ |
| 7110 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 7111 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7112 | 0 \ |
| 7113 | -c "Read from server: 1 bytes read"\ |
| 7114 | -c "16383 bytes read"\ |
| 7115 | -C "Read from server: 16384 bytes read" |
| 7116 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7117 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7118 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 7119 | "$P_SRV response_size=16384" \ |
| 7120 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7121 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7122 | trunc_hmac=1" \ |
| 7123 | 0 \ |
| 7124 | -c "Read from server: 1 bytes read"\ |
| 7125 | -c "16383 bytes read"\ |
| 7126 | -C "Read from server: 16384 bytes read" |
| 7127 | |
| 7128 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7129 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 7130 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7131 | "$P_CLI force_version=tls1 \ |
| 7132 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7133 | trunc_hmac=1" \ |
| 7134 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7135 | -s "16384 bytes written in 1 fragments" \ |
| 7136 | -c "Read from server: 16384 bytes read" |
| 7137 | |
| 7138 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 7139 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7140 | "$P_CLI force_version=tls1 \ |
| 7141 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7142 | 0 \ |
| 7143 | -s "16384 bytes written in 1 fragments" \ |
| 7144 | -c "Read from server: 16384 bytes read" |
| 7145 | |
| 7146 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 7147 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7148 | "$P_CLI force_version=tls1 \ |
| 7149 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7150 | 0 \ |
| 7151 | -s "16384 bytes written in 1 fragments" \ |
| 7152 | -c "Read from server: 16384 bytes read" |
| 7153 | |
| 7154 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7155 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 7156 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7157 | "$P_CLI force_version=tls1 \ |
| 7158 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7159 | 0 \ |
| 7160 | -s "16384 bytes written in 1 fragments" \ |
| 7161 | -c "Read from server: 16384 bytes read" |
| 7162 | |
| 7163 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7164 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 7165 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7166 | "$P_CLI force_version=tls1 \ |
| 7167 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7168 | 0 \ |
| 7169 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7170 | -c "Read from server: 16384 bytes read" |
| 7171 | |
| 7172 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 7173 | "$P_SRV response_size=16384" \ |
| 7174 | "$P_CLI force_version=tls1_1 \ |
| 7175 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7176 | 0 \ |
| 7177 | -c "Read from server: 16384 bytes read" |
| 7178 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7179 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 7180 | "$P_SRV response_size=16384" \ |
| 7181 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 7182 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7183 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7184 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7185 | -c "Read from server: 16384 bytes read" |
| 7186 | |
| 7187 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7188 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 7189 | "$P_SRV response_size=16384" \ |
| 7190 | "$P_CLI force_version=tls1_1 \ |
| 7191 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7192 | trunc_hmac=1" \ |
| 7193 | 0 \ |
| 7194 | -c "Read from server: 16384 bytes read" |
| 7195 | |
| 7196 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7197 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 7198 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 7199 | "$P_CLI force_version=tls1_1 \ |
| 7200 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7201 | 0 \ |
| 7202 | -s "16384 bytes written in 1 fragments" \ |
| 7203 | -c "Read from server: 16384 bytes read" |
| 7204 | |
| 7205 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 7206 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7207 | "$P_CLI force_version=tls1_1 \ |
| 7208 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7209 | 0 \ |
| 7210 | -c "Read from server: 16384 bytes read" |
| 7211 | |
| 7212 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 7213 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7214 | "$P_CLI force_version=tls1_1 \ |
| 7215 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7216 | 0 \ |
| 7217 | -s "16384 bytes written in 1 fragments" \ |
| 7218 | -c "Read from server: 16384 bytes read" |
| 7219 | |
| 7220 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7221 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 7222 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7223 | "$P_CLI force_version=tls1_1 \ |
| 7224 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7225 | trunc_hmac=1" \ |
| 7226 | 0 \ |
| 7227 | -c "Read from server: 16384 bytes read" |
| 7228 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7229 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 7230 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7231 | "$P_CLI force_version=tls1_1 \ |
| 7232 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7233 | 0 \ |
| 7234 | -s "16384 bytes written in 1 fragments" \ |
| 7235 | -c "Read from server: 16384 bytes read" |
| 7236 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7237 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 7238 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7239 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7240 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7241 | 0 \ |
| 7242 | -c "Read from server: 16384 bytes read" |
| 7243 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7244 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 7245 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7246 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7247 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7248 | 0 \ |
| 7249 | -s "16384 bytes written in 1 fragments" \ |
| 7250 | -c "Read from server: 16384 bytes read" |
| 7251 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7252 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 7253 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7254 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7255 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 7256 | 0 \ |
| 7257 | -c "Read from server: 16384 bytes read" |
| 7258 | |
| 7259 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7260 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 7261 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7262 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7263 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7264 | trunc_hmac=1" \ |
| 7265 | 0 \ |
| 7266 | -c "Read from server: 16384 bytes read" |
| 7267 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7268 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 7269 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7270 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7271 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7272 | 0 \ |
| 7273 | -s "16384 bytes written in 1 fragments" \ |
| 7274 | -c "Read from server: 16384 bytes read" |
| 7275 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7276 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 7277 | "$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] | 7278 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7279 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7280 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7281 | -s "16384 bytes written in 1 fragments" \ |
| 7282 | -c "Read from server: 16384 bytes read" |
| 7283 | |
| 7284 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 7285 | "$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] | 7286 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7287 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7288 | 0 \ |
| 7289 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7290 | -c "Read from server: 16384 bytes read" |
| 7291 | |
| 7292 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7293 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 7294 | "$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] | 7295 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7296 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7297 | trunc_hmac=1" \ |
| 7298 | 0 \ |
| 7299 | -c "Read from server: 16384 bytes read" |
| 7300 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7301 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7302 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 7303 | "$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] | 7304 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7305 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7306 | 0 \ |
| 7307 | -s "16384 bytes written in 1 fragments" \ |
| 7308 | -c "Read from server: 16384 bytes read" |
| 7309 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7310 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 7311 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7312 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7313 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7314 | 0 \ |
| 7315 | -c "Read from server: 16384 bytes read" |
| 7316 | |
| 7317 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 7318 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7319 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7320 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7321 | 0 \ |
| 7322 | -c "Read from server: 16384 bytes read" |
| 7323 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7324 | # Tests for restartable ECC |
| 7325 | |
| 7326 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7327 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7328 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7329 | "$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] | 7330 | 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] | 7331 | debug_level=1" \ |
| 7332 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7333 | -C "x509_verify_cert.*4b00" \ |
| 7334 | -C "mbedtls_pk_verify.*4b00" \ |
| 7335 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7336 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7337 | |
| 7338 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7339 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7340 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7341 | "$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] | 7342 | 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] | 7343 | debug_level=1 ec_max_ops=0" \ |
| 7344 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7345 | -C "x509_verify_cert.*4b00" \ |
| 7346 | -C "mbedtls_pk_verify.*4b00" \ |
| 7347 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7348 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7349 | |
| 7350 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7351 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7352 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7353 | "$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] | 7354 | 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] | 7355 | debug_level=1 ec_max_ops=65535" \ |
| 7356 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7357 | -C "x509_verify_cert.*4b00" \ |
| 7358 | -C "mbedtls_pk_verify.*4b00" \ |
| 7359 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7360 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7361 | |
| 7362 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7363 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7364 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7365 | "$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] | 7366 | 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] | 7367 | debug_level=1 ec_max_ops=1000" \ |
| 7368 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7369 | -c "x509_verify_cert.*4b00" \ |
| 7370 | -c "mbedtls_pk_verify.*4b00" \ |
| 7371 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7372 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7373 | |
| 7374 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7375 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 7376 | "$P_SRV auth_mode=required \ |
| 7377 | crt_file=data_files/server5-badsign.crt \ |
| 7378 | key_file=data_files/server5.key" \ |
| 7379 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7380 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7381 | debug_level=1 ec_max_ops=1000" \ |
| 7382 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7383 | -c "x509_verify_cert.*4b00" \ |
| 7384 | -C "mbedtls_pk_verify.*4b00" \ |
| 7385 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7386 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7387 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7388 | -c "! mbedtls_ssl_handshake returned" \ |
| 7389 | -c "X509 - Certificate verification failed" |
| 7390 | |
| 7391 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7392 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 7393 | "$P_SRV auth_mode=required \ |
| 7394 | crt_file=data_files/server5-badsign.crt \ |
| 7395 | key_file=data_files/server5.key" \ |
| 7396 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7397 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7398 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7399 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7400 | -c "x509_verify_cert.*4b00" \ |
| 7401 | -c "mbedtls_pk_verify.*4b00" \ |
| 7402 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7403 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7404 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7405 | -C "! mbedtls_ssl_handshake returned" \ |
| 7406 | -C "X509 - Certificate verification failed" |
| 7407 | |
| 7408 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7409 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 7410 | "$P_SRV auth_mode=required \ |
| 7411 | crt_file=data_files/server5-badsign.crt \ |
| 7412 | key_file=data_files/server5.key" \ |
| 7413 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7414 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7415 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7416 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7417 | -C "x509_verify_cert.*4b00" \ |
| 7418 | -c "mbedtls_pk_verify.*4b00" \ |
| 7419 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7420 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7421 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7422 | -C "! mbedtls_ssl_handshake returned" \ |
| 7423 | -C "X509 - Certificate verification failed" |
| 7424 | |
| 7425 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7426 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7427 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7428 | "$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] | 7429 | 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] | 7430 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7431 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7432 | -c "x509_verify_cert.*4b00" \ |
| 7433 | -c "mbedtls_pk_verify.*4b00" \ |
| 7434 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7435 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7436 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7437 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7438 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 7439 | "$P_SRV" \ |
| 7440 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7441 | debug_level=1 ec_max_ops=1000" \ |
| 7442 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7443 | -c "x509_verify_cert.*4b00" \ |
| 7444 | -c "mbedtls_pk_verify.*4b00" \ |
| 7445 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7446 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7447 | |
| 7448 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7449 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 7450 | "$P_SRV psk=abc123" \ |
| 7451 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7452 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7453 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7454 | -C "x509_verify_cert.*4b00" \ |
| 7455 | -C "mbedtls_pk_verify.*4b00" \ |
| 7456 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7457 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7458 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7459 | # Tests of asynchronous private key support in SSL |
| 7460 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7461 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7462 | run_test "SSL async private: sign, delay=0" \ |
| 7463 | "$P_SRV \ |
| 7464 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7465 | "$P_CLI" \ |
| 7466 | 0 \ |
| 7467 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7468 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7469 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7470 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7471 | run_test "SSL async private: sign, delay=1" \ |
| 7472 | "$P_SRV \ |
| 7473 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7474 | "$P_CLI" \ |
| 7475 | 0 \ |
| 7476 | -s "Async sign callback: using key slot " \ |
| 7477 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7478 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7479 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7480 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7481 | run_test "SSL async private: sign, delay=2" \ |
| 7482 | "$P_SRV \ |
| 7483 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7484 | "$P_CLI" \ |
| 7485 | 0 \ |
| 7486 | -s "Async sign callback: using key slot " \ |
| 7487 | -U "Async sign callback: using key slot " \ |
| 7488 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7489 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7490 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7491 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7492 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 7493 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 7494 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7496 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 7497 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 7498 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 7499 | "$P_CLI force_version=tls1_1" \ |
| 7500 | 0 \ |
| 7501 | -s "Async sign callback: using key slot " \ |
| 7502 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7503 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7504 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7505 | run_test "SSL async private: sign, SNI" \ |
| 7506 | "$P_SRV debug_level=3 \ |
| 7507 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7508 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7509 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7510 | "$P_CLI server_name=polarssl.example" \ |
| 7511 | 0 \ |
| 7512 | -s "Async sign callback: using key slot " \ |
| 7513 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7514 | -s "parse ServerName extension" \ |
| 7515 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7516 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7517 | |
| 7518 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7519 | run_test "SSL async private: decrypt, delay=0" \ |
| 7520 | "$P_SRV \ |
| 7521 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7522 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7523 | 0 \ |
| 7524 | -s "Async decrypt callback: using key slot " \ |
| 7525 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7526 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7527 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7528 | run_test "SSL async private: decrypt, delay=1" \ |
| 7529 | "$P_SRV \ |
| 7530 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7531 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7532 | 0 \ |
| 7533 | -s "Async decrypt callback: using key slot " \ |
| 7534 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7535 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7536 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7537 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7538 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7539 | "$P_SRV psk=abc123 \ |
| 7540 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7541 | "$P_CLI psk=abc123 \ |
| 7542 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7543 | 0 \ |
| 7544 | -s "Async decrypt callback: using key slot " \ |
| 7545 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7546 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7547 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7548 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7549 | "$P_SRV psk=abc123 \ |
| 7550 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7551 | "$P_CLI psk=abc123 \ |
| 7552 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7553 | 0 \ |
| 7554 | -s "Async decrypt callback: using key slot " \ |
| 7555 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7556 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7557 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7558 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7559 | run_test "SSL async private: sign callback not present" \ |
| 7560 | "$P_SRV \ |
| 7561 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7562 | "$P_CLI; [ \$? -eq 1 ] && |
| 7563 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7564 | 0 \ |
| 7565 | -S "Async sign callback" \ |
| 7566 | -s "! mbedtls_ssl_handshake returned" \ |
| 7567 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7568 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7569 | -s "Successful connection" |
| 7570 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7571 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7572 | run_test "SSL async private: decrypt callback not present" \ |
| 7573 | "$P_SRV debug_level=1 \ |
| 7574 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7575 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7576 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7577 | 0 \ |
| 7578 | -S "Async decrypt callback" \ |
| 7579 | -s "! mbedtls_ssl_handshake returned" \ |
| 7580 | -s "got no RSA private key" \ |
| 7581 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7582 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7583 | |
| 7584 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7585 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7586 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7587 | "$P_SRV \ |
| 7588 | async_operations=s async_private_delay1=1 \ |
| 7589 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7590 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7591 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7592 | 0 \ |
| 7593 | -s "Async sign callback: using key slot 0," \ |
| 7594 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7595 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7596 | |
| 7597 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7598 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7599 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7600 | "$P_SRV \ |
| 7601 | async_operations=s async_private_delay2=1 \ |
| 7602 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7603 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7604 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7605 | 0 \ |
| 7606 | -s "Async sign callback: using key slot 0," \ |
| 7607 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7608 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7609 | |
| 7610 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7611 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7612 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7613 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7614 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7615 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7616 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7617 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7618 | 0 \ |
| 7619 | -s "Async sign callback: using key slot 1," \ |
| 7620 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7621 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7622 | |
| 7623 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7624 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7625 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7626 | "$P_SRV \ |
| 7627 | async_operations=s async_private_delay1=1 \ |
| 7628 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7629 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7630 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7631 | 0 \ |
| 7632 | -s "Async sign callback: no key matches this certificate." |
| 7633 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7634 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7635 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7636 | "$P_SRV \ |
| 7637 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7638 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7639 | "$P_CLI" \ |
| 7640 | 1 \ |
| 7641 | -s "Async sign callback: injected error" \ |
| 7642 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7643 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7644 | -s "! mbedtls_ssl_handshake returned" |
| 7645 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7646 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7647 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7648 | "$P_SRV \ |
| 7649 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7650 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7651 | "$P_CLI" \ |
| 7652 | 1 \ |
| 7653 | -s "Async sign callback: using key slot " \ |
| 7654 | -S "Async resume" \ |
| 7655 | -s "Async cancel" |
| 7656 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7657 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7658 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7659 | "$P_SRV \ |
| 7660 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7661 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7662 | "$P_CLI" \ |
| 7663 | 1 \ |
| 7664 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7665 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7666 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7667 | -s "! mbedtls_ssl_handshake returned" |
| 7668 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7669 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7670 | run_test "SSL async private: decrypt, error in start" \ |
| 7671 | "$P_SRV \ |
| 7672 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7673 | async_private_error=1" \ |
| 7674 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7675 | 1 \ |
| 7676 | -s "Async decrypt callback: injected error" \ |
| 7677 | -S "Async resume" \ |
| 7678 | -S "Async cancel" \ |
| 7679 | -s "! mbedtls_ssl_handshake returned" |
| 7680 | |
| 7681 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7682 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7683 | "$P_SRV \ |
| 7684 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7685 | async_private_error=2" \ |
| 7686 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7687 | 1 \ |
| 7688 | -s "Async decrypt callback: using key slot " \ |
| 7689 | -S "Async resume" \ |
| 7690 | -s "Async cancel" |
| 7691 | |
| 7692 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7693 | run_test "SSL async private: decrypt, error in resume" \ |
| 7694 | "$P_SRV \ |
| 7695 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7696 | async_private_error=3" \ |
| 7697 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7698 | 1 \ |
| 7699 | -s "Async decrypt callback: using key slot " \ |
| 7700 | -s "Async resume callback: decrypt done but injected error" \ |
| 7701 | -S "Async cancel" \ |
| 7702 | -s "! mbedtls_ssl_handshake returned" |
| 7703 | |
| 7704 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7705 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7706 | "$P_SRV \ |
| 7707 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7708 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7709 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7710 | 0 \ |
| 7711 | -s "Async cancel" \ |
| 7712 | -s "! mbedtls_ssl_handshake returned" \ |
| 7713 | -s "Async resume" \ |
| 7714 | -s "Successful connection" |
| 7715 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7716 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7717 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7718 | "$P_SRV \ |
| 7719 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7720 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7721 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7722 | 0 \ |
| 7723 | -s "! mbedtls_ssl_handshake returned" \ |
| 7724 | -s "Async resume" \ |
| 7725 | -s "Successful connection" |
| 7726 | |
| 7727 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7728 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7729 | 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] | 7730 | "$P_SRV \ |
| 7731 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7732 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7733 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7734 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7735 | [ \$? -eq 1 ] && |
| 7736 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7737 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7738 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7739 | -S "Async resume" \ |
| 7740 | -s "Async cancel" \ |
| 7741 | -s "! mbedtls_ssl_handshake returned" \ |
| 7742 | -s "Async sign callback: no key matches this certificate." \ |
| 7743 | -s "Successful connection" |
| 7744 | |
| 7745 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7746 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7747 | 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] | 7748 | "$P_SRV \ |
| 7749 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7750 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7751 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7752 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7753 | [ \$? -eq 1 ] && |
| 7754 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7755 | 0 \ |
| 7756 | -s "Async resume" \ |
| 7757 | -s "! mbedtls_ssl_handshake returned" \ |
| 7758 | -s "Async sign callback: no key matches this certificate." \ |
| 7759 | -s "Successful connection" |
| 7760 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7761 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7762 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7763 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7764 | "$P_SRV \ |
| 7765 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7766 | exchanges=2 renegotiation=1" \ |
| 7767 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7768 | 0 \ |
| 7769 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7770 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7771 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7772 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7773 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7774 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7775 | "$P_SRV \ |
| 7776 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7777 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7778 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7779 | 0 \ |
| 7780 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7781 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7782 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7783 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7784 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7785 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7786 | "$P_SRV \ |
| 7787 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7788 | exchanges=2 renegotiation=1" \ |
| 7789 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7790 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7791 | 0 \ |
| 7792 | -s "Async decrypt callback: using key slot " \ |
| 7793 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7794 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7795 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7796 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7797 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7798 | "$P_SRV \ |
| 7799 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7800 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7801 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7802 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7803 | 0 \ |
| 7804 | -s "Async decrypt callback: using key slot " \ |
| 7805 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7806 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7807 | # Tests for ECC extensions (rfc 4492) |
| 7808 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7809 | requires_config_enabled MBEDTLS_AES_C |
| 7810 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7811 | requires_config_enabled MBEDTLS_SHA256_C |
| 7812 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7813 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7814 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7815 | "$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] | 7816 | 0 \ |
| 7817 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7818 | -C "client hello, adding supported_point_formats extension" \ |
| 7819 | -S "found supported elliptic curves extension" \ |
| 7820 | -S "found supported point formats extension" |
| 7821 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7822 | requires_config_enabled MBEDTLS_AES_C |
| 7823 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7824 | requires_config_enabled MBEDTLS_SHA256_C |
| 7825 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7826 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7827 | "$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] | 7828 | "$P_CLI debug_level=3" \ |
| 7829 | 0 \ |
| 7830 | -C "found supported_point_formats extension" \ |
| 7831 | -S "server hello, supported_point_formats extension" |
| 7832 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7833 | requires_config_enabled MBEDTLS_AES_C |
| 7834 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7835 | requires_config_enabled MBEDTLS_SHA256_C |
| 7836 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7837 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7838 | "$P_SRV debug_level=3" \ |
| 7839 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7840 | 0 \ |
| 7841 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7842 | -c "client hello, adding supported_point_formats extension" \ |
| 7843 | -s "found supported elliptic curves extension" \ |
| 7844 | -s "found supported point formats extension" |
| 7845 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7846 | requires_config_enabled MBEDTLS_AES_C |
| 7847 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7848 | requires_config_enabled MBEDTLS_SHA256_C |
| 7849 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7850 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7851 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7852 | "$P_CLI debug_level=3" \ |
| 7853 | 0 \ |
| 7854 | -c "found supported_point_formats extension" \ |
| 7855 | -s "server hello, supported_point_formats extension" |
| 7856 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7857 | # Tests for DTLS HelloVerifyRequest |
| 7858 | |
| 7859 | run_test "DTLS cookie: enabled" \ |
| 7860 | "$P_SRV dtls=1 debug_level=2" \ |
| 7861 | "$P_CLI dtls=1 debug_level=2" \ |
| 7862 | 0 \ |
| 7863 | -s "cookie verification failed" \ |
| 7864 | -s "cookie verification passed" \ |
| 7865 | -S "cookie verification skipped" \ |
| 7866 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7867 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7868 | -S "SSL - The requested feature is not available" |
| 7869 | |
| 7870 | run_test "DTLS cookie: disabled" \ |
| 7871 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7872 | "$P_CLI dtls=1 debug_level=2" \ |
| 7873 | 0 \ |
| 7874 | -S "cookie verification failed" \ |
| 7875 | -S "cookie verification passed" \ |
| 7876 | -s "cookie verification skipped" \ |
| 7877 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7878 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7879 | -S "SSL - The requested feature is not available" |
| 7880 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7881 | run_test "DTLS cookie: default (failing)" \ |
| 7882 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7883 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7884 | 1 \ |
| 7885 | -s "cookie verification failed" \ |
| 7886 | -S "cookie verification passed" \ |
| 7887 | -S "cookie verification skipped" \ |
| 7888 | -C "received hello verify request" \ |
| 7889 | -S "hello verification requested" \ |
| 7890 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7891 | |
| 7892 | requires_ipv6 |
| 7893 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7894 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7895 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7896 | 0 \ |
| 7897 | -s "cookie verification failed" \ |
| 7898 | -s "cookie verification passed" \ |
| 7899 | -S "cookie verification skipped" \ |
| 7900 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7901 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7902 | -S "SSL - The requested feature is not available" |
| 7903 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7904 | run_test "DTLS cookie: enabled, nbio" \ |
| 7905 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7906 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7907 | 0 \ |
| 7908 | -s "cookie verification failed" \ |
| 7909 | -s "cookie verification passed" \ |
| 7910 | -S "cookie verification skipped" \ |
| 7911 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7912 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7913 | -S "SSL - The requested feature is not available" |
| 7914 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7915 | # Tests for client reconnecting from the same port with DTLS |
| 7916 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7917 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7918 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7919 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7920 | "$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] | 7921 | 0 \ |
| 7922 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7923 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7924 | -S "Client initiated reconnection from same port" |
| 7925 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7926 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7927 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7928 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7929 | "$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] | 7930 | 0 \ |
| 7931 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7932 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7933 | -s "Client initiated reconnection from same port" |
| 7934 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7935 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7936 | 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] | 7937 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7938 | "$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] | 7939 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7940 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7941 | -s "Client initiated reconnection from same port" |
| 7942 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7943 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7944 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7945 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7946 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7947 | 0 \ |
| 7948 | -S "The operation timed out" \ |
| 7949 | -s "Client initiated reconnection from same port" |
| 7950 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7951 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7952 | "$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] | 7953 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7954 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7955 | -s "The operation timed out" \ |
| 7956 | -S "Client initiated reconnection from same port" |
| 7957 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7958 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7959 | -p "$P_PXY inject_clihlo=1" \ |
| 7960 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7961 | "$P_CLI dtls=1 exchanges=2" \ |
| 7962 | 0 \ |
| 7963 | -s "possible client reconnect from the same port" \ |
| 7964 | -S "Client initiated reconnection from same port" |
| 7965 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7966 | # Tests for various cases of client authentication with DTLS |
| 7967 | # (focused on handshake flows and message parsing) |
| 7968 | |
| 7969 | run_test "DTLS client auth: required" \ |
| 7970 | "$P_SRV dtls=1 auth_mode=required" \ |
| 7971 | "$P_CLI dtls=1" \ |
| 7972 | 0 \ |
| 7973 | -s "Verifying peer X.509 certificate... ok" |
| 7974 | |
| 7975 | run_test "DTLS client auth: optional, client has no cert" \ |
| 7976 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 7977 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 7978 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7979 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7980 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7981 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7982 | "$P_SRV dtls=1 auth_mode=none" \ |
| 7983 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 7984 | 0 \ |
| 7985 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7986 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7987 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7988 | run_test "DTLS wrong PSK: badmac alert" \ |
| 7989 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 7990 | "$P_CLI dtls=1 psk=abc124" \ |
| 7991 | 1 \ |
| 7992 | -s "SSL - Verification of the message MAC failed" \ |
| 7993 | -c "SSL - A fatal alert message was received from our peer" |
| 7994 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7995 | # Tests for receiving fragmented handshake messages with DTLS |
| 7996 | |
| 7997 | requires_gnutls |
| 7998 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 7999 | "$G_SRV -u --mtu 2048 -a" \ |
| 8000 | "$P_CLI dtls=1 debug_level=2" \ |
| 8001 | 0 \ |
| 8002 | -C "found fragmented DTLS handshake message" \ |
| 8003 | -C "error" |
| 8004 | |
| 8005 | requires_gnutls |
| 8006 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 8007 | "$G_SRV -u --mtu 512" \ |
| 8008 | "$P_CLI dtls=1 debug_level=2" \ |
| 8009 | 0 \ |
| 8010 | -c "found fragmented DTLS handshake message" \ |
| 8011 | -C "error" |
| 8012 | |
| 8013 | requires_gnutls |
| 8014 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 8015 | "$G_SRV -u --mtu 128" \ |
| 8016 | "$P_CLI dtls=1 debug_level=2" \ |
| 8017 | 0 \ |
| 8018 | -c "found fragmented DTLS handshake message" \ |
| 8019 | -C "error" |
| 8020 | |
| 8021 | requires_gnutls |
| 8022 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 8023 | "$G_SRV -u --mtu 128" \ |
| 8024 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8025 | 0 \ |
| 8026 | -c "found fragmented DTLS handshake message" \ |
| 8027 | -C "error" |
| 8028 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8029 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8030 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8031 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 8032 | "$G_SRV -u --mtu 256" \ |
| 8033 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8034 | 0 \ |
| 8035 | -c "found fragmented DTLS handshake message" \ |
| 8036 | -c "client hello, adding renegotiation extension" \ |
| 8037 | -c "found renegotiation extension" \ |
| 8038 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8039 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8040 | -C "error" \ |
| 8041 | -s "Extra-header:" |
| 8042 | |
| 8043 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8044 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8045 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 8046 | "$G_SRV -u --mtu 256" \ |
| 8047 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8048 | 0 \ |
| 8049 | -c "found fragmented DTLS handshake message" \ |
| 8050 | -c "client hello, adding renegotiation extension" \ |
| 8051 | -c "found renegotiation extension" \ |
| 8052 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8053 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8054 | -C "error" \ |
| 8055 | -s "Extra-header:" |
| 8056 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8057 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 8058 | "$O_SRV -dtls1 -mtu 2048" \ |
| 8059 | "$P_CLI dtls=1 debug_level=2" \ |
| 8060 | 0 \ |
| 8061 | -C "found fragmented DTLS handshake message" \ |
| 8062 | -C "error" |
| 8063 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8064 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 8065 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8066 | "$P_CLI dtls=1 debug_level=2" \ |
| 8067 | 0 \ |
| 8068 | -c "found fragmented DTLS handshake message" \ |
| 8069 | -C "error" |
| 8070 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8071 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8072 | "$O_SRV -dtls1 -mtu 256" \ |
| 8073 | "$P_CLI dtls=1 debug_level=2" \ |
| 8074 | 0 \ |
| 8075 | -c "found fragmented DTLS handshake message" \ |
| 8076 | -C "error" |
| 8077 | |
| 8078 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 8079 | "$O_SRV -dtls1 -mtu 256" \ |
| 8080 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8081 | 0 \ |
| 8082 | -c "found fragmented DTLS handshake message" \ |
| 8083 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8084 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8085 | # Tests for sending fragmented handshake messages with DTLS |
| 8086 | # |
| 8087 | # Use client auth when we need the client to send large messages, |
| 8088 | # and use large cert chains on both sides too (the long chains we have all use |
| 8089 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 8090 | # Sizes reached (UDP payload): |
| 8091 | # - 2037B for server certificate |
| 8092 | # - 1542B for client certificate |
| 8093 | # - 1013B for newsessionticket |
| 8094 | # - all others below 512B |
| 8095 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 8096 | |
| 8097 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8098 | requires_config_enabled MBEDTLS_RSA_C |
| 8099 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8100 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8101 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8102 | run_test "DTLS fragmenting: none (for reference)" \ |
| 8103 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8104 | crt_file=data_files/server7_int-ca.crt \ |
| 8105 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8106 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8107 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8108 | "$P_CLI dtls=1 debug_level=2 \ |
| 8109 | crt_file=data_files/server8_int-ca2.crt \ |
| 8110 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8111 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8112 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8113 | 0 \ |
| 8114 | -S "found fragmented DTLS handshake message" \ |
| 8115 | -C "found fragmented DTLS handshake message" \ |
| 8116 | -C "error" |
| 8117 | |
| 8118 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8119 | requires_config_enabled MBEDTLS_RSA_C |
| 8120 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8121 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8122 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8123 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8124 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8125 | crt_file=data_files/server7_int-ca.crt \ |
| 8126 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8127 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8128 | max_frag_len=1024" \ |
| 8129 | "$P_CLI dtls=1 debug_level=2 \ |
| 8130 | crt_file=data_files/server8_int-ca2.crt \ |
| 8131 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8132 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8133 | max_frag_len=2048" \ |
| 8134 | 0 \ |
| 8135 | -S "found fragmented DTLS handshake message" \ |
| 8136 | -c "found fragmented DTLS handshake message" \ |
| 8137 | -C "error" |
| 8138 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8139 | # With the MFL extension, the server has no way of forcing |
| 8140 | # the client to not exceed a certain MTU; hence, the following |
| 8141 | # test can't be replicated with an MTU proxy such as the one |
| 8142 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8143 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8144 | requires_config_enabled MBEDTLS_RSA_C |
| 8145 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8146 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8147 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8148 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8149 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8150 | crt_file=data_files/server7_int-ca.crt \ |
| 8151 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8152 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8153 | max_frag_len=512" \ |
| 8154 | "$P_CLI dtls=1 debug_level=2 \ |
| 8155 | crt_file=data_files/server8_int-ca2.crt \ |
| 8156 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8157 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8158 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8159 | 0 \ |
| 8160 | -S "found fragmented DTLS handshake message" \ |
| 8161 | -c "found fragmented DTLS handshake message" \ |
| 8162 | -C "error" |
| 8163 | |
| 8164 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8165 | requires_config_enabled MBEDTLS_RSA_C |
| 8166 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8167 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8168 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8169 | 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] | 8170 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8171 | crt_file=data_files/server7_int-ca.crt \ |
| 8172 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8173 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8174 | max_frag_len=2048" \ |
| 8175 | "$P_CLI dtls=1 debug_level=2 \ |
| 8176 | crt_file=data_files/server8_int-ca2.crt \ |
| 8177 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8178 | hs_timeout=2500-60000 \ |
| 8179 | max_frag_len=1024" \ |
| 8180 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8181 | -S "found fragmented DTLS handshake message" \ |
| 8182 | -c "found fragmented DTLS handshake message" \ |
| 8183 | -C "error" |
| 8184 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8185 | # While not required by the standard defining the MFL extension |
| 8186 | # (according to which it only applies to records, not to datagrams), |
| 8187 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8188 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8189 | # to the peer. |
| 8190 | # The next test checks that no datagrams significantly larger than the |
| 8191 | # negotiated MFL are sent. |
| 8192 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8193 | requires_config_enabled MBEDTLS_RSA_C |
| 8194 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8195 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8196 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8197 | 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] | 8198 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8199 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8200 | crt_file=data_files/server7_int-ca.crt \ |
| 8201 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8202 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8203 | max_frag_len=2048" \ |
| 8204 | "$P_CLI dtls=1 debug_level=2 \ |
| 8205 | crt_file=data_files/server8_int-ca2.crt \ |
| 8206 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8207 | hs_timeout=2500-60000 \ |
| 8208 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8209 | 0 \ |
| 8210 | -S "found fragmented DTLS handshake message" \ |
| 8211 | -c "found fragmented DTLS handshake message" \ |
| 8212 | -C "error" |
| 8213 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8214 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8215 | requires_config_enabled MBEDTLS_RSA_C |
| 8216 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8217 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8218 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8219 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8220 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8221 | crt_file=data_files/server7_int-ca.crt \ |
| 8222 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8223 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8224 | max_frag_len=2048" \ |
| 8225 | "$P_CLI dtls=1 debug_level=2 \ |
| 8226 | crt_file=data_files/server8_int-ca2.crt \ |
| 8227 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8228 | hs_timeout=2500-60000 \ |
| 8229 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8230 | 0 \ |
| 8231 | -s "found fragmented DTLS handshake message" \ |
| 8232 | -c "found fragmented DTLS handshake message" \ |
| 8233 | -C "error" |
| 8234 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8235 | # While not required by the standard defining the MFL extension |
| 8236 | # (according to which it only applies to records, not to datagrams), |
| 8237 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8238 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8239 | # to the peer. |
| 8240 | # The next test checks that no datagrams significantly larger than the |
| 8241 | # negotiated MFL are sent. |
| 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 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8247 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 8248 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8249 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8250 | crt_file=data_files/server7_int-ca.crt \ |
| 8251 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8252 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8253 | max_frag_len=2048" \ |
| 8254 | "$P_CLI dtls=1 debug_level=2 \ |
| 8255 | crt_file=data_files/server8_int-ca2.crt \ |
| 8256 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8257 | hs_timeout=2500-60000 \ |
| 8258 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8259 | 0 \ |
| 8260 | -s "found fragmented DTLS handshake message" \ |
| 8261 | -c "found fragmented DTLS handshake message" \ |
| 8262 | -C "error" |
| 8263 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8264 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8265 | requires_config_enabled MBEDTLS_RSA_C |
| 8266 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8267 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8268 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 8269 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8270 | crt_file=data_files/server7_int-ca.crt \ |
| 8271 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8272 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8273 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8274 | "$P_CLI dtls=1 debug_level=2 \ |
| 8275 | crt_file=data_files/server8_int-ca2.crt \ |
| 8276 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8277 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8278 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8279 | 0 \ |
| 8280 | -S "found fragmented DTLS handshake message" \ |
| 8281 | -C "found fragmented DTLS handshake message" \ |
| 8282 | -C "error" |
| 8283 | |
| 8284 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8285 | requires_config_enabled MBEDTLS_RSA_C |
| 8286 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8287 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8288 | run_test "DTLS fragmenting: client (MTU)" \ |
| 8289 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8290 | crt_file=data_files/server7_int-ca.crt \ |
| 8291 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8292 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8293 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8294 | "$P_CLI dtls=1 debug_level=2 \ |
| 8295 | crt_file=data_files/server8_int-ca2.crt \ |
| 8296 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8297 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8298 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8299 | 0 \ |
| 8300 | -s "found fragmented DTLS handshake message" \ |
| 8301 | -C "found fragmented DTLS handshake message" \ |
| 8302 | -C "error" |
| 8303 | |
| 8304 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8305 | requires_config_enabled MBEDTLS_RSA_C |
| 8306 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8307 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8308 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8309 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8310 | crt_file=data_files/server7_int-ca.crt \ |
| 8311 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8312 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8313 | mtu=512" \ |
| 8314 | "$P_CLI dtls=1 debug_level=2 \ |
| 8315 | crt_file=data_files/server8_int-ca2.crt \ |
| 8316 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8317 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8318 | mtu=2048" \ |
| 8319 | 0 \ |
| 8320 | -S "found fragmented DTLS handshake message" \ |
| 8321 | -c "found fragmented DTLS handshake message" \ |
| 8322 | -C "error" |
| 8323 | |
| 8324 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8325 | requires_config_enabled MBEDTLS_RSA_C |
| 8326 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8327 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8328 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8329 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8330 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8331 | crt_file=data_files/server7_int-ca.crt \ |
| 8332 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8333 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8334 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8335 | "$P_CLI dtls=1 debug_level=2 \ |
| 8336 | crt_file=data_files/server8_int-ca2.crt \ |
| 8337 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8338 | hs_timeout=2500-60000 \ |
| 8339 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8340 | 0 \ |
| 8341 | -s "found fragmented DTLS handshake message" \ |
| 8342 | -c "found fragmented DTLS handshake message" \ |
| 8343 | -C "error" |
| 8344 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8345 | # 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] | 8346 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8347 | requires_config_enabled MBEDTLS_RSA_C |
| 8348 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8349 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8350 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8351 | requires_config_enabled MBEDTLS_AES_C |
| 8352 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8353 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8354 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8355 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8356 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8357 | crt_file=data_files/server7_int-ca.crt \ |
| 8358 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8359 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8360 | mtu=512" \ |
| 8361 | "$P_CLI dtls=1 debug_level=2 \ |
| 8362 | crt_file=data_files/server8_int-ca2.crt \ |
| 8363 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8364 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8365 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8366 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8367 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8368 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8369 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8370 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8371 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8372 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8373 | # 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] | 8374 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8375 | # retransmissions, but in some cases (like both the server and client using |
| 8376 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8377 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8378 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8379 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8380 | requires_config_enabled MBEDTLS_RSA_C |
| 8381 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8382 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8383 | requires_config_enabled MBEDTLS_AES_C |
| 8384 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8385 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8386 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8387 | -p "$P_PXY mtu=508" \ |
| 8388 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8389 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8390 | key_file=data_files/server7.key \ |
| 8391 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8392 | "$P_CLI dtls=1 debug_level=2 \ |
| 8393 | crt_file=data_files/server8_int-ca2.crt \ |
| 8394 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8395 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8396 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8397 | 0 \ |
| 8398 | -s "found fragmented DTLS handshake message" \ |
| 8399 | -c "found fragmented DTLS handshake message" \ |
| 8400 | -C "error" |
| 8401 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8402 | # 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] | 8403 | only_with_valgrind |
| 8404 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8405 | requires_config_enabled MBEDTLS_RSA_C |
| 8406 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8407 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8408 | requires_config_enabled MBEDTLS_AES_C |
| 8409 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8410 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8411 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8412 | -p "$P_PXY mtu=508" \ |
| 8413 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8414 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8415 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8416 | hs_timeout=250-10000" \ |
| 8417 | "$P_CLI dtls=1 debug_level=2 \ |
| 8418 | crt_file=data_files/server8_int-ca2.crt \ |
| 8419 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8420 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8421 | hs_timeout=250-10000" \ |
| 8422 | 0 \ |
| 8423 | -s "found fragmented DTLS handshake message" \ |
| 8424 | -c "found fragmented DTLS handshake message" \ |
| 8425 | -C "error" |
| 8426 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8427 | # 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] | 8428 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8429 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8430 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8431 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8432 | requires_config_enabled MBEDTLS_RSA_C |
| 8433 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8434 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8435 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8436 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8437 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8438 | crt_file=data_files/server7_int-ca.crt \ |
| 8439 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8440 | hs_timeout=10000-60000 \ |
| 8441 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8442 | "$P_CLI dtls=1 debug_level=2 \ |
| 8443 | crt_file=data_files/server8_int-ca2.crt \ |
| 8444 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8445 | hs_timeout=10000-60000 \ |
| 8446 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8447 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8448 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8449 | -s "found fragmented DTLS handshake message" \ |
| 8450 | -c "found fragmented DTLS handshake message" \ |
| 8451 | -C "error" |
| 8452 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8453 | # 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] | 8454 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8455 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8456 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8457 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8458 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8459 | requires_config_enabled MBEDTLS_RSA_C |
| 8460 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8461 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8462 | requires_config_enabled MBEDTLS_AES_C |
| 8463 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8464 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8465 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8466 | -p "$P_PXY mtu=512" \ |
| 8467 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8468 | crt_file=data_files/server7_int-ca.crt \ |
| 8469 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8470 | hs_timeout=10000-60000 \ |
| 8471 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8472 | "$P_CLI dtls=1 debug_level=2 \ |
| 8473 | crt_file=data_files/server8_int-ca2.crt \ |
| 8474 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8475 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8476 | hs_timeout=10000-60000 \ |
| 8477 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8478 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8479 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8480 | -s "found fragmented DTLS handshake message" \ |
| 8481 | -c "found fragmented DTLS handshake message" \ |
| 8482 | -C "error" |
| 8483 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8484 | not_with_valgrind # spurious autoreduction due to timeout |
| 8485 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8486 | requires_config_enabled MBEDTLS_RSA_C |
| 8487 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8488 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8489 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8490 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8491 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8492 | crt_file=data_files/server7_int-ca.crt \ |
| 8493 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8494 | hs_timeout=10000-60000 \ |
| 8495 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8496 | "$P_CLI dtls=1 debug_level=2 \ |
| 8497 | crt_file=data_files/server8_int-ca2.crt \ |
| 8498 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8499 | hs_timeout=10000-60000 \ |
| 8500 | mtu=1024 nbio=2" \ |
| 8501 | 0 \ |
| 8502 | -S "autoreduction" \ |
| 8503 | -s "found fragmented DTLS handshake message" \ |
| 8504 | -c "found fragmented DTLS handshake message" \ |
| 8505 | -C "error" |
| 8506 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8507 | # 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] | 8508 | not_with_valgrind # spurious autoreduction due to timeout |
| 8509 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8510 | requires_config_enabled MBEDTLS_RSA_C |
| 8511 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8512 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8513 | requires_config_enabled MBEDTLS_AES_C |
| 8514 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8515 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8516 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8517 | -p "$P_PXY mtu=512" \ |
| 8518 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8519 | crt_file=data_files/server7_int-ca.crt \ |
| 8520 | key_file=data_files/server7.key \ |
| 8521 | hs_timeout=10000-60000 \ |
| 8522 | mtu=512 nbio=2" \ |
| 8523 | "$P_CLI dtls=1 debug_level=2 \ |
| 8524 | crt_file=data_files/server8_int-ca2.crt \ |
| 8525 | key_file=data_files/server8.key \ |
| 8526 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8527 | hs_timeout=10000-60000 \ |
| 8528 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8529 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8530 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8531 | -s "found fragmented DTLS handshake message" \ |
| 8532 | -c "found fragmented DTLS handshake message" \ |
| 8533 | -C "error" |
| 8534 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8535 | # 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] | 8536 | # This ensures things still work after session_reset(). |
| 8537 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8538 | # Since we don't support reading fragmented ClientHello yet, |
| 8539 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8540 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8541 | # An autoreduction on the client-side might happen if the server is |
| 8542 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8543 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8544 | # resumed listening, which would result in a spurious autoreduction. |
| 8545 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8546 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8547 | requires_config_enabled MBEDTLS_RSA_C |
| 8548 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8549 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8550 | requires_config_enabled MBEDTLS_AES_C |
| 8551 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8552 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8553 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8554 | -p "$P_PXY mtu=1450" \ |
| 8555 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8556 | crt_file=data_files/server7_int-ca.crt \ |
| 8557 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8558 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8559 | mtu=1450" \ |
| 8560 | "$P_CLI dtls=1 debug_level=2 \ |
| 8561 | crt_file=data_files/server8_int-ca2.crt \ |
| 8562 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8563 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8564 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8565 | 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] | 8566 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8567 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8568 | -s "found fragmented DTLS handshake message" \ |
| 8569 | -c "found fragmented DTLS handshake message" \ |
| 8570 | -C "error" |
| 8571 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8572 | # An autoreduction on the client-side might happen if the server is |
| 8573 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8574 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8575 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8576 | requires_config_enabled MBEDTLS_RSA_C |
| 8577 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8578 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8579 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8580 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8581 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8582 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8583 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8584 | -p "$P_PXY mtu=512" \ |
| 8585 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8586 | crt_file=data_files/server7_int-ca.crt \ |
| 8587 | key_file=data_files/server7.key \ |
| 8588 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8589 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8590 | mtu=512" \ |
| 8591 | "$P_CLI dtls=1 debug_level=2 \ |
| 8592 | crt_file=data_files/server8_int-ca2.crt \ |
| 8593 | key_file=data_files/server8.key \ |
| 8594 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8595 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8596 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8597 | mtu=512" \ |
| 8598 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8599 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8600 | -s "found fragmented DTLS handshake message" \ |
| 8601 | -c "found fragmented DTLS handshake message" \ |
| 8602 | -C "error" |
| 8603 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8604 | # An autoreduction on the client-side might happen if the server is |
| 8605 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8606 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8607 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8608 | requires_config_enabled MBEDTLS_RSA_C |
| 8609 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8610 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8611 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8612 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8613 | requires_config_enabled MBEDTLS_AES_C |
| 8614 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8615 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8616 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8617 | -p "$P_PXY mtu=512" \ |
| 8618 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8619 | crt_file=data_files/server7_int-ca.crt \ |
| 8620 | key_file=data_files/server7.key \ |
| 8621 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8622 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8623 | mtu=512" \ |
| 8624 | "$P_CLI dtls=1 debug_level=2 \ |
| 8625 | crt_file=data_files/server8_int-ca2.crt \ |
| 8626 | key_file=data_files/server8.key \ |
| 8627 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8628 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8629 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8630 | mtu=512" \ |
| 8631 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8632 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8633 | -s "found fragmented DTLS handshake message" \ |
| 8634 | -c "found fragmented DTLS handshake message" \ |
| 8635 | -C "error" |
| 8636 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8637 | # An autoreduction on the client-side might happen if the server is |
| 8638 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8639 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8640 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8641 | requires_config_enabled MBEDTLS_RSA_C |
| 8642 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8643 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8644 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8645 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8646 | requires_config_enabled MBEDTLS_AES_C |
| 8647 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8648 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8649 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8650 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8651 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8652 | crt_file=data_files/server7_int-ca.crt \ |
| 8653 | key_file=data_files/server7.key \ |
| 8654 | exchanges=2 renegotiation=1 \ |
| 8655 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8656 | hs_timeout=10000-60000 \ |
| 8657 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8658 | "$P_CLI dtls=1 debug_level=2 \ |
| 8659 | crt_file=data_files/server8_int-ca2.crt \ |
| 8660 | key_file=data_files/server8.key \ |
| 8661 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8662 | hs_timeout=10000-60000 \ |
| 8663 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8664 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8665 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8666 | -s "found fragmented DTLS handshake message" \ |
| 8667 | -c "found fragmented DTLS handshake message" \ |
| 8668 | -C "error" |
| 8669 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8670 | # An autoreduction on the client-side might happen if the server is |
| 8671 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8672 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8673 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8674 | requires_config_enabled MBEDTLS_RSA_C |
| 8675 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8676 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8677 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8678 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8679 | requires_config_enabled MBEDTLS_AES_C |
| 8680 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8681 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8682 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8683 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8684 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8685 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8686 | crt_file=data_files/server7_int-ca.crt \ |
| 8687 | key_file=data_files/server7.key \ |
| 8688 | exchanges=2 renegotiation=1 \ |
| 8689 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8690 | hs_timeout=10000-60000 \ |
| 8691 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8692 | "$P_CLI dtls=1 debug_level=2 \ |
| 8693 | crt_file=data_files/server8_int-ca2.crt \ |
| 8694 | key_file=data_files/server8.key \ |
| 8695 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8696 | hs_timeout=10000-60000 \ |
| 8697 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8698 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8699 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8700 | -s "found fragmented DTLS handshake message" \ |
| 8701 | -c "found fragmented DTLS handshake message" \ |
| 8702 | -C "error" |
| 8703 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8704 | # An autoreduction on the client-side might happen if the server is |
| 8705 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8706 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8707 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8708 | requires_config_enabled MBEDTLS_RSA_C |
| 8709 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8710 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8711 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8712 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8713 | requires_config_enabled MBEDTLS_AES_C |
| 8714 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8715 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8716 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8717 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8718 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8719 | crt_file=data_files/server7_int-ca.crt \ |
| 8720 | key_file=data_files/server7.key \ |
| 8721 | exchanges=2 renegotiation=1 \ |
| 8722 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8723 | hs_timeout=10000-60000 \ |
| 8724 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8725 | "$P_CLI dtls=1 debug_level=2 \ |
| 8726 | crt_file=data_files/server8_int-ca2.crt \ |
| 8727 | key_file=data_files/server8.key \ |
| 8728 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8729 | hs_timeout=10000-60000 \ |
| 8730 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8731 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8732 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8733 | -s "found fragmented DTLS handshake message" \ |
| 8734 | -c "found fragmented DTLS handshake message" \ |
| 8735 | -C "error" |
| 8736 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8737 | # 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] | 8738 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8739 | requires_config_enabled MBEDTLS_RSA_C |
| 8740 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8741 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8742 | requires_config_enabled MBEDTLS_AES_C |
| 8743 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8744 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8745 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8746 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8747 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8748 | "$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] | 8749 | crt_file=data_files/server7_int-ca.crt \ |
| 8750 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8751 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8752 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8753 | crt_file=data_files/server8_int-ca2.crt \ |
| 8754 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8755 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8756 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8757 | 0 \ |
| 8758 | -s "found fragmented DTLS handshake message" \ |
| 8759 | -c "found fragmented DTLS handshake message" \ |
| 8760 | -C "error" |
| 8761 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8762 | # 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] | 8763 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8764 | requires_config_enabled MBEDTLS_RSA_C |
| 8765 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8766 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8767 | requires_config_enabled MBEDTLS_AES_C |
| 8768 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8769 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8770 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8771 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8772 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8773 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8774 | crt_file=data_files/server7_int-ca.crt \ |
| 8775 | key_file=data_files/server7.key \ |
| 8776 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8777 | "$P_CLI dtls=1 debug_level=2 \ |
| 8778 | crt_file=data_files/server8_int-ca2.crt \ |
| 8779 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8780 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8781 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8782 | 0 \ |
| 8783 | -s "found fragmented DTLS handshake message" \ |
| 8784 | -c "found fragmented DTLS handshake message" \ |
| 8785 | -C "error" |
| 8786 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8787 | # interop tests for DTLS fragmentating with reliable connection |
| 8788 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8789 | # here and below we just want to test that the we fragment in a way that |
| 8790 | # pleases other implementations, so we don't need the peer to fragment |
| 8791 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8792 | requires_config_enabled MBEDTLS_RSA_C |
| 8793 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8794 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8795 | requires_gnutls |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8796 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8797 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8798 | "$G_SRV -u" \ |
| 8799 | "$P_CLI dtls=1 debug_level=2 \ |
| 8800 | crt_file=data_files/server8_int-ca2.crt \ |
| 8801 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8802 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8803 | 0 \ |
| 8804 | -c "fragmenting handshake message" \ |
| 8805 | -C "error" |
| 8806 | |
| 8807 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8808 | requires_config_enabled MBEDTLS_RSA_C |
| 8809 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8810 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8811 | requires_gnutls |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8812 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8813 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8814 | "$G_SRV -u" \ |
| 8815 | "$P_CLI dtls=1 debug_level=2 \ |
| 8816 | crt_file=data_files/server8_int-ca2.crt \ |
| 8817 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8818 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8819 | 0 \ |
| 8820 | -c "fragmenting handshake message" \ |
| 8821 | -C "error" |
| 8822 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8823 | # We use --insecure for the GnuTLS client because it expects |
| 8824 | # the hostname / IP it connects to to be the name used in the |
| 8825 | # certificate obtained from the server. Here, however, it |
| 8826 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8827 | # as the server name in the certificate. This will make the |
| 8828 | # certifiate validation fail, but passing --insecure makes |
| 8829 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8830 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8831 | requires_config_enabled MBEDTLS_RSA_C |
| 8832 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8833 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8834 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8835 | requires_not_i686 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8836 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8837 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8838 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8839 | crt_file=data_files/server7_int-ca.crt \ |
| 8840 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8841 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8842 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8843 | 0 \ |
| 8844 | -s "fragmenting handshake message" |
| 8845 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8846 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8847 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8848 | requires_config_enabled MBEDTLS_RSA_C |
| 8849 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8850 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8851 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8852 | requires_not_i686 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8853 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8854 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8855 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8856 | crt_file=data_files/server7_int-ca.crt \ |
| 8857 | key_file=data_files/server7.key \ |
| 8858 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8859 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8860 | 0 \ |
| 8861 | -s "fragmenting handshake message" |
| 8862 | |
| 8863 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8864 | requires_config_enabled MBEDTLS_RSA_C |
| 8865 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8867 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8868 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8869 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8870 | "$P_CLI dtls=1 debug_level=2 \ |
| 8871 | crt_file=data_files/server8_int-ca2.crt \ |
| 8872 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8873 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8874 | 0 \ |
| 8875 | -c "fragmenting handshake message" \ |
| 8876 | -C "error" |
| 8877 | |
| 8878 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8879 | requires_config_enabled MBEDTLS_RSA_C |
| 8880 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8881 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8882 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8883 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8884 | "$O_SRV -dtls1 -verify 10" \ |
| 8885 | "$P_CLI dtls=1 debug_level=2 \ |
| 8886 | crt_file=data_files/server8_int-ca2.crt \ |
| 8887 | key_file=data_files/server8.key \ |
| 8888 | mtu=512 force_version=dtls1" \ |
| 8889 | 0 \ |
| 8890 | -c "fragmenting handshake message" \ |
| 8891 | -C "error" |
| 8892 | |
| 8893 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8894 | requires_config_enabled MBEDTLS_RSA_C |
| 8895 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8896 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8897 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8898 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8899 | "$P_SRV dtls=1 debug_level=2 \ |
| 8900 | crt_file=data_files/server7_int-ca.crt \ |
| 8901 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8902 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8903 | "$O_CLI -dtls1_2" \ |
| 8904 | 0 \ |
| 8905 | -s "fragmenting handshake message" |
| 8906 | |
| 8907 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8908 | requires_config_enabled MBEDTLS_RSA_C |
| 8909 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8910 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8911 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8912 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8913 | "$P_SRV dtls=1 debug_level=2 \ |
| 8914 | crt_file=data_files/server7_int-ca.crt \ |
| 8915 | key_file=data_files/server7.key \ |
| 8916 | mtu=512 force_version=dtls1" \ |
| 8917 | "$O_CLI -dtls1" \ |
| 8918 | 0 \ |
| 8919 | -s "fragmenting handshake message" |
| 8920 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8921 | # interop tests for DTLS fragmentating with unreliable connection |
| 8922 | # |
| 8923 | # again we just want to test that the we fragment in a way that |
| 8924 | # pleases other implementations, so we don't need the peer to fragment |
| 8925 | requires_gnutls_next |
| 8926 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8927 | requires_config_enabled MBEDTLS_RSA_C |
| 8928 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8929 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8930 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8931 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8932 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8933 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8934 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8935 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8936 | crt_file=data_files/server8_int-ca2.crt \ |
| 8937 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8938 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8939 | 0 \ |
| 8940 | -c "fragmenting handshake message" \ |
| 8941 | -C "error" |
| 8942 | |
| 8943 | requires_gnutls_next |
| 8944 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8945 | requires_config_enabled MBEDTLS_RSA_C |
| 8946 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8947 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8948 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8949 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8950 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8951 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8952 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8953 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8954 | crt_file=data_files/server8_int-ca2.crt \ |
| 8955 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8956 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8957 | 0 \ |
| 8958 | -c "fragmenting handshake message" \ |
| 8959 | -C "error" |
| 8960 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8961 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8962 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8963 | requires_config_enabled MBEDTLS_RSA_C |
| 8964 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8965 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8966 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8967 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8968 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 8969 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8970 | "$P_SRV dtls=1 debug_level=2 \ |
| 8971 | crt_file=data_files/server7_int-ca.crt \ |
| 8972 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8973 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8974 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8975 | 0 \ |
| 8976 | -s "fragmenting handshake message" |
| 8977 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8978 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8979 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8980 | requires_config_enabled MBEDTLS_RSA_C |
| 8981 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8982 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 8983 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8984 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8985 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 8986 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8987 | "$P_SRV dtls=1 debug_level=2 \ |
| 8988 | crt_file=data_files/server7_int-ca.crt \ |
| 8989 | key_file=data_files/server7.key \ |
| 8990 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8991 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8992 | 0 \ |
| 8993 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8994 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8995 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 8996 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8997 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8998 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8999 | ## (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] | 9000 | skip_next_test |
| 9001 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9002 | requires_config_enabled MBEDTLS_RSA_C |
| 9003 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9004 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9005 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9006 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9007 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 9008 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9009 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9010 | "$P_CLI dtls=1 debug_level=2 \ |
| 9011 | crt_file=data_files/server8_int-ca2.crt \ |
| 9012 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9013 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9014 | 0 \ |
| 9015 | -c "fragmenting handshake message" \ |
| 9016 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9017 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9018 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9019 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9020 | requires_config_enabled MBEDTLS_RSA_C |
| 9021 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9022 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9023 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9024 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9025 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 9026 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9027 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9028 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9029 | crt_file=data_files/server8_int-ca2.crt \ |
| 9030 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9031 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9032 | 0 \ |
| 9033 | -c "fragmenting handshake message" \ |
| 9034 | -C "error" |
| 9035 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9036 | skip_next_test |
| 9037 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9038 | requires_config_enabled MBEDTLS_RSA_C |
| 9039 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9040 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9041 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9042 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9043 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 9044 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9045 | "$P_SRV dtls=1 debug_level=2 \ |
| 9046 | crt_file=data_files/server7_int-ca.crt \ |
| 9047 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9048 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9049 | "$O_CLI -dtls1_2" \ |
| 9050 | 0 \ |
| 9051 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9052 | |
| 9053 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 9054 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9055 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9056 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9057 | requires_config_enabled MBEDTLS_RSA_C |
| 9058 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9059 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9060 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9061 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9062 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 9063 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9064 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9065 | crt_file=data_files/server7_int-ca.crt \ |
| 9066 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9067 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9068 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9069 | 0 \ |
| 9070 | -s "fragmenting handshake message" |
| 9071 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9072 | # Tests for DTLS-SRTP (RFC 5764) |
| 9073 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9074 | run_test "DTLS-SRTP all profiles supported" \ |
| 9075 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9076 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9077 | 0 \ |
| 9078 | -s "found use_srtp extension" \ |
| 9079 | -s "found srtp profile" \ |
| 9080 | -s "selected srtp profile" \ |
| 9081 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9082 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9083 | -c "client hello, adding use_srtp extension" \ |
| 9084 | -c "found use_srtp extension" \ |
| 9085 | -c "found srtp profile" \ |
| 9086 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9087 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9088 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9089 | -C "error" |
| 9090 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9091 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9092 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9093 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 9094 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9095 | "$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] | 9096 | 0 \ |
| 9097 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9098 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 9099 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9100 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9101 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9102 | -c "client hello, adding use_srtp extension" \ |
| 9103 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9104 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9105 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9106 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9107 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9108 | -C "error" |
| 9109 | |
| 9110 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9111 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9112 | "$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] | 9113 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9114 | 0 \ |
| 9115 | -s "found use_srtp extension" \ |
| 9116 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9117 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9118 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9119 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9120 | -c "client hello, adding use_srtp extension" \ |
| 9121 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9122 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9123 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9124 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9125 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9126 | -C "error" |
| 9127 | |
| 9128 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9129 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 9130 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9131 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9132 | 0 \ |
| 9133 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9134 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9135 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9136 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9137 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9138 | -c "client hello, adding use_srtp extension" \ |
| 9139 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9140 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9141 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9142 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9143 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9144 | -C "error" |
| 9145 | |
| 9146 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9147 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 9148 | "$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] | 9149 | "$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] | 9150 | 0 \ |
| 9151 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9152 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9153 | -S "selected srtp profile" \ |
| 9154 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9155 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9156 | -c "client hello, adding use_srtp extension" \ |
| 9157 | -C "found use_srtp extension" \ |
| 9158 | -C "found srtp profile" \ |
| 9159 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9160 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9161 | -C "error" |
| 9162 | |
| 9163 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9164 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 9165 | "$P_SRV dtls=1 debug_level=3" \ |
| 9166 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9167 | 0 \ |
| 9168 | -s "found use_srtp extension" \ |
| 9169 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9170 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9171 | -c "client hello, adding use_srtp extension" \ |
| 9172 | -C "found use_srtp extension" \ |
| 9173 | -C "found srtp profile" \ |
| 9174 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9175 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9176 | -C "error" |
| 9177 | |
| 9178 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9179 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 9180 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 9181 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9182 | 0 \ |
| 9183 | -s "found use_srtp extension" \ |
| 9184 | -s "found srtp profile" \ |
| 9185 | -s "selected srtp profile" \ |
| 9186 | -s "server hello, adding use_srtp extension" \ |
| 9187 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9188 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9189 | -c "client hello, adding use_srtp extension" \ |
| 9190 | -c "found use_srtp extension" \ |
| 9191 | -c "found srtp profile" \ |
| 9192 | -c "selected srtp profile" \ |
| 9193 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9194 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9195 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9196 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9197 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9198 | -C "error" |
| 9199 | |
| 9200 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9201 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 9202 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9203 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9204 | 0 \ |
| 9205 | -s "found use_srtp extension" \ |
| 9206 | -s "found srtp profile" \ |
| 9207 | -s "selected srtp profile" \ |
| 9208 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9209 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9210 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9211 | -S "dumping 'using mki' (8 bytes)" \ |
| 9212 | -c "client hello, adding use_srtp extension" \ |
| 9213 | -c "found use_srtp extension" \ |
| 9214 | -c "found srtp profile" \ |
| 9215 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9216 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9217 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9218 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9219 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9220 | -C "dumping 'received mki' (8 bytes)" \ |
| 9221 | -C "error" |
| 9222 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9223 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9224 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 9225 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9226 | "$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] | 9227 | 0 \ |
| 9228 | -s "found use_srtp extension" \ |
| 9229 | -s "found srtp profile" \ |
| 9230 | -s "selected srtp profile" \ |
| 9231 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9232 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9233 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9234 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 9235 | |
| 9236 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9237 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 9238 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9239 | "$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] | 9240 | 0 \ |
| 9241 | -s "found use_srtp extension" \ |
| 9242 | -s "found srtp profile" \ |
| 9243 | -s "selected srtp profile" \ |
| 9244 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9245 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9246 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9247 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9248 | |
| 9249 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9250 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 9251 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9252 | "$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] | 9253 | 0 \ |
| 9254 | -s "found use_srtp extension" \ |
| 9255 | -s "found srtp profile" \ |
| 9256 | -s "selected srtp profile" \ |
| 9257 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9258 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9259 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9260 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9261 | |
| 9262 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9263 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 9264 | "$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] | 9265 | "$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] | 9266 | 0 \ |
| 9267 | -s "found use_srtp extension" \ |
| 9268 | -s "found srtp profile" \ |
| 9269 | -s "selected srtp profile" \ |
| 9270 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9271 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9272 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9273 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9274 | |
| 9275 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9276 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 9277 | "$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] | 9278 | "$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] | 9279 | 0 \ |
| 9280 | -s "found use_srtp extension" \ |
| 9281 | -s "found srtp profile" \ |
| 9282 | -s "selected srtp profile" \ |
| 9283 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9284 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9285 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9286 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9287 | |
| 9288 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9289 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 9290 | "$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] | 9291 | "$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] | 9292 | 0 \ |
| 9293 | -s "found use_srtp extension" \ |
| 9294 | -s "found srtp profile" \ |
| 9295 | -S "selected srtp profile" \ |
| 9296 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9297 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9298 | -C "SRTP Extension negotiated, profile" |
| 9299 | |
| 9300 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9301 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 9302 | "$P_SRV dtls=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9303 | "$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] | 9304 | 0 \ |
| 9305 | -s "found use_srtp extension" \ |
| 9306 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9307 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9308 | -C "SRTP Extension negotiated, profile" |
| 9309 | |
| 9310 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9311 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9312 | "$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] | 9313 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9314 | 0 \ |
| 9315 | -c "client hello, adding use_srtp extension" \ |
| 9316 | -c "found use_srtp extension" \ |
| 9317 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9318 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9319 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9320 | -C "error" |
| 9321 | |
| 9322 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9323 | 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] | 9324 | "$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] | 9325 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9326 | 0 \ |
| 9327 | -c "client hello, adding use_srtp extension" \ |
| 9328 | -c "found use_srtp extension" \ |
| 9329 | -c "found srtp profile" \ |
| 9330 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9331 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9332 | -C "error" |
| 9333 | |
| 9334 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9335 | 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] | 9336 | "$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] | 9337 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9338 | 0 \ |
| 9339 | -c "client hello, adding use_srtp extension" \ |
| 9340 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9341 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9342 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9343 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9344 | -C "error" |
| 9345 | |
| 9346 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9347 | 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] | 9348 | "$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] | 9349 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9350 | 0 \ |
| 9351 | -c "client hello, adding use_srtp extension" \ |
| 9352 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9353 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9354 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9355 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9356 | -C "error" |
| 9357 | |
| 9358 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9359 | 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] | 9360 | "$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] | 9361 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9362 | 0 \ |
| 9363 | -c "client hello, adding use_srtp extension" \ |
| 9364 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9365 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9366 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9367 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9368 | -C "error" |
| 9369 | |
| 9370 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9371 | 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] | 9372 | "$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] | 9373 | "$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] | 9374 | 0 \ |
| 9375 | -c "client hello, adding use_srtp extension" \ |
| 9376 | -C "found use_srtp extension" \ |
| 9377 | -C "found srtp profile" \ |
| 9378 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9379 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9380 | -C "error" |
| 9381 | |
| 9382 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9383 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 9384 | "$O_SRV -dtls1" \ |
| 9385 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9386 | 0 \ |
| 9387 | -c "client hello, adding use_srtp extension" \ |
| 9388 | -C "found use_srtp extension" \ |
| 9389 | -C "found srtp profile" \ |
| 9390 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9391 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9392 | -C "error" |
| 9393 | |
| 9394 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9395 | 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] | 9396 | "$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] | 9397 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9398 | 0 \ |
| 9399 | -c "client hello, adding use_srtp extension" \ |
| 9400 | -c "found use_srtp extension" \ |
| 9401 | -c "found srtp profile" \ |
| 9402 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9403 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9404 | -c "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9405 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9406 | -C "dumping 'received mki' (8 bytes)" \ |
| 9407 | -C "error" |
| 9408 | |
| 9409 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9410 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9411 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9412 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9413 | "$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] | 9414 | 0 \ |
| 9415 | -s "found use_srtp extension" \ |
| 9416 | -s "found srtp profile" \ |
| 9417 | -s "selected srtp profile" \ |
| 9418 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9419 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9420 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 9421 | |
| 9422 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9423 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9424 | 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] | 9425 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9426 | "$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] | 9427 | 0 \ |
| 9428 | -s "found use_srtp extension" \ |
| 9429 | -s "found srtp profile" \ |
| 9430 | -s "selected srtp profile" \ |
| 9431 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9432 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9433 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 9434 | |
| 9435 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9436 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9437 | 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] | 9438 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9439 | "$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] | 9440 | 0 \ |
| 9441 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9442 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9443 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9444 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9445 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9446 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9447 | |
| 9448 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9449 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9450 | 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] | 9451 | "$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] | 9452 | "$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] | 9453 | 0 \ |
| 9454 | -s "found use_srtp extension" \ |
| 9455 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9456 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9457 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9458 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9459 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9460 | |
| 9461 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9462 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9463 | 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] | 9464 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9465 | "$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] | 9466 | 0 \ |
| 9467 | -s "found use_srtp extension" \ |
| 9468 | -s "found srtp profile" \ |
| 9469 | -s "selected srtp profile" \ |
| 9470 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9471 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9472 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9473 | |
| 9474 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9475 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9476 | 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] | 9477 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9478 | "$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] | 9479 | 0 \ |
| 9480 | -s "found use_srtp extension" \ |
| 9481 | -s "found srtp profile" \ |
| 9482 | -S "selected srtp profile" \ |
| 9483 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9484 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9485 | -C "SRTP profile:" |
| 9486 | |
| 9487 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9488 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9489 | 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] | 9490 | "$P_SRV dtls=1 debug_level=3" \ |
| 9491 | "$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] | 9492 | 0 \ |
| 9493 | -s "found use_srtp extension" \ |
| 9494 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9495 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9496 | -C "SRTP profile:" |
| 9497 | |
| 9498 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9499 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9500 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9501 | "$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" \ |
| 9502 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9503 | 0 \ |
| 9504 | -c "client hello, adding use_srtp extension" \ |
| 9505 | -c "found use_srtp extension" \ |
| 9506 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9507 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9508 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9509 | -C "error" |
| 9510 | |
| 9511 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9512 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9513 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9514 | "$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" \ |
| 9515 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9516 | 0 \ |
| 9517 | -c "client hello, adding use_srtp extension" \ |
| 9518 | -c "found use_srtp extension" \ |
| 9519 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9520 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9521 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9522 | -C "error" |
| 9523 | |
| 9524 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9525 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9526 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9527 | "$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" \ |
| 9528 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9529 | 0 \ |
| 9530 | -c "client hello, adding use_srtp extension" \ |
| 9531 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9532 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9533 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9534 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9535 | -C "error" |
| 9536 | |
| 9537 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9538 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9539 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9540 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9541 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9542 | 0 \ |
| 9543 | -c "client hello, adding use_srtp extension" \ |
| 9544 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9545 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9546 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9547 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9548 | -C "error" |
| 9549 | |
| 9550 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9551 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9552 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9553 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9554 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9555 | 0 \ |
| 9556 | -c "client hello, adding use_srtp extension" \ |
| 9557 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9558 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9559 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9560 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9561 | -C "error" |
| 9562 | |
| 9563 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9564 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9565 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9566 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9567 | "$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] | 9568 | 0 \ |
| 9569 | -c "client hello, adding use_srtp extension" \ |
| 9570 | -C "found use_srtp extension" \ |
| 9571 | -C "found srtp profile" \ |
| 9572 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9573 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9574 | -C "error" |
| 9575 | |
| 9576 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9577 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9578 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9579 | "$G_SRV -u" \ |
| 9580 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9581 | 0 \ |
| 9582 | -c "client hello, adding use_srtp extension" \ |
| 9583 | -C "found use_srtp extension" \ |
| 9584 | -C "found srtp profile" \ |
| 9585 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9586 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9587 | -C "error" |
| 9588 | |
| 9589 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9590 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9591 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9592 | "$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" \ |
| 9593 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9594 | 0 \ |
| 9595 | -c "client hello, adding use_srtp extension" \ |
| 9596 | -c "found use_srtp extension" \ |
| 9597 | -c "found srtp profile" \ |
| 9598 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9599 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9600 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9601 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9602 | -c "dumping 'received mki' (8 bytes)" \ |
| 9603 | -C "error" |
| 9604 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9605 | # Tests for specific things with "unreliable" UDP connection |
| 9606 | |
| 9607 | not_with_valgrind # spurious resend due to timeout |
| 9608 | run_test "DTLS proxy: reference" \ |
| 9609 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9610 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9611 | "$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] | 9612 | 0 \ |
| 9613 | -C "replayed record" \ |
| 9614 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9615 | -C "Buffer record from epoch" \ |
| 9616 | -S "Buffer record from epoch" \ |
| 9617 | -C "ssl_buffer_message" \ |
| 9618 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9619 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9620 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9621 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9622 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9623 | -c "HTTP/1.0 200 OK" |
| 9624 | |
| 9625 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9626 | run_test "DTLS proxy: duplicate every packet" \ |
| 9627 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9628 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9629 | "$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] | 9630 | 0 \ |
| 9631 | -c "replayed record" \ |
| 9632 | -s "replayed record" \ |
| 9633 | -c "record from another epoch" \ |
| 9634 | -s "record from another epoch" \ |
| 9635 | -S "resend" \ |
| 9636 | -s "Extra-header:" \ |
| 9637 | -c "HTTP/1.0 200 OK" |
| 9638 | |
| 9639 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9640 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9641 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9642 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9643 | 0 \ |
| 9644 | -c "replayed record" \ |
| 9645 | -S "replayed record" \ |
| 9646 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9647 | -s "record from another epoch" \ |
| 9648 | -c "resend" \ |
| 9649 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9650 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9651 | -c "HTTP/1.0 200 OK" |
| 9652 | |
| 9653 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9654 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9655 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9656 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9657 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9658 | -c "next record in same datagram" \ |
| 9659 | -s "next record in same datagram" |
| 9660 | |
| 9661 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9662 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9663 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9664 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9665 | 0 \ |
| 9666 | -c "next record in same datagram" \ |
| 9667 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9668 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9669 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9670 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9671 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9672 | "$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] | 9673 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9674 | -c "discarding invalid record (mac)" \ |
| 9675 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9676 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9677 | -c "HTTP/1.0 200 OK" \ |
| 9678 | -S "too many records with bad MAC" \ |
| 9679 | -S "Verification of the message MAC failed" |
| 9680 | |
| 9681 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9682 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9683 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9684 | "$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] | 9685 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9686 | -C "discarding invalid record (mac)" \ |
| 9687 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9688 | -S "Extra-header:" \ |
| 9689 | -C "HTTP/1.0 200 OK" \ |
| 9690 | -s "too many records with bad MAC" \ |
| 9691 | -s "Verification of the message MAC failed" |
| 9692 | |
| 9693 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9694 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9695 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9696 | "$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] | 9697 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9698 | -c "discarding invalid record (mac)" \ |
| 9699 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9700 | -s "Extra-header:" \ |
| 9701 | -c "HTTP/1.0 200 OK" \ |
| 9702 | -S "too many records with bad MAC" \ |
| 9703 | -S "Verification of the message MAC failed" |
| 9704 | |
| 9705 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9706 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9707 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9708 | "$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] | 9709 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9710 | -c "discarding invalid record (mac)" \ |
| 9711 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9712 | -s "Extra-header:" \ |
| 9713 | -c "HTTP/1.0 200 OK" \ |
| 9714 | -s "too many records with bad MAC" \ |
| 9715 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9716 | |
| 9717 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9718 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9719 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9720 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9721 | 0 \ |
| 9722 | -c "record from another epoch" \ |
| 9723 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9724 | -s "Extra-header:" \ |
| 9725 | -c "HTTP/1.0 200 OK" |
| 9726 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9727 | # Tests for reordering support with DTLS |
| 9728 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9729 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9730 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9731 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9732 | hs_timeout=2500-60000" \ |
| 9733 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9734 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9735 | 0 \ |
| 9736 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9737 | -c "Next handshake message has been buffered - load"\ |
| 9738 | -S "Buffering HS message" \ |
| 9739 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9740 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9741 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9742 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9743 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9744 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9745 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9746 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9747 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9748 | hs_timeout=2500-60000" \ |
| 9749 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9750 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9751 | 0 \ |
| 9752 | -c "Buffering HS message" \ |
| 9753 | -c "found fragmented DTLS handshake message"\ |
| 9754 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9755 | -c "Next handshake message has been buffered - load"\ |
| 9756 | -S "Buffering HS message" \ |
| 9757 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9758 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9759 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9760 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9761 | -S "Remember CCS message" |
| 9762 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9763 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9764 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9765 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9766 | # while keeping the ServerKeyExchange. |
| 9767 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 9768 | 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] | 9769 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9770 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9771 | hs_timeout=2500-60000" \ |
| 9772 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9773 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9774 | 0 \ |
| 9775 | -c "Buffering HS message" \ |
| 9776 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9777 | -C "attempt to make space by freeing buffered messages" \ |
| 9778 | -S "Buffering HS message" \ |
| 9779 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9780 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9781 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9782 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9783 | -S "Remember CCS message" |
| 9784 | |
| 9785 | # The size constraints ensure that the delayed certificate message can't |
| 9786 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9787 | # when dropping it first. |
| 9788 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9789 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 9790 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9791 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9792 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9793 | hs_timeout=2500-60000" \ |
| 9794 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9795 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9796 | 0 \ |
| 9797 | -c "Buffering HS message" \ |
| 9798 | -c "attempt to make space by freeing buffered future messages" \ |
| 9799 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9800 | -S "Buffering HS message" \ |
| 9801 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9802 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9803 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9804 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9805 | -S "Remember CCS message" |
| 9806 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9807 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 9808 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9809 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 9810 | hs_timeout=2500-60000" \ |
| 9811 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9812 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9813 | 0 \ |
| 9814 | -C "Buffering HS message" \ |
| 9815 | -C "Next handshake message has been buffered - load"\ |
| 9816 | -s "Buffering HS message" \ |
| 9817 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9818 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9819 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9820 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9821 | -S "Remember CCS message" |
| 9822 | |
| 9823 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9824 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9825 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9826 | hs_timeout=2500-60000" \ |
| 9827 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9828 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9829 | 0 \ |
| 9830 | -C "Buffering HS message" \ |
| 9831 | -C "Next handshake message has been buffered - load"\ |
| 9832 | -S "Buffering HS message" \ |
| 9833 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9834 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9835 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9836 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9837 | -S "Remember CCS message" |
| 9838 | |
| 9839 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9840 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9841 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9842 | hs_timeout=2500-60000" \ |
| 9843 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9844 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9845 | 0 \ |
| 9846 | -C "Buffering HS message" \ |
| 9847 | -C "Next handshake message has been buffered - load"\ |
| 9848 | -S "Buffering HS message" \ |
| 9849 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9850 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9851 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9852 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9853 | -s "Remember CCS message" |
| 9854 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9855 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9856 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9857 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9858 | hs_timeout=2500-60000" \ |
| 9859 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9860 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9861 | 0 \ |
| 9862 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9863 | -s "Found buffered record from current epoch - load" \ |
| 9864 | -c "Buffer record from epoch 1" \ |
| 9865 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9866 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9867 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9868 | # from the server are delayed, so that the encrypted Finished message |
| 9869 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9870 | # in afterwards, the encrypted Finished message must be freed in order |
| 9871 | # to make space for the NewSessionTicket to be reassembled. |
| 9872 | # This works only in very particular circumstances: |
| 9873 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9874 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9875 | # the encrypted Finished message. |
| 9876 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9877 | # needs to be fragmented. |
| 9878 | # - All messages sent by the server must be small enough to be either sent |
| 9879 | # without fragmentation or be reassembled within the bounds of |
| 9880 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9881 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9882 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9883 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9884 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9885 | -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] | 9886 | "$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] | 9887 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9888 | 0 \ |
| 9889 | -s "Buffer record from epoch 1" \ |
| 9890 | -s "Found buffered record from current epoch - load" \ |
| 9891 | -c "Buffer record from epoch 1" \ |
| 9892 | -C "Found buffered record from current epoch - load" \ |
| 9893 | -c "Enough space available after freeing future epoch record" |
| 9894 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9895 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9896 | |
| 9897 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9898 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9899 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9900 | "$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] | 9901 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9902 | "$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] | 9903 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9904 | 0 \ |
| 9905 | -s "Extra-header:" \ |
| 9906 | -c "HTTP/1.0 200 OK" |
| 9907 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9908 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9909 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9910 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9911 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9912 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9913 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9914 | 0 \ |
| 9915 | -s "Extra-header:" \ |
| 9916 | -c "HTTP/1.0 200 OK" |
| 9917 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9918 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9919 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9920 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9921 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9922 | "$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] | 9923 | 0 \ |
| 9924 | -s "Extra-header:" \ |
| 9925 | -c "HTTP/1.0 200 OK" |
| 9926 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9927 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9928 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9929 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9930 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9931 | "$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] | 9932 | 0 \ |
| 9933 | -s "Extra-header:" \ |
| 9934 | -c "HTTP/1.0 200 OK" |
| 9935 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9936 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9937 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9938 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9939 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9940 | "$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] | 9941 | 0 \ |
| 9942 | -s "Extra-header:" \ |
| 9943 | -c "HTTP/1.0 200 OK" |
| 9944 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9945 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9946 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9947 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9948 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9949 | "$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] | 9950 | 0 \ |
| 9951 | -s "Extra-header:" \ |
| 9952 | -c "HTTP/1.0 200 OK" |
| 9953 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9954 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9955 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9956 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9957 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 9958 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9959 | "$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] | 9960 | 0 \ |
| 9961 | -s "Extra-header:" \ |
| 9962 | -c "HTTP/1.0 200 OK" |
| 9963 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9964 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9965 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 9966 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9967 | "$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] | 9968 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9969 | "$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] | 9970 | 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] | 9971 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9972 | 0 \ |
| 9973 | -s "a session has been resumed" \ |
| 9974 | -c "a session has been resumed" \ |
| 9975 | -s "Extra-header:" \ |
| 9976 | -c "HTTP/1.0 200 OK" |
| 9977 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9978 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9979 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 9980 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9981 | "$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] | 9982 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9983 | "$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] | 9984 | 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] | 9985 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 9986 | 0 \ |
| 9987 | -s "a session has been resumed" \ |
| 9988 | -c "a session has been resumed" \ |
| 9989 | -s "Extra-header:" \ |
| 9990 | -c "HTTP/1.0 200 OK" |
| 9991 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9992 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9993 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9994 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9995 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9996 | "$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] | 9997 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9998 | "$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] | 9999 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10000 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10001 | 0 \ |
| 10002 | -c "=> renegotiate" \ |
| 10003 | -s "=> renegotiate" \ |
| 10004 | -s "Extra-header:" \ |
| 10005 | -c "HTTP/1.0 200 OK" |
| 10006 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10007 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10008 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10009 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 10010 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10011 | "$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] | 10012 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10013 | "$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] | 10014 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10015 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10016 | 0 \ |
| 10017 | -c "=> renegotiate" \ |
| 10018 | -s "=> renegotiate" \ |
| 10019 | -s "Extra-header:" \ |
| 10020 | -c "HTTP/1.0 200 OK" |
| 10021 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10022 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10023 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10024 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10025 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10026 | "$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] | 10027 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10028 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10029 | "$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] | 10030 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10031 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10032 | 0 \ |
| 10033 | -c "=> renegotiate" \ |
| 10034 | -s "=> renegotiate" \ |
| 10035 | -s "Extra-header:" \ |
| 10036 | -c "HTTP/1.0 200 OK" |
| 10037 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10038 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10039 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10040 | 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] | 10041 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10042 | "$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] | 10043 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10044 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10045 | "$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] | 10046 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10047 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10048 | 0 \ |
| 10049 | -c "=> renegotiate" \ |
| 10050 | -s "=> renegotiate" \ |
| 10051 | -s "Extra-header:" \ |
| 10052 | -c "HTTP/1.0 200 OK" |
| 10053 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10054 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 10055 | ## all versions installed on the CI machines), reported here: |
| 10056 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 10057 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 10058 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 10059 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10060 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10061 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10062 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10063 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10064 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10065 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10066 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10067 | -c "HTTP/1.0 200 OK" |
| 10068 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10069 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10070 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10071 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10072 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 10073 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10074 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10075 | "$P_CLI dgram_packing=0 dtls=1 hs_timeout=500-60000 tickets=0" \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10076 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10077 | -c "HTTP/1.0 200 OK" |
| 10078 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10079 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10080 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10081 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10082 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 10083 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10084 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10085 | "$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] | 10086 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10087 | -c "HTTP/1.0 200 OK" |
| 10088 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 10089 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10090 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10091 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10092 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 10093 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 10094 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10095 | "$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] | 10096 | 0 \ |
| 10097 | -s "Extra-header:" \ |
| 10098 | -c "Extra-header:" |
| 10099 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10100 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10101 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10102 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10103 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 10104 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10105 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10106 | "$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] | 10107 | 0 \ |
| 10108 | -s "Extra-header:" \ |
| 10109 | -c "Extra-header:" |
| 10110 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10111 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10112 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10113 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10114 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 10115 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10116 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10117 | "$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] | 10118 | 0 \ |
| 10119 | -s "Extra-header:" \ |
| 10120 | -c "Extra-header:" |
| 10121 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10122 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 10123 | run_test "export keys functionality" \ |
| 10124 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 10125 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 10126 | 0 \ |
| 10127 | -s "exported maclen is " \ |
| 10128 | -s "exported keylen is " \ |
| 10129 | -s "exported ivlen is " \ |
| 10130 | -c "exported maclen is " \ |
| 10131 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 10132 | -c "exported ivlen is " \ |
| 10133 | -c "EAP-TLS key material is:"\ |
| 10134 | -s "EAP-TLS key material is:"\ |
| 10135 | -c "EAP-TLS IV is:" \ |
| 10136 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10137 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10138 | # Test heap memory usage after handshake |
| 10139 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 10140 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 10141 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10142 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10143 | run_tests_memory_after_hanshake |
| 10144 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 10145 | # Final report |
| 10146 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10147 | echo "------------------------------------------------------------------------" |
| 10148 | |
| 10149 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10150 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10151 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10152 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10153 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 10154 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 10155 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10156 | |
| 10157 | exit $FAILS |