Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 |
| 7 | # |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 9 | # not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 20 | # Purpose |
| 21 | # |
| 22 | # Executes tests to prove various TLS/SSL options and extensions. |
| 23 | # |
| 24 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 25 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 26 | # (session resumption from cache or ticket, renego, etc). |
| 27 | # |
| 28 | # The tests assume a build with default options, with exceptions expressed |
| 29 | # with a dependency. The tests focus on functionality and do not consider |
| 30 | # performance. |
| 31 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 32 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 33 | set -u |
| 34 | |
Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 35 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 36 | # where it may output seemingly unlimited length error logs. |
| 37 | ulimit -f 20971520 |
| 38 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 39 | ORIGINAL_PWD=$PWD |
| 40 | if ! cd "$(dirname "$0")"; then |
| 41 | exit 125 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 42 | fi |
| 43 | |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 44 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 45 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 46 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 47 | : ${P_PXY:=../programs/test/udp_proxy} |
Jerry Yu | bbfa1d8 | 2021-12-06 16:52:57 +0800 | [diff] [blame] | 48 | : ${P_QUERY:=../programs/test/query_compile_time_config} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 49 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 50 | : ${GNUTLS_CLI:=gnutls-cli} |
| 51 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 52 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 53 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 54 | guess_config_name() { |
| 55 | if git diff --quiet ../include/mbedtls/config.h 2>/dev/null; then |
| 56 | echo "default" |
| 57 | else |
| 58 | echo "unknown" |
| 59 | fi |
| 60 | } |
| 61 | : ${MBEDTLS_TEST_OUTCOME_FILE=} |
| 62 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} |
| 63 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} |
| 64 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 65 | O_SRV="$OPENSSL_CMD s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 66 | O_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_CMD s_client" |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 67 | G_SRV="$GNUTLS_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 68 | G_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_CLI --x509cafile data_files/test-ca_cat12.crt" |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 69 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 70 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 71 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 72 | |
| 73 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 74 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 75 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 76 | else |
| 77 | O_LEGACY_SRV=false |
| 78 | O_LEGACY_CLI=false |
| 79 | fi |
| 80 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 81 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 82 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 83 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 84 | else |
| 85 | O_NEXT_SRV=false |
| 86 | O_NEXT_CLI=false |
| 87 | fi |
| 88 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 89 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 90 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 91 | else |
| 92 | G_NEXT_SRV=false |
| 93 | fi |
| 94 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 95 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 96 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 97 | else |
| 98 | G_NEXT_CLI=false |
| 99 | fi |
| 100 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 101 | TESTS=0 |
| 102 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 103 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 104 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 105 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 106 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 107 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 108 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 109 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 110 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 111 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 112 | RUN_TEST_NUMBER='' |
| 113 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 114 | PRESERVE_LOGS=0 |
| 115 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 116 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 117 | # port which is this plus 10000. Each port number may be independently |
| 118 | # overridden by a command line option. |
| 119 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 120 | PXY_PORT=$((SRV_PORT + 10000)) |
| 121 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 122 | print_usage() { |
| 123 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 124 | printf " -h|--help\tPrint this help.\n" |
| 125 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 126 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 127 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 128 | printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 129 | printf " -s|--show-numbers\tShow test numbers in front of test names\n" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 130 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 131 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 132 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 133 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 134 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 135 | printf " --seed \tInteger seed value to use for this test run\n" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | get_options() { |
| 139 | while [ $# -gt 0 ]; do |
| 140 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 141 | -f|--filter) |
| 142 | shift; FILTER=$1 |
| 143 | ;; |
| 144 | -e|--exclude) |
| 145 | shift; EXCLUDE=$1 |
| 146 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 147 | -m|--memcheck) |
| 148 | MEMCHECK=1 |
| 149 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 150 | -n|--number) |
| 151 | shift; RUN_TEST_NUMBER=$1 |
| 152 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 153 | -s|--show-numbers) |
| 154 | SHOW_TEST_NUMBER=1 |
| 155 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 156 | -p|--preserve-logs) |
| 157 | PRESERVE_LOGS=1 |
| 158 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 159 | --port) |
| 160 | shift; SRV_PORT=$1 |
| 161 | ;; |
| 162 | --proxy-port) |
| 163 | shift; PXY_PORT=$1 |
| 164 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 165 | --seed) |
| 166 | shift; SEED="$1" |
| 167 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 168 | -h|--help) |
| 169 | print_usage |
| 170 | exit 0 |
| 171 | ;; |
| 172 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 173 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 174 | print_usage |
| 175 | exit 1 |
| 176 | ;; |
| 177 | esac |
| 178 | shift |
| 179 | done |
| 180 | } |
| 181 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 182 | # Make the outcome file path relative to the original directory, not |
| 183 | # to .../tests |
| 184 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 185 | [!/]*) |
| 186 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 187 | ;; |
| 188 | esac |
| 189 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 190 | # Read boolean configuration options from config.h for easy and quick |
| 191 | # testing. Skip non-boolean options (with something other than spaces |
| 192 | # and a comment after "#define SYMBOL"). The variable contains a |
| 193 | # space-separated list of symbols. |
Jerry Yu | cf080ce | 2021-12-10 18:45:51 +0800 | [diff] [blame] | 194 | CONFIGS_ENABLED=" $(echo `$P_QUERY -l` )" |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 195 | # Skip next test; use this macro to skip tests which are legitimate |
| 196 | # in theory and expected to be re-introduced at some point, but |
| 197 | # aren't expected to succeed at the moment due to problems outside |
| 198 | # our control (such as bugs in other TLS implementations). |
| 199 | skip_next_test() { |
| 200 | SKIP_NEXT="YES" |
| 201 | } |
| 202 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 203 | # skip next test if the flag is not enabled in config.h |
| 204 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 205 | case $CONFIGS_ENABLED in |
Jerry Yu | 969c01a | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 206 | *" $1"[\ =]*) :;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 207 | *) SKIP_NEXT="YES";; |
| 208 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 209 | } |
| 210 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 211 | # skip next test if the flag is enabled in config.h |
| 212 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 213 | case $CONFIGS_ENABLED in |
Jerry Yu | 969c01a | 2021-12-10 20:29:02 +0800 | [diff] [blame] | 214 | *" $1"[\ =]*) SKIP_NEXT="YES";; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 215 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 216 | } |
| 217 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 218 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 219 | # This function uses the query_config command line option to query the |
| 220 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 221 | # program. The command will always return a success value if the |
| 222 | # configuration is defined and the value will be printed to stdout. |
| 223 | # |
| 224 | # Note that if the configuration is not defined or is defined to nothing, |
| 225 | # the output of this function will be an empty string. |
| 226 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 230 | VAL="$( get_config_value_or_default "$1" )" |
| 231 | if [ -z "$VAL" ]; then |
| 232 | # Should never happen |
| 233 | echo "Mbed TLS configuration $1 is not defined" |
| 234 | exit 1 |
| 235 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 236 | SKIP_NEXT="YES" |
| 237 | fi |
| 238 | } |
| 239 | |
| 240 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 241 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 242 | if [ -z "$VAL" ]; then |
| 243 | # Should never happen |
| 244 | echo "Mbed TLS configuration $1 is not defined" |
| 245 | exit 1 |
| 246 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 247 | SKIP_NEXT="YES" |
| 248 | fi |
| 249 | } |
| 250 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 251 | requires_config_value_equals() { |
| 252 | VAL=$( get_config_value_or_default "$1" ) |
| 253 | if [ -z "$VAL" ]; then |
| 254 | # Should never happen |
| 255 | echo "Mbed TLS configuration $1 is not defined" |
| 256 | exit 1 |
| 257 | elif [ "$VAL" -ne "$2" ]; then |
| 258 | SKIP_NEXT="YES" |
| 259 | fi |
| 260 | } |
| 261 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 262 | # Space-separated list of ciphersuites supported by this build of |
| 263 | # Mbed TLS. |
| 264 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
| 265 | grep TLS- | |
| 266 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 267 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 268 | case $P_CIPHERSUITES in |
| 269 | *" $1 "*) :;; |
| 270 | *) SKIP_NEXT="YES";; |
| 271 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 272 | } |
| 273 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 274 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 275 | # If CMD (call to a TLS client or server program) requires a specific |
| 276 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
| 277 | # enabled. As an exception, do run the test case if it expects a ciphersuite |
| 278 | # mismatch. |
| 279 | maybe_requires_ciphersuite_enabled() { |
| 280 | case "$1" in |
| 281 | *\ force_ciphersuite=*) :;; |
| 282 | *) return;; # No specific required ciphersuite |
| 283 | esac |
| 284 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 285 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 286 | shift |
| 287 | |
| 288 | case "$*" in |
| 289 | *"-s SSL - The server has no ciphersuites in common"*) |
| 290 | # This test case expects a ciphersuite mismatch, so it doesn't |
| 291 | # require the ciphersuite to be enabled. |
| 292 | ;; |
| 293 | *) |
| 294 | requires_ciphersuite_enabled "$ciphersuite" |
| 295 | ;; |
| 296 | esac |
| 297 | |
| 298 | unset ciphersuite |
| 299 | } |
| 300 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 301 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 302 | requires_openssl_with_fallback_scsv() { |
| 303 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 304 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 305 | then |
| 306 | OPENSSL_HAS_FBSCSV="YES" |
| 307 | else |
| 308 | OPENSSL_HAS_FBSCSV="NO" |
| 309 | fi |
| 310 | fi |
| 311 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 312 | SKIP_NEXT="YES" |
| 313 | fi |
| 314 | } |
| 315 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 316 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 317 | requires_max_content_len() { |
| 318 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 319 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 320 | } |
| 321 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 322 | # skip next test if GnuTLS isn't available |
| 323 | requires_gnutls() { |
| 324 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 325 | 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] | 326 | GNUTLS_AVAILABLE="YES" |
| 327 | else |
| 328 | GNUTLS_AVAILABLE="NO" |
| 329 | fi |
| 330 | fi |
| 331 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 332 | SKIP_NEXT="YES" |
| 333 | fi |
| 334 | } |
| 335 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 336 | # skip next test if GnuTLS-next isn't available |
| 337 | requires_gnutls_next() { |
| 338 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 339 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 340 | GNUTLS_NEXT_AVAILABLE="YES" |
| 341 | else |
| 342 | GNUTLS_NEXT_AVAILABLE="NO" |
| 343 | fi |
| 344 | fi |
| 345 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 346 | SKIP_NEXT="YES" |
| 347 | fi |
| 348 | } |
| 349 | |
| 350 | # skip next test if OpenSSL-legacy isn't available |
| 351 | requires_openssl_legacy() { |
| 352 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 353 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 354 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 355 | else |
| 356 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 357 | fi |
| 358 | fi |
| 359 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 360 | SKIP_NEXT="YES" |
| 361 | fi |
| 362 | } |
| 363 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 364 | requires_openssl_next() { |
| 365 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 366 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 367 | OPENSSL_NEXT_AVAILABLE="YES" |
| 368 | else |
| 369 | OPENSSL_NEXT_AVAILABLE="NO" |
| 370 | fi |
| 371 | fi |
| 372 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 373 | SKIP_NEXT="YES" |
| 374 | fi |
| 375 | } |
| 376 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 377 | # skip next test if IPv6 isn't available on this host |
| 378 | requires_ipv6() { |
| 379 | if [ -z "${HAS_IPV6:-}" ]; then |
| 380 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 381 | SRV_PID=$! |
| 382 | sleep 1 |
| 383 | kill $SRV_PID >/dev/null 2>&1 |
| 384 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 385 | HAS_IPV6="NO" |
| 386 | else |
| 387 | HAS_IPV6="YES" |
| 388 | fi |
| 389 | rm -r $SRV_OUT |
| 390 | fi |
| 391 | |
| 392 | if [ "$HAS_IPV6" = "NO" ]; then |
| 393 | SKIP_NEXT="YES" |
| 394 | fi |
| 395 | } |
| 396 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 397 | # skip next test if it's i686 or uname is not available |
| 398 | requires_not_i686() { |
| 399 | if [ -z "${IS_I686:-}" ]; then |
| 400 | IS_I686="YES" |
| 401 | if which "uname" >/dev/null 2>&1; then |
| 402 | if [ -z "$(uname -a | grep i686)" ]; then |
| 403 | IS_I686="NO" |
| 404 | fi |
| 405 | fi |
| 406 | fi |
| 407 | if [ "$IS_I686" = "YES" ]; then |
| 408 | SKIP_NEXT="YES" |
| 409 | fi |
| 410 | } |
| 411 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 412 | # Calculate the input & output maximum content lengths set in the config |
Yuto Takano | ab9e4333 | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 413 | MAX_CONTENT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_MAX_CONTENT_LEN" ) |
| 414 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 415 | 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] | 416 | |
Yuto Takano | 18ddccc | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 417 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 418 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 419 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 420 | fi |
| 421 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 422 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 423 | fi |
| 424 | |
| 425 | # skip the next test if the SSL output buffer is less than 16KB |
| 426 | requires_full_size_output_buffer() { |
| 427 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 428 | SKIP_NEXT="YES" |
| 429 | fi |
| 430 | } |
| 431 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 432 | # skip the next test if valgrind is in use |
| 433 | not_with_valgrind() { |
| 434 | if [ "$MEMCHECK" -gt 0 ]; then |
| 435 | SKIP_NEXT="YES" |
| 436 | fi |
| 437 | } |
| 438 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 439 | # skip the next test if valgrind is NOT in use |
| 440 | only_with_valgrind() { |
| 441 | if [ "$MEMCHECK" -eq 0 ]; then |
| 442 | SKIP_NEXT="YES" |
| 443 | fi |
| 444 | } |
| 445 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 446 | # 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] | 447 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 448 | CLI_DELAY_FACTOR=$1 |
| 449 | } |
| 450 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 451 | # wait for the given seconds after the client finished in the next test |
| 452 | server_needs_more_time() { |
| 453 | SRV_DELAY_SECONDS=$1 |
| 454 | } |
| 455 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 456 | # print_name <name> |
| 457 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 458 | TESTS=$(( $TESTS + 1 )) |
| 459 | LINE="" |
| 460 | |
| 461 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 462 | LINE="$TESTS " |
| 463 | fi |
| 464 | |
| 465 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 466 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 467 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 468 | for i in `seq 1 $LEN`; do printf '.'; done |
| 469 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 470 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 471 | } |
| 472 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 473 | # record_outcome <outcome> [<failure-reason>] |
| 474 | # The test name must be in $NAME. |
| 475 | record_outcome() { |
| 476 | echo "$1" |
| 477 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 478 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 479 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 480 | "ssl-opt" "$NAME" \ |
| 481 | "$1" "${2-}" \ |
| 482 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 483 | fi |
| 484 | } |
| 485 | |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 486 | # True if the presence of the given pattern in a log definitely indicates |
| 487 | # that the test has failed. False if the presence is inconclusive. |
| 488 | # |
| 489 | # Inputs: |
| 490 | # * $1: pattern found in the logs |
| 491 | # * $TIMES_LEFT: >0 if retrying is an option |
| 492 | # |
| 493 | # Outputs: |
| 494 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 495 | # unchanged otherwise. |
| 496 | # * Return value: 1 if the pattern is inconclusive, |
| 497 | # 0 if the failure is definitive. |
| 498 | log_pattern_presence_is_conclusive() { |
| 499 | # If we've run out of attempts, then don't retry no matter what. |
| 500 | if [ $TIMES_LEFT -eq 0 ]; then |
| 501 | return 0 |
| 502 | fi |
| 503 | case $1 in |
| 504 | "resend") |
| 505 | # An undesired resend may have been caused by the OS dropping or |
| 506 | # delaying a packet at an inopportune time. |
| 507 | outcome="RETRY(resend)" |
| 508 | return 1;; |
| 509 | esac |
| 510 | } |
| 511 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 512 | # fail <message> |
| 513 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 514 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 515 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 516 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 517 | mv $SRV_OUT o-srv-${TESTS}.log |
| 518 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 519 | if [ -n "$PXY_CMD" ]; then |
| 520 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 521 | fi |
| 522 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 523 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 524 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 525 | echo " ! server output:" |
| 526 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 527 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 528 | echo " ! client output:" |
| 529 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 530 | if [ -n "$PXY_CMD" ]; then |
| 531 | echo " ! ========================================================" |
| 532 | echo " ! proxy output:" |
| 533 | cat o-pxy-${TESTS}.log |
| 534 | fi |
| 535 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 536 | fi |
| 537 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 538 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 539 | } |
| 540 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 541 | # is_polar <cmd_line> |
| 542 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 543 | case "$1" in |
| 544 | *ssl_client2*) true;; |
| 545 | *ssl_server2*) true;; |
| 546 | *) false;; |
| 547 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 548 | } |
| 549 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 550 | # openssl s_server doesn't have -www with DTLS |
| 551 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 552 | case "$SRV_CMD" in |
| 553 | *s_server*-dtls*) |
| 554 | NEEDS_INPUT=1 |
| 555 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 556 | *) NEEDS_INPUT=0;; |
| 557 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 558 | } |
| 559 | |
| 560 | # provide input to commands that need it |
| 561 | provide_input() { |
| 562 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 563 | return |
| 564 | fi |
| 565 | |
| 566 | while true; do |
| 567 | echo "HTTP/1.0 200 OK" |
| 568 | sleep 1 |
| 569 | done |
| 570 | } |
| 571 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 572 | # has_mem_err <log_file_name> |
| 573 | has_mem_err() { |
| 574 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 575 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 576 | then |
| 577 | return 1 # false: does not have errors |
| 578 | else |
| 579 | return 0 # true: has errors |
| 580 | fi |
| 581 | } |
| 582 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 583 | # 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] | 584 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 585 | wait_app_start() { |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 586 | newline=' |
| 587 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 588 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 589 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 590 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 591 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 592 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 593 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 594 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 6cd97ce | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 595 | while true; do |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 596 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p) |
| 597 | # When we use a proxy, it will be listening on the same port we |
| 598 | # are checking for as well as the server and lsof will list both. |
| 599 | # If multiple PIDs are returned, each one will be on a separate |
| 600 | # line, each prepended with 'p'. |
| 601 | case ${newline}${SERVER_PIDS}${newline} in |
| 602 | *${newline}p${2}${newline}*) break;; |
| 603 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 604 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 605 | echo "$3 START TIMEOUT" |
| 606 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 607 | break |
| 608 | fi |
| 609 | # Linux and *BSD support decimal arguments to sleep. On other |
| 610 | # OSes this may be a tight loop. |
| 611 | sleep 0.1 2>/dev/null || true |
| 612 | done |
| 613 | } |
| 614 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 615 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 616 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 617 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 618 | } |
| 619 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 620 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 621 | # Wait for server process $2 to be listening on port $1. |
| 622 | wait_server_start() { |
| 623 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 624 | } |
| 625 | |
| 626 | # Wait for proxy process $2 to be listening on port $1. |
| 627 | wait_proxy_start() { |
| 628 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 629 | } |
| 630 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 631 | # 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] | 632 | # 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] | 633 | # acceptable bounds |
| 634 | check_server_hello_time() { |
| 635 | # 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] | 636 | 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] | 637 | # Get the Unix timestamp for now |
| 638 | CUR_TIME=$(date +'%s') |
| 639 | THRESHOLD_IN_SECS=300 |
| 640 | |
| 641 | # Check if the ServerHello time was printed |
| 642 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 643 | return 1 |
| 644 | fi |
| 645 | |
| 646 | # Check the time in ServerHello is within acceptable bounds |
| 647 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 648 | # The time in ServerHello is at least 5 minutes before now |
| 649 | return 1 |
| 650 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 651 | # 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] | 652 | return 1 |
| 653 | else |
| 654 | return 0 |
| 655 | fi |
| 656 | } |
| 657 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 658 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 659 | handshake_memory_get() { |
| 660 | OUTPUT_VARIABLE="$1" |
| 661 | OUTPUT_FILE="$2" |
| 662 | |
| 663 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 664 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 665 | |
| 666 | # Check if memory usage was read |
| 667 | if [ -z "$MEM_USAGE" ]; then |
| 668 | echo "Error: Can not read the value of handshake memory usage" |
| 669 | return 1 |
| 670 | else |
| 671 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 672 | return 0 |
| 673 | fi |
| 674 | } |
| 675 | |
| 676 | # Get handshake memory usage from server or client output and check if this value |
| 677 | # is not higher than the maximum given by the first argument |
| 678 | handshake_memory_check() { |
| 679 | MAX_MEMORY="$1" |
| 680 | OUTPUT_FILE="$2" |
| 681 | |
| 682 | # Get memory usage |
| 683 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 684 | return 1 |
| 685 | fi |
| 686 | |
| 687 | # Check if memory usage is below max value |
| 688 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 689 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 690 | "but should be below $MAX_MEMORY bytes" |
| 691 | return 1 |
| 692 | else |
| 693 | return 0 |
| 694 | fi |
| 695 | } |
| 696 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 697 | # wait for client to terminate and set CLI_EXIT |
| 698 | # must be called right after starting the client |
| 699 | wait_client_done() { |
| 700 | CLI_PID=$! |
| 701 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 702 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 703 | CLI_DELAY_FACTOR=1 |
| 704 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 705 | ( 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] | 706 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 707 | |
| 708 | wait $CLI_PID |
| 709 | CLI_EXIT=$? |
| 710 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 711 | kill $DOG_PID >/dev/null 2>&1 |
| 712 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 713 | |
| 714 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 715 | |
| 716 | sleep $SRV_DELAY_SECONDS |
| 717 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 718 | } |
| 719 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 720 | # check if the given command uses dtls and sets global variable DTLS |
| 721 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 722 | case "$1" in |
Paul Elliott | 405fccc | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 723 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 724 | *) DTLS=0;; |
| 725 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 726 | } |
| 727 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 728 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 729 | is_gnutls() { |
| 730 | case "$1" in |
| 731 | *gnutls-cli*) |
| 732 | CMD_IS_GNUTLS=1 |
| 733 | ;; |
| 734 | *gnutls-serv*) |
| 735 | CMD_IS_GNUTLS=1 |
| 736 | ;; |
| 737 | *) |
| 738 | CMD_IS_GNUTLS=0 |
| 739 | ;; |
| 740 | esac |
| 741 | } |
| 742 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 743 | # Compare file content |
| 744 | # Usage: find_in_both pattern file1 file2 |
| 745 | # extract from file1 the first line matching the pattern |
| 746 | # check in file2 that the same line can be found |
| 747 | find_in_both() { |
| 748 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 749 | if [ -z "$srv_pattern" ]; then |
| 750 | return 1; |
| 751 | fi |
| 752 | |
| 753 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 754 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 755 | else |
| 756 | return 1; |
| 757 | fi |
| 758 | } |
| 759 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 760 | # Analyze the commands that will be used in a test. |
| 761 | # |
| 762 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 763 | # extra arguments or go through wrappers. |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 764 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 765 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 766 | # 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] | 767 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 768 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 769 | case " $SRV_CMD " in |
| 770 | *' server_addr=::1 '*) |
| 771 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 772 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 773 | fi |
| 774 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 775 | # update CMD_IS_GNUTLS variable |
| 776 | is_gnutls "$SRV_CMD" |
| 777 | |
| 778 | # if the server uses gnutls but doesn't set priority, explicitly |
| 779 | # set the default priority |
| 780 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 781 | case "$SRV_CMD" in |
| 782 | *--priority*) :;; |
| 783 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 784 | esac |
| 785 | fi |
| 786 | |
| 787 | # update CMD_IS_GNUTLS variable |
| 788 | is_gnutls "$CLI_CMD" |
| 789 | |
| 790 | # if the client uses gnutls but doesn't set priority, explicitly |
| 791 | # set the default priority |
| 792 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 793 | case "$CLI_CMD" in |
| 794 | *--priority*) :;; |
| 795 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 796 | esac |
| 797 | fi |
| 798 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 799 | # fix client port |
| 800 | if [ -n "$PXY_CMD" ]; then |
| 801 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 802 | else |
| 803 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 804 | fi |
| 805 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 806 | # prepend valgrind to our commands if active |
| 807 | if [ "$MEMCHECK" -gt 0 ]; then |
| 808 | if is_polar "$SRV_CMD"; then |
| 809 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 810 | fi |
| 811 | if is_polar "$CLI_CMD"; then |
| 812 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 813 | fi |
| 814 | fi |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 815 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 816 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 817 | # Check for failure conditions after a test case. |
| 818 | # |
| 819 | # Inputs from run_test: |
| 820 | # * positional parameters: test options (see run_test documentation) |
| 821 | # * $CLI_EXIT: client return code |
| 822 | # * $CLI_EXPECT: expected client return code |
| 823 | # * $SRV_RET: server return code |
| 824 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 825 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 826 | # |
| 827 | # Outputs: |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 828 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 829 | check_test_failure() { |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 830 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 831 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 832 | if [ $TIMES_LEFT -gt 0 ] && |
| 833 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 834 | then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 835 | outcome="RETRY(client-timeout)" |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 836 | return |
| 837 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 838 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 839 | # 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] | 840 | # (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] | 841 | # expected client exit to incorrectly succeed in case of catastrophic |
| 842 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 843 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 844 | 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] | 845 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 846 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 847 | return |
| 848 | fi |
| 849 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 850 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 851 | 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] | 852 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 853 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 854 | return |
| 855 | fi |
| 856 | fi |
| 857 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 858 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 859 | # exit with status 0 when interrupted by a signal, and we don't really |
| 860 | # care anyway), in case e.g. the server reports a memory leak. |
| 861 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 862 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 863 | return |
| 864 | fi |
| 865 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 866 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 867 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 868 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 869 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 870 | 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] | 871 | return |
| 872 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 873 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 874 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 875 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 876 | # 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] | 877 | while [ $# -gt 0 ] |
| 878 | do |
| 879 | case $1 in |
| 880 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 881 | 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] | 882 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 883 | return |
| 884 | fi |
| 885 | ;; |
| 886 | |
| 887 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 888 | 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] | 889 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 890 | return |
| 891 | fi |
| 892 | ;; |
| 893 | |
| 894 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 895 | 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] | 896 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 897 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 898 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 899 | return |
| 900 | fi |
| 901 | ;; |
| 902 | |
| 903 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 904 | 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] | 905 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 906 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 907 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 908 | return |
| 909 | fi |
| 910 | ;; |
| 911 | |
| 912 | # The filtering in the following two options (-u and -U) do the following |
| 913 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 914 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 915 | # - keep one of each non-unique line |
| 916 | # - count how many lines remain |
| 917 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 918 | # if there were no duplicates. |
| 919 | "-U") |
| 920 | 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 |
| 921 | fail "lines following pattern '$2' must be unique in Server output" |
| 922 | return |
| 923 | fi |
| 924 | ;; |
| 925 | |
| 926 | "-u") |
| 927 | 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 |
| 928 | 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] | 929 | return |
| 930 | fi |
| 931 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 932 | "-F") |
| 933 | if ! $2 "$SRV_OUT"; then |
| 934 | fail "function call to '$2' failed on Server output" |
| 935 | return |
| 936 | fi |
| 937 | ;; |
| 938 | "-f") |
| 939 | if ! $2 "$CLI_OUT"; then |
| 940 | fail "function call to '$2' failed on Client output" |
| 941 | return |
| 942 | fi |
| 943 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 944 | "-g") |
| 945 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 946 | fail "function call to '$2' failed on Server and Client output" |
| 947 | return |
| 948 | fi |
| 949 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 950 | |
| 951 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 952 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 953 | exit 1 |
| 954 | esac |
| 955 | shift 2 |
| 956 | done |
| 957 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 958 | # check valgrind's results |
| 959 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 960 | 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] | 961 | fail "Server has memory errors" |
| 962 | return |
| 963 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 964 | 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] | 965 | fail "Client has memory errors" |
| 966 | return |
| 967 | fi |
| 968 | fi |
| 969 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 970 | # if we're here, everything is ok |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 971 | outcome=PASS |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 972 | } |
| 973 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 974 | # Run the current test case: start the server and if applicable the proxy, run |
| 975 | # the client, wait for all processes to finish or time out. |
| 976 | # |
| 977 | # Inputs: |
| 978 | # * $NAME: test case name |
| 979 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 980 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 981 | # |
| 982 | # Outputs: |
| 983 | # * $CLI_EXIT: client return code |
| 984 | # * $SRV_RET: server return code |
| 985 | do_run_test_once() { |
| 986 | # run the commands |
| 987 | if [ -n "$PXY_CMD" ]; then |
| 988 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 989 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 990 | PXY_PID=$! |
| 991 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 992 | fi |
| 993 | |
| 994 | check_osrv_dtls |
| 995 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 996 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 997 | SRV_PID=$! |
| 998 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 999 | |
| 1000 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1001 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1002 | wait_client_done |
| 1003 | |
| 1004 | sleep 0.05 |
| 1005 | |
| 1006 | # terminate the server (and the proxy) |
| 1007 | kill $SRV_PID |
| 1008 | wait $SRV_PID |
| 1009 | SRV_RET=$? |
| 1010 | |
| 1011 | if [ -n "$PXY_CMD" ]; then |
| 1012 | kill $PXY_PID >/dev/null 2>&1 |
| 1013 | wait $PXY_PID |
| 1014 | fi |
| 1015 | } |
| 1016 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1017 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1018 | # Options: -s pattern pattern that must be present in server output |
| 1019 | # -c pattern pattern that must be present in client output |
| 1020 | # -u pattern lines after pattern must be unique in client output |
| 1021 | # -f call shell function on client output |
| 1022 | # -S pattern pattern that must be absent in server output |
| 1023 | # -C pattern pattern that must be absent in client output |
| 1024 | # -U pattern lines after pattern must be unique in server output |
| 1025 | # -F call shell function on server output |
| 1026 | # -g call shell function on server and client output |
| 1027 | run_test() { |
| 1028 | NAME="$1" |
| 1029 | shift 1 |
| 1030 | |
| 1031 | if is_excluded "$NAME"; then |
| 1032 | SKIP_NEXT="NO" |
| 1033 | # There was no request to run the test, so don't record its outcome. |
| 1034 | return |
| 1035 | fi |
| 1036 | |
| 1037 | print_name "$NAME" |
| 1038 | |
| 1039 | # Do we only run numbered tests? |
| 1040 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1041 | case ",$RUN_TEST_NUMBER," in |
| 1042 | *",$TESTS,"*) :;; |
| 1043 | *) SKIP_NEXT="YES";; |
| 1044 | esac |
| 1045 | fi |
| 1046 | |
| 1047 | # does this test use a proxy? |
| 1048 | if [ "X$1" = "X-p" ]; then |
| 1049 | PXY_CMD="$2" |
| 1050 | shift 2 |
| 1051 | else |
| 1052 | PXY_CMD="" |
| 1053 | fi |
| 1054 | |
| 1055 | # get commands and client output |
| 1056 | SRV_CMD="$1" |
| 1057 | CLI_CMD="$2" |
| 1058 | CLI_EXPECT="$3" |
| 1059 | shift 3 |
| 1060 | |
| 1061 | # Check if test uses files |
| 1062 | case "$SRV_CMD $CLI_CMD" in |
| 1063 | *data_files/*) |
| 1064 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1065 | esac |
| 1066 | |
Gilles Peskine | e5f4958 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1067 | # Check if the test uses DTLS. |
| 1068 | detect_dtls "$SRV_CMD" |
| 1069 | if [ "$DTLS" -eq 1 ]; then |
| 1070 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1071 | fi |
| 1072 | |
Gilles Peskine | 4502671 | 2022-02-25 19:47:04 +0100 | [diff] [blame] | 1073 | # Check more TLS protocol features. |
| 1074 | case "$SRV_CMD $CLI_CMD" in |
| 1075 | *[-_\ =]tickets=[^0]*) |
| 1076 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 1077 | esac |
| 1078 | case "$SRV_CMD $CLI_CMD" in |
| 1079 | *[-_\ =]alpn=*) |
| 1080 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 1081 | esac |
| 1082 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1083 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1084 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1085 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1086 | |
| 1087 | # should we skip? |
| 1088 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1089 | SKIP_NEXT="NO" |
| 1090 | record_outcome "SKIP" |
| 1091 | SKIPS=$(( $SKIPS + 1 )) |
| 1092 | return |
| 1093 | fi |
| 1094 | |
| 1095 | analyze_test_commands "$@" |
| 1096 | |
Andrzej Kurek | 363553b | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1097 | # One regular run and two retries |
| 1098 | TIMES_LEFT=3 |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1099 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1100 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1101 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1102 | do_run_test_once |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1103 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1104 | check_test_failure "$@" |
| 1105 | case $outcome in |
| 1106 | PASS) break;; |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1107 | RETRY*) printf "$outcome ";; |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1108 | FAIL) return;; |
| 1109 | esac |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1110 | done |
| 1111 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1112 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1113 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1114 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1115 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1116 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1117 | if [ -n "$PXY_CMD" ]; then |
| 1118 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1119 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1120 | fi |
| 1121 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1122 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1123 | } |
| 1124 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1125 | run_test_psa() { |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1126 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1127 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1128 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1129 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1130 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1131 | 0 \ |
| 1132 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1133 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1134 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1135 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1136 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1137 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1138 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1139 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1140 | -C "Failed to setup PSA-based cipher context"\ |
| 1141 | -S "Failed to setup PSA-based cipher context"\ |
| 1142 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1143 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1144 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1145 | -S "error" \ |
| 1146 | -C "error" |
| 1147 | } |
| 1148 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1149 | run_test_psa_force_curve() { |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1150 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1151 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1152 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1153 | "$P_SRV debug_level=4 force_version=tls12" \ |
| 1154 | "$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] | 1155 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1156 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1157 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1158 | -c "PSA calc verify" \ |
| 1159 | -c "calc PSA finished" \ |
| 1160 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1161 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1162 | -s "PSA calc verify" \ |
| 1163 | -s "calc PSA finished" \ |
| 1164 | -C "Failed to setup PSA-based cipher context"\ |
| 1165 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1166 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1167 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1168 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1169 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1170 | -C "error" |
| 1171 | } |
| 1172 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1173 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1174 | # a maximum fragment length. |
| 1175 | # first argument ($1) is MFL for SSL client |
| 1176 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1177 | run_test_memory_after_hanshake_with_mfl() |
| 1178 | { |
| 1179 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1180 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1181 | |
| 1182 | # Leave some margin for robustness |
| 1183 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1184 | |
| 1185 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1186 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1187 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1188 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1189 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1190 | 0 \ |
| 1191 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1192 | } |
| 1193 | |
| 1194 | |
| 1195 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1196 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1197 | run_tests_memory_after_hanshake() |
| 1198 | { |
| 1199 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1200 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1201 | |
| 1202 | # first test with default MFU is to get reference memory usage |
| 1203 | MEMORY_USAGE_MFL_16K=0 |
| 1204 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1205 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1206 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1207 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1208 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1209 | 0 \ |
| 1210 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1211 | |
| 1212 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1213 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1214 | |
| 1215 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1216 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1217 | |
| 1218 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1219 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1220 | |
| 1221 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1222 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1223 | } |
| 1224 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1225 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1226 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1227 | rm -f context_srv.txt |
| 1228 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1229 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1230 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1231 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1232 | 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] | 1233 | exit 1 |
| 1234 | } |
| 1235 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1236 | # |
| 1237 | # MAIN |
| 1238 | # |
| 1239 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1240 | get_options "$@" |
| 1241 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1242 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1243 | # patterns rather than regular expressions, use a case statement instead |
| 1244 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1245 | # detects simple cases: plain substring, everything, nothing. |
| 1246 | # |
| 1247 | # As an exception, the character '.' is treated as an ordinary character |
| 1248 | # if it is the only special character in the string. This is because it's |
| 1249 | # rare to need "any one character", but needing a literal '.' is common |
| 1250 | # (e.g. '-f "DTLS 1.2"'). |
| 1251 | need_grep= |
| 1252 | case "$FILTER" in |
| 1253 | '^$') simple_filter=;; |
| 1254 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1255 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1256 | need_grep=1;; |
| 1257 | *) # No regexp or shell-pattern special character |
| 1258 | simple_filter="*$FILTER*";; |
| 1259 | esac |
| 1260 | case "$EXCLUDE" in |
| 1261 | '^$') simple_exclude=;; |
| 1262 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1263 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1264 | need_grep=1;; |
| 1265 | *) # No regexp or shell-pattern special character |
| 1266 | simple_exclude="*$EXCLUDE*";; |
| 1267 | esac |
| 1268 | if [ -n "$need_grep" ]; then |
| 1269 | is_excluded () { |
| 1270 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1271 | } |
| 1272 | else |
| 1273 | is_excluded () { |
| 1274 | case "$1" in |
| 1275 | $simple_exclude) true;; |
| 1276 | $simple_filter) false;; |
| 1277 | *) true;; |
| 1278 | esac |
| 1279 | } |
| 1280 | fi |
| 1281 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1282 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1283 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1284 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1285 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1286 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1287 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1288 | exit 1 |
| 1289 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1290 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1291 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1292 | exit 1 |
| 1293 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1294 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1295 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1296 | exit 1 |
| 1297 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1298 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1299 | if which valgrind >/dev/null 2>&1; then :; else |
| 1300 | echo "Memcheck not possible. Valgrind not found" |
| 1301 | exit 1 |
| 1302 | fi |
| 1303 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1304 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1305 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1306 | exit 1 |
| 1307 | fi |
| 1308 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1309 | # used by watchdog |
| 1310 | MAIN_PID="$$" |
| 1311 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1312 | # We use somewhat arbitrary delays for tests: |
| 1313 | # - how long do we wait for the server to start (when lsof not available)? |
| 1314 | # - how long do we allow for the client to finish? |
| 1315 | # (not to check performance, just to avoid waiting indefinitely) |
| 1316 | # Things are slower with valgrind, so give extra time here. |
| 1317 | # |
| 1318 | # Note: without lsof, there is a trade-off between the running time of this |
| 1319 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1320 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1321 | # 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] | 1322 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1323 | START_DELAY=6 |
| 1324 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1325 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1326 | START_DELAY=2 |
| 1327 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1328 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1329 | |
| 1330 | # some particular tests need more time: |
| 1331 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1332 | # - for the server, we sleep for a number of seconds after the client exits |
| 1333 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1334 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1335 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1336 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1337 | # 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] | 1338 | # +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] | 1339 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1340 | # 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] | 1341 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1342 | 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] | 1343 | 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] | 1344 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1345 | 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] | 1346 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1347 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1348 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1349 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1350 | 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] | 1351 | 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] | 1352 | fi |
| 1353 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 1354 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1355 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1356 | 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] | 1357 | fi |
| 1358 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1359 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1360 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1361 | fi |
| 1362 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1363 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1364 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1365 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1366 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1367 | # Allow SHA-1, because many of our test certificates use it |
| 1368 | P_SRV="$P_SRV allow_sha1=1" |
| 1369 | P_CLI="$P_CLI allow_sha1=1" |
| 1370 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1371 | # Also pick a unique name for intermediate files |
| 1372 | SRV_OUT="srv_out.$$" |
| 1373 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1374 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1375 | SESSION="session.$$" |
| 1376 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1377 | SKIP_NEXT="NO" |
| 1378 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1379 | trap cleanup INT TERM HUP |
| 1380 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1381 | # Basic test |
| 1382 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1383 | # Checks that: |
| 1384 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1385 | # - the expected (highest security) parameters are selected |
| 1386 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1387 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | dff48c1 | 2022-02-25 19:50:38 +0100 | [diff] [blame^] | 1388 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1389 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1390 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1391 | "$P_CLI" \ |
| 1392 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1393 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1394 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1395 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1396 | -s "ECDHE curve: secp521r1" \ |
| 1397 | -S "error" \ |
| 1398 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1399 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1400 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | dff48c1 | 2022-02-25 19:50:38 +0100 | [diff] [blame^] | 1401 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1402 | run_test "Default, DTLS" \ |
| 1403 | "$P_SRV dtls=1" \ |
| 1404 | "$P_CLI dtls=1" \ |
| 1405 | 0 \ |
| 1406 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1407 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1408 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1409 | run_test "TLS client auth: required" \ |
| 1410 | "$P_SRV auth_mode=required" \ |
| 1411 | "$P_CLI" \ |
| 1412 | 0 \ |
| 1413 | -s "Verifying peer X.509 certificate... ok" |
| 1414 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1415 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1416 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1417 | requires_config_enabled MBEDTLS_SHA256_C |
| 1418 | run_test "TLS: password protected client key" \ |
| 1419 | "$P_SRV auth_mode=required" \ |
| 1420 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1421 | 0 |
| 1422 | |
| 1423 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1424 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1425 | requires_config_enabled MBEDTLS_SHA256_C |
| 1426 | run_test "TLS: password protected server key" \ |
| 1427 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1428 | "$P_CLI" \ |
| 1429 | 0 |
| 1430 | |
| 1431 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1432 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1433 | requires_config_enabled MBEDTLS_RSA_C |
| 1434 | requires_config_enabled MBEDTLS_SHA256_C |
| 1435 | run_test "TLS: password protected server key, two certificates" \ |
| 1436 | "$P_SRV \ |
| 1437 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1438 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1439 | "$P_CLI" \ |
| 1440 | 0 |
| 1441 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1442 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1443 | run_test "Default (compression enabled)" \ |
| 1444 | "$P_SRV debug_level=3" \ |
| 1445 | "$P_CLI debug_level=3" \ |
| 1446 | 0 \ |
| 1447 | -s "Allocating compression buffer" \ |
| 1448 | -c "Allocating compression buffer" \ |
| 1449 | -s "Record expansion is unknown (compression)" \ |
| 1450 | -c "Record expansion is unknown (compression)" \ |
| 1451 | -S "error" \ |
| 1452 | -C "error" |
| 1453 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1454 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1455 | run_test "CA callback on client" \ |
| 1456 | "$P_SRV debug_level=3" \ |
| 1457 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1458 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1459 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1460 | -S "error" \ |
| 1461 | -C "error" |
| 1462 | |
| 1463 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1464 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1465 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1466 | requires_config_enabled MBEDTLS_SHA256_C |
| 1467 | run_test "CA callback on server" \ |
| 1468 | "$P_SRV auth_mode=required" \ |
| 1469 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1470 | key_file=data_files/server5.key" \ |
| 1471 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1472 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1473 | -s "Verifying peer X.509 certificate... ok" \ |
| 1474 | -S "error" \ |
| 1475 | -C "error" |
| 1476 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1477 | # Test using an opaque private key for client authentication |
| 1478 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1479 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1480 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1481 | requires_config_enabled MBEDTLS_SHA256_C |
| 1482 | run_test "Opaque key for client authentication" \ |
| 1483 | "$P_SRV auth_mode=required" \ |
| 1484 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1485 | key_file=data_files/server5.key" \ |
| 1486 | 0 \ |
| 1487 | -c "key type: Opaque" \ |
| 1488 | -s "Verifying peer X.509 certificate... ok" \ |
| 1489 | -S "error" \ |
| 1490 | -C "error" |
| 1491 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1492 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1493 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1494 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1495 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1496 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1497 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1498 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1499 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1500 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1501 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1502 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1503 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1504 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1505 | run_test_psa_force_curve "secp521r1" |
| 1506 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1507 | run_test_psa_force_curve "brainpoolP512r1" |
| 1508 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1509 | run_test_psa_force_curve "secp384r1" |
| 1510 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1511 | run_test_psa_force_curve "brainpoolP384r1" |
| 1512 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1513 | run_test_psa_force_curve "secp256r1" |
| 1514 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1515 | run_test_psa_force_curve "secp256k1" |
| 1516 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1517 | run_test_psa_force_curve "brainpoolP256r1" |
| 1518 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1519 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1520 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 52af769 | 2022-03-31 14:27:24 +0100 | [diff] [blame] | 1521 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1522 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1523 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1524 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1525 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1526 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1527 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1528 | run_test_psa_force_curve "secp192r1" |
| 1529 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1530 | run_test_psa_force_curve "secp192k1" |
| 1531 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1532 | # Test current time in ServerHello |
| 1533 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1534 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1535 | "$P_SRV debug_level=3" \ |
| 1536 | "$P_CLI debug_level=3" \ |
| 1537 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1538 | -f "check_server_hello_time" \ |
| 1539 | -F "check_server_hello_time" |
| 1540 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1541 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1542 | run_test "Unique IV in GCM" \ |
| 1543 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1544 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1545 | 0 \ |
| 1546 | -u "IV used" \ |
| 1547 | -U "IV used" |
| 1548 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1549 | # Tests for certificate verification callback |
| 1550 | run_test "Configuration-specific CRT verification callback" \ |
| 1551 | "$P_SRV debug_level=3" \ |
| 1552 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1553 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1554 | -S "error" \ |
| 1555 | -c "Verify requested for " \ |
| 1556 | -c "Use configuration-specific verification callback" \ |
| 1557 | -C "Use context-specific verification callback" \ |
| 1558 | -C "error" |
| 1559 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1560 | run_test "Context-specific CRT verification callback" \ |
| 1561 | "$P_SRV debug_level=3" \ |
| 1562 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1563 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1564 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1565 | -c "Verify requested for " \ |
| 1566 | -c "Use context-specific verification callback" \ |
| 1567 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1568 | -C "error" |
| 1569 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1570 | # Tests for rc4 option |
| 1571 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1572 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1573 | run_test "RC4: server disabled, client enabled" \ |
| 1574 | "$P_SRV" \ |
| 1575 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1576 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1577 | -s "SSL - The server has no ciphersuites in common" |
| 1578 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1579 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1580 | run_test "RC4: server half, client enabled" \ |
| 1581 | "$P_SRV arc4=1" \ |
| 1582 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1583 | 1 \ |
| 1584 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1585 | |
| 1586 | run_test "RC4: server enabled, client disabled" \ |
| 1587 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1588 | "$P_CLI" \ |
| 1589 | 1 \ |
| 1590 | -s "SSL - The server has no ciphersuites in common" |
| 1591 | |
| 1592 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1593 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1594 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1595 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1596 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1597 | -S "SSL - The server has no ciphersuites in common" |
| 1598 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1599 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1600 | |
| 1601 | requires_gnutls |
| 1602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1603 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1604 | "$G_SRV"\ |
| 1605 | "$P_CLI force_version=tls1_1" \ |
| 1606 | 0 |
| 1607 | |
| 1608 | requires_gnutls |
| 1609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1610 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1611 | "$G_SRV"\ |
| 1612 | "$P_CLI force_version=tls1" \ |
| 1613 | 0 |
| 1614 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1615 | # Tests for SHA-1 support |
| 1616 | |
| 1617 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1618 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1619 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1620 | 1 \ |
| 1621 | -c "The certificate is signed with an unacceptable hash" |
| 1622 | |
| 1623 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1624 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1625 | "$P_CLI allow_sha1=1" \ |
| 1626 | 0 |
| 1627 | |
| 1628 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1629 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1630 | "$P_CLI allow_sha1=0" \ |
| 1631 | 0 |
| 1632 | |
| 1633 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1634 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1635 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1636 | 1 \ |
| 1637 | -s "The certificate is signed with an unacceptable hash" |
| 1638 | |
| 1639 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1640 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1641 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1642 | 0 |
| 1643 | |
| 1644 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1645 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1646 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1647 | 0 |
| 1648 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1649 | # Tests for datagram packing |
| 1650 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1651 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1652 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1653 | 0 \ |
| 1654 | -c "next record in same datagram" \ |
| 1655 | -s "next record in same datagram" |
| 1656 | |
| 1657 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1658 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1659 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1660 | 0 \ |
| 1661 | -s "next record in same datagram" \ |
| 1662 | -C "next record in same datagram" |
| 1663 | |
| 1664 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1665 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1666 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1667 | 0 \ |
| 1668 | -S "next record in same datagram" \ |
| 1669 | -c "next record in same datagram" |
| 1670 | |
| 1671 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1672 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1673 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1674 | 0 \ |
| 1675 | -S "next record in same datagram" \ |
| 1676 | -C "next record in same datagram" |
| 1677 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1678 | # Tests for Truncated HMAC extension |
| 1679 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1680 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1681 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1682 | "$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] | 1683 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1684 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1685 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1686 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1687 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1688 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1689 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1690 | "$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] | 1691 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1692 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1693 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1694 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1695 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1696 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1697 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1698 | "$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] | 1699 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1700 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1701 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1702 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1703 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1704 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1705 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1706 | "$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] | 1707 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1708 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1709 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1710 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1711 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1712 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1713 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1714 | "$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] | 1715 | 0 \ |
| 1716 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1717 | -S "dumping 'expected mac' (10 bytes)" |
| 1718 | |
| 1719 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1720 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1721 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1722 | "$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] | 1723 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1724 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1725 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1726 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1727 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1728 | "$P_SRV dtls=1 debug_level=4" \ |
| 1729 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1730 | 0 \ |
| 1731 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1732 | -S "dumping 'expected mac' (10 bytes)" |
| 1733 | |
| 1734 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1735 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1736 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1737 | "$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] | 1738 | 0 \ |
| 1739 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1740 | -S "dumping 'expected mac' (10 bytes)" |
| 1741 | |
| 1742 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1743 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1744 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1745 | "$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] | 1746 | 0 \ |
| 1747 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1748 | -S "dumping 'expected mac' (10 bytes)" |
| 1749 | |
| 1750 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1751 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1752 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1753 | "$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] | 1754 | 0 \ |
| 1755 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1756 | -S "dumping 'expected mac' (10 bytes)" |
| 1757 | |
| 1758 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1759 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1760 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1761 | "$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] | 1762 | 0 \ |
| 1763 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1764 | -S "dumping 'expected mac' (10 bytes)" |
| 1765 | |
| 1766 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1767 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1768 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1769 | "$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] | 1770 | 0 \ |
| 1771 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1772 | -s "dumping 'expected mac' (10 bytes)" |
| 1773 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1774 | # Tests for Context serialization |
| 1775 | |
| 1776 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1777 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1778 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1779 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1780 | 0 \ |
| 1781 | -c "Deserializing connection..." \ |
| 1782 | -S "Deserializing connection..." |
| 1783 | |
| 1784 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1785 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1786 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1787 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1788 | 0 \ |
| 1789 | -c "Deserializing connection..." \ |
| 1790 | -S "Deserializing connection..." |
| 1791 | |
| 1792 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1793 | run_test "Context serialization, client serializes, GCM" \ |
| 1794 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1795 | "$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] | 1796 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1797 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1798 | -S "Deserializing connection..." |
| 1799 | |
| 1800 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1801 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1802 | run_test "Context serialization, client serializes, with CID" \ |
| 1803 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1804 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1805 | 0 \ |
| 1806 | -c "Deserializing connection..." \ |
| 1807 | -S "Deserializing connection..." |
| 1808 | |
| 1809 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1810 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1811 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1812 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1813 | 0 \ |
| 1814 | -C "Deserializing connection..." \ |
| 1815 | -s "Deserializing connection..." |
| 1816 | |
| 1817 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1818 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1819 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1820 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1821 | 0 \ |
| 1822 | -C "Deserializing connection..." \ |
| 1823 | -s "Deserializing connection..." |
| 1824 | |
| 1825 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1826 | run_test "Context serialization, server serializes, GCM" \ |
| 1827 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1828 | "$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] | 1829 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1830 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1831 | -s "Deserializing connection..." |
| 1832 | |
| 1833 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1834 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1835 | run_test "Context serialization, server serializes, with CID" \ |
| 1836 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1837 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1838 | 0 \ |
| 1839 | -C "Deserializing connection..." \ |
| 1840 | -s "Deserializing connection..." |
| 1841 | |
| 1842 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1843 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1844 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1845 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1846 | 0 \ |
| 1847 | -c "Deserializing connection..." \ |
| 1848 | -s "Deserializing connection..." |
| 1849 | |
| 1850 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1851 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1852 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1853 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1854 | 0 \ |
| 1855 | -c "Deserializing connection..." \ |
| 1856 | -s "Deserializing connection..." |
| 1857 | |
| 1858 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1859 | run_test "Context serialization, both serialize, GCM" \ |
| 1860 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1861 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1862 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1863 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1864 | -s "Deserializing connection..." |
| 1865 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1866 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1867 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1868 | run_test "Context serialization, both serialize, with CID" \ |
| 1869 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1870 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1871 | 0 \ |
| 1872 | -c "Deserializing connection..." \ |
| 1873 | -s "Deserializing connection..." |
| 1874 | |
| 1875 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1876 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1877 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1878 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1879 | 0 \ |
| 1880 | -c "Deserializing connection..." \ |
| 1881 | -S "Deserializing connection..." |
| 1882 | |
| 1883 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1884 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1885 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1886 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1887 | 0 \ |
| 1888 | -c "Deserializing connection..." \ |
| 1889 | -S "Deserializing connection..." |
| 1890 | |
| 1891 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1892 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1893 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1894 | "$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] | 1895 | 0 \ |
| 1896 | -c "Deserializing connection..." \ |
| 1897 | -S "Deserializing connection..." |
| 1898 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1899 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1900 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1901 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1902 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1903 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1904 | 0 \ |
| 1905 | -c "Deserializing connection..." \ |
| 1906 | -S "Deserializing connection..." |
| 1907 | |
| 1908 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1909 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1910 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1911 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1912 | 0 \ |
| 1913 | -C "Deserializing connection..." \ |
| 1914 | -s "Deserializing connection..." |
| 1915 | |
| 1916 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1917 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1918 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1919 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1920 | 0 \ |
| 1921 | -C "Deserializing connection..." \ |
| 1922 | -s "Deserializing connection..." |
| 1923 | |
| 1924 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1925 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1926 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1927 | "$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] | 1928 | 0 \ |
| 1929 | -C "Deserializing connection..." \ |
| 1930 | -s "Deserializing connection..." |
| 1931 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1932 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1933 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1934 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1935 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1936 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1937 | 0 \ |
| 1938 | -C "Deserializing connection..." \ |
| 1939 | -s "Deserializing connection..." |
| 1940 | |
| 1941 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1942 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1943 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1944 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1945 | 0 \ |
| 1946 | -c "Deserializing connection..." \ |
| 1947 | -s "Deserializing connection..." |
| 1948 | |
| 1949 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1950 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1951 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1952 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1953 | 0 \ |
| 1954 | -c "Deserializing connection..." \ |
| 1955 | -s "Deserializing connection..." |
| 1956 | |
| 1957 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1958 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1959 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1960 | "$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] | 1961 | 0 \ |
| 1962 | -c "Deserializing connection..." \ |
| 1963 | -s "Deserializing connection..." |
| 1964 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1965 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1966 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1967 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1968 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1969 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1970 | 0 \ |
| 1971 | -c "Deserializing connection..." \ |
| 1972 | -s "Deserializing connection..." |
| 1973 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1974 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1975 | run_test "Saving the serialized context to a file" \ |
| 1976 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1977 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1978 | 0 \ |
| 1979 | -s "Save serialized context to a file... ok" \ |
| 1980 | -c "Save serialized context to a file... ok" |
| 1981 | rm -f context_srv.txt |
| 1982 | rm -f context_cli.txt |
| 1983 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1984 | # Tests for DTLS Connection ID extension |
| 1985 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1986 | # So far, the CID API isn't implemented, so we can't |
| 1987 | # grep for output witnessing its use. This needs to be |
| 1988 | # changed once the CID extension is implemented. |
| 1989 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1990 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1991 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1992 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1993 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1994 | 0 \ |
| 1995 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1996 | -s "found CID extension" \ |
| 1997 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1998 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1999 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2000 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2001 | -C "found CID extension" \ |
| 2002 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2003 | -C "Copy CIDs into SSL transform" \ |
| 2004 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2005 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2006 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2007 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2008 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2009 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2010 | 0 \ |
| 2011 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2012 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2013 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2014 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2015 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2016 | -C "found CID extension" \ |
| 2017 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2018 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2019 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2020 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2021 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2022 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2023 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2024 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2025 | 0 \ |
| 2026 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2027 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2028 | -c "client hello, adding CID extension" \ |
| 2029 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2030 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2031 | -s "server hello, adding CID extension" \ |
| 2032 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2033 | -c "Use of CID extension negotiated" \ |
| 2034 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2035 | -c "Copy CIDs into SSL transform" \ |
| 2036 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2037 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2038 | -s "Use of Connection ID has been negotiated" \ |
| 2039 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2040 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2041 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2042 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2043 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2044 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2045 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2046 | 0 \ |
| 2047 | -c "Enable use of CID extension." \ |
| 2048 | -s "Enable use of CID extension." \ |
| 2049 | -c "client hello, adding CID extension" \ |
| 2050 | -s "found CID extension" \ |
| 2051 | -s "Use of CID extension negotiated" \ |
| 2052 | -s "server hello, adding CID extension" \ |
| 2053 | -c "found CID extension" \ |
| 2054 | -c "Use of CID extension negotiated" \ |
| 2055 | -s "Copy CIDs into SSL transform" \ |
| 2056 | -c "Copy CIDs into SSL transform" \ |
| 2057 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2058 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2059 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2060 | -c "Use of Connection ID has been negotiated" \ |
| 2061 | -c "ignoring unexpected CID" \ |
| 2062 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2063 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2064 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2065 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2066 | -p "$P_PXY mtu=800" \ |
| 2067 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2068 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2069 | 0 \ |
| 2070 | -c "Enable use of CID extension." \ |
| 2071 | -s "Enable use of CID extension." \ |
| 2072 | -c "client hello, adding CID extension" \ |
| 2073 | -s "found CID extension" \ |
| 2074 | -s "Use of CID extension negotiated" \ |
| 2075 | -s "server hello, adding CID extension" \ |
| 2076 | -c "found CID extension" \ |
| 2077 | -c "Use of CID extension negotiated" \ |
| 2078 | -s "Copy CIDs into SSL transform" \ |
| 2079 | -c "Copy CIDs into SSL transform" \ |
| 2080 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2081 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2082 | -s "Use of Connection ID has been negotiated" \ |
| 2083 | -c "Use of Connection ID has been negotiated" |
| 2084 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2085 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2086 | 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] | 2087 | -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] | 2088 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2089 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2090 | 0 \ |
| 2091 | -c "Enable use of CID extension." \ |
| 2092 | -s "Enable use of CID extension." \ |
| 2093 | -c "client hello, adding CID extension" \ |
| 2094 | -s "found CID extension" \ |
| 2095 | -s "Use of CID extension negotiated" \ |
| 2096 | -s "server hello, adding CID extension" \ |
| 2097 | -c "found CID extension" \ |
| 2098 | -c "Use of CID extension negotiated" \ |
| 2099 | -s "Copy CIDs into SSL transform" \ |
| 2100 | -c "Copy CIDs into SSL transform" \ |
| 2101 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2102 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2103 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2104 | -c "Use of Connection ID has been negotiated" \ |
| 2105 | -c "ignoring unexpected CID" \ |
| 2106 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2107 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2108 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2109 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2110 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2111 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2112 | 0 \ |
| 2113 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2114 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2115 | -c "client hello, adding CID extension" \ |
| 2116 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2117 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2118 | -s "server hello, adding CID extension" \ |
| 2119 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2120 | -c "Use of CID extension negotiated" \ |
| 2121 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2122 | -c "Copy CIDs into SSL transform" \ |
| 2123 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2124 | -s "Peer CID (length 0 Bytes):" \ |
| 2125 | -s "Use of Connection ID has been negotiated" \ |
| 2126 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2127 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2128 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2129 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2130 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2131 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2132 | 0 \ |
| 2133 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2134 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2135 | -c "client hello, adding CID extension" \ |
| 2136 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2137 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2138 | -s "server hello, adding CID extension" \ |
| 2139 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2140 | -c "Use of CID extension negotiated" \ |
| 2141 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2142 | -c "Copy CIDs into SSL transform" \ |
| 2143 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2144 | -c "Peer CID (length 0 Bytes):" \ |
| 2145 | -s "Use of Connection ID has been negotiated" \ |
| 2146 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2147 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2148 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2149 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2150 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2151 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2152 | 0 \ |
| 2153 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2154 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2155 | -c "client hello, adding CID extension" \ |
| 2156 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2157 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2158 | -s "server hello, adding CID extension" \ |
| 2159 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2160 | -c "Use of CID extension negotiated" \ |
| 2161 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2162 | -c "Copy CIDs into SSL transform" \ |
| 2163 | -S "Use of Connection ID has been negotiated" \ |
| 2164 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2165 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2166 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2167 | 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] | 2168 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2169 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2170 | 0 \ |
| 2171 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2172 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2173 | -c "client hello, adding CID extension" \ |
| 2174 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2175 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2176 | -s "server hello, adding CID extension" \ |
| 2177 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2178 | -c "Use of CID extension negotiated" \ |
| 2179 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2180 | -c "Copy CIDs into SSL transform" \ |
| 2181 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2182 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2183 | -s "Use of Connection ID has been negotiated" \ |
| 2184 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2185 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2186 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2187 | 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] | 2188 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2189 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2190 | 0 \ |
| 2191 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2192 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2193 | -c "client hello, adding CID extension" \ |
| 2194 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2195 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2196 | -s "server hello, adding CID extension" \ |
| 2197 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2198 | -c "Use of CID extension negotiated" \ |
| 2199 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2200 | -c "Copy CIDs into SSL transform" \ |
| 2201 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2202 | -s "Peer CID (length 0 Bytes):" \ |
| 2203 | -s "Use of Connection ID has been negotiated" \ |
| 2204 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2205 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2206 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2207 | 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] | 2208 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2209 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2210 | 0 \ |
| 2211 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2212 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2213 | -c "client hello, adding CID extension" \ |
| 2214 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2215 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2216 | -s "server hello, adding CID extension" \ |
| 2217 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2218 | -c "Use of CID extension negotiated" \ |
| 2219 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2220 | -c "Copy CIDs into SSL transform" \ |
| 2221 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2222 | -c "Peer CID (length 0 Bytes):" \ |
| 2223 | -s "Use of Connection ID has been negotiated" \ |
| 2224 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2225 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2226 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2227 | 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] | 2228 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2229 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2230 | 0 \ |
| 2231 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2232 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2233 | -c "client hello, adding CID extension" \ |
| 2234 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2235 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2236 | -s "server hello, adding CID extension" \ |
| 2237 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2238 | -c "Use of CID extension negotiated" \ |
| 2239 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2240 | -c "Copy CIDs into SSL transform" \ |
| 2241 | -S "Use of Connection ID has been negotiated" \ |
| 2242 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2243 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2244 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2245 | 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] | 2246 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2247 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2248 | 0 \ |
| 2249 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2250 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2251 | -c "client hello, adding CID extension" \ |
| 2252 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2253 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2254 | -s "server hello, adding CID extension" \ |
| 2255 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2256 | -c "Use of CID extension negotiated" \ |
| 2257 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2258 | -c "Copy CIDs into SSL transform" \ |
| 2259 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2260 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2261 | -s "Use of Connection ID has been negotiated" \ |
| 2262 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2263 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2264 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2265 | 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] | 2266 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2267 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2268 | 0 \ |
| 2269 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2270 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2271 | -c "client hello, adding CID extension" \ |
| 2272 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2273 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2274 | -s "server hello, adding CID extension" \ |
| 2275 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2276 | -c "Use of CID extension negotiated" \ |
| 2277 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2278 | -c "Copy CIDs into SSL transform" \ |
| 2279 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2280 | -s "Peer CID (length 0 Bytes):" \ |
| 2281 | -s "Use of Connection ID has been negotiated" \ |
| 2282 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2283 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2284 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2285 | 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] | 2286 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2287 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2288 | 0 \ |
| 2289 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2290 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2291 | -c "client hello, adding CID extension" \ |
| 2292 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2293 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2294 | -s "server hello, adding CID extension" \ |
| 2295 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2296 | -c "Use of CID extension negotiated" \ |
| 2297 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2298 | -c "Copy CIDs into SSL transform" \ |
| 2299 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2300 | -c "Peer CID (length 0 Bytes):" \ |
| 2301 | -s "Use of Connection ID has been negotiated" \ |
| 2302 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2303 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2304 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2305 | 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] | 2306 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2307 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2308 | 0 \ |
| 2309 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2310 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2311 | -c "client hello, adding CID extension" \ |
| 2312 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2313 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2314 | -s "server hello, adding CID extension" \ |
| 2315 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2316 | -c "Use of CID extension negotiated" \ |
| 2317 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2318 | -c "Copy CIDs into SSL transform" \ |
| 2319 | -S "Use of Connection ID has been negotiated" \ |
| 2320 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2321 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2322 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2323 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2324 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2325 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2326 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2327 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2328 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2329 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2330 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2331 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2332 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2333 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2334 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2335 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2336 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2337 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2338 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2339 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2340 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2341 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2342 | 0 \ |
| 2343 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2344 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2345 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2346 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2347 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2348 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2349 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2350 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2351 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2352 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2353 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2354 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2355 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2356 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2357 | 0 \ |
| 2358 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2359 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2360 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2361 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2362 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2363 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2364 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2365 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2366 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2367 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2368 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2369 | 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] | 2370 | -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] | 2371 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2372 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead 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): be ef" \ |
| 2379 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2380 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2381 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2382 | -c "ignoring unexpected CID" \ |
| 2383 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2384 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2385 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2386 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2387 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2388 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2389 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2390 | 0 \ |
| 2391 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2392 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2393 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2394 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2395 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2396 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2397 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2398 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2399 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2400 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2401 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2402 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2403 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2404 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2405 | 0 \ |
| 2406 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2407 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2408 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2409 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2410 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2411 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2412 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2413 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2414 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2415 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2416 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2417 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2418 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2419 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2420 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2421 | 0 \ |
| 2422 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2423 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2424 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2425 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2426 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2427 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2428 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2429 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2430 | -c "ignoring unexpected CID" \ |
| 2431 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2432 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2433 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2435 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2436 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2437 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2438 | 0 \ |
| 2439 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2440 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2441 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2442 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2443 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2444 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2445 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2446 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2447 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2448 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2449 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2450 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2451 | 0 \ |
| 2452 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2453 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2454 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2455 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2456 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2457 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2458 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2459 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2460 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2461 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2462 | -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] | 2463 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2464 | "$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" \ |
| 2465 | 0 \ |
| 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" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2471 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2472 | -c "ignoring unexpected CID" \ |
| 2473 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2474 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2475 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2476 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2477 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +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" \ |
| 2489 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2490 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2491 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2492 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2493 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2494 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2495 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2496 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2497 | 0 \ |
| 2498 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2499 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2500 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2501 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2502 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2503 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2504 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2505 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2506 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2507 | -c "ignoring unexpected CID" \ |
| 2508 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2509 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2510 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2511 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2512 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 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" \ |
| 2524 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2525 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2526 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2527 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2528 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2529 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2530 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2531 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2532 | 0 \ |
| 2533 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2534 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2535 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2536 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2537 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2538 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2539 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2540 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2541 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2542 | -c "ignoring unexpected CID" \ |
| 2543 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2544 | |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2545 | # This and the test below it require MAX_CONTENT_LEN to be at least MFL+1, because the |
| 2546 | # tests check that the buffer contents are reallocated when the message is |
| 2547 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2548 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2549 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2550 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2551 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2552 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2553 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2554 | 0 \ |
| 2555 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2556 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2557 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2558 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2559 | -s "Reallocating in_buf" \ |
| 2560 | -s "Reallocating out_buf" |
| 2561 | |
| 2562 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2563 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2564 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2565 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2566 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2567 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2568 | 0 \ |
| 2569 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2570 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2571 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2572 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2573 | -s "Reallocating in_buf" \ |
| 2574 | -s "Reallocating out_buf" |
| 2575 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2576 | # Tests for Encrypt-then-MAC extension |
| 2577 | |
| 2578 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2579 | "$P_SRV debug_level=3 \ |
| 2580 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2581 | "$P_CLI debug_level=3" \ |
| 2582 | 0 \ |
| 2583 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2584 | -s "found encrypt then mac extension" \ |
| 2585 | -s "server hello, adding encrypt then mac extension" \ |
| 2586 | -c "found encrypt_then_mac extension" \ |
| 2587 | -c "using encrypt then mac" \ |
| 2588 | -s "using encrypt then mac" |
| 2589 | |
| 2590 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2591 | "$P_SRV debug_level=3 etm=0 \ |
| 2592 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2593 | "$P_CLI debug_level=3 etm=1" \ |
| 2594 | 0 \ |
| 2595 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2596 | -s "found encrypt then mac extension" \ |
| 2597 | -S "server hello, adding encrypt then mac extension" \ |
| 2598 | -C "found encrypt_then_mac extension" \ |
| 2599 | -C "using encrypt then mac" \ |
| 2600 | -S "using encrypt then mac" |
| 2601 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2602 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2603 | "$P_SRV debug_level=3 etm=1 \ |
| 2604 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2605 | "$P_CLI debug_level=3 etm=1" \ |
| 2606 | 0 \ |
| 2607 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2608 | -s "found encrypt then mac extension" \ |
| 2609 | -S "server hello, adding encrypt then mac extension" \ |
| 2610 | -C "found encrypt_then_mac extension" \ |
| 2611 | -C "using encrypt then mac" \ |
| 2612 | -S "using encrypt then mac" |
| 2613 | |
| 2614 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2615 | "$P_SRV debug_level=3 etm=1 \ |
| 2616 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2617 | "$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] | 2618 | 0 \ |
| 2619 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2620 | -s "found encrypt then mac extension" \ |
| 2621 | -S "server hello, adding encrypt then mac extension" \ |
| 2622 | -C "found encrypt_then_mac extension" \ |
| 2623 | -C "using encrypt then mac" \ |
| 2624 | -S "using encrypt then mac" |
| 2625 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2626 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2627 | "$P_SRV debug_level=3 etm=1 \ |
| 2628 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2629 | "$P_CLI debug_level=3 etm=0" \ |
| 2630 | 0 \ |
| 2631 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2632 | -S "found encrypt then mac extension" \ |
| 2633 | -S "server hello, adding encrypt then mac extension" \ |
| 2634 | -C "found encrypt_then_mac extension" \ |
| 2635 | -C "using encrypt then mac" \ |
| 2636 | -S "using encrypt then mac" |
| 2637 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2638 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2639 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2640 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2641 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2642 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2643 | 0 \ |
| 2644 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2645 | -S "found encrypt then mac extension" \ |
| 2646 | -S "server hello, adding encrypt then mac extension" \ |
| 2647 | -C "found encrypt_then_mac extension" \ |
| 2648 | -C "using encrypt then mac" \ |
| 2649 | -S "using encrypt then mac" |
| 2650 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2651 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2652 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2653 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2654 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2655 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2656 | 0 \ |
| 2657 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2658 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2659 | -S "server hello, adding encrypt then mac extension" \ |
| 2660 | -C "found encrypt_then_mac extension" \ |
| 2661 | -C "using encrypt then mac" \ |
| 2662 | -S "using encrypt then mac" |
| 2663 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2664 | # Tests for Extended Master Secret extension |
| 2665 | |
| 2666 | run_test "Extended Master Secret: default" \ |
| 2667 | "$P_SRV debug_level=3" \ |
| 2668 | "$P_CLI debug_level=3" \ |
| 2669 | 0 \ |
| 2670 | -c "client hello, adding extended_master_secret extension" \ |
| 2671 | -s "found extended master secret extension" \ |
| 2672 | -s "server hello, adding extended master secret extension" \ |
| 2673 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2674 | -c "session hash for extended master secret" \ |
| 2675 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2676 | |
| 2677 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2678 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2679 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2680 | 0 \ |
| 2681 | -c "client hello, adding extended_master_secret extension" \ |
| 2682 | -s "found extended master secret extension" \ |
| 2683 | -S "server hello, adding extended master secret extension" \ |
| 2684 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2685 | -C "session hash for extended master secret" \ |
| 2686 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2687 | |
| 2688 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2689 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2690 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2691 | 0 \ |
| 2692 | -C "client hello, adding extended_master_secret extension" \ |
| 2693 | -S "found extended master secret extension" \ |
| 2694 | -S "server hello, adding extended master secret extension" \ |
| 2695 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2696 | -C "session hash for extended master secret" \ |
| 2697 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2698 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2699 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2700 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2701 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2702 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2703 | 0 \ |
| 2704 | -C "client hello, adding extended_master_secret extension" \ |
| 2705 | -S "found extended master secret extension" \ |
| 2706 | -S "server hello, adding extended master secret extension" \ |
| 2707 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2708 | -C "session hash for extended master secret" \ |
| 2709 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2710 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2711 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2712 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2713 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2714 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2715 | 0 \ |
| 2716 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2717 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2718 | -S "server hello, adding extended master secret extension" \ |
| 2719 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2720 | -C "session hash for extended master secret" \ |
| 2721 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2722 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2723 | # Tests for FALLBACK_SCSV |
| 2724 | |
| 2725 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2726 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2727 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2728 | 0 \ |
| 2729 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2730 | -S "received FALLBACK_SCSV" \ |
| 2731 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2732 | -C "is a fatal alert message (msg 86)" |
| 2733 | |
| 2734 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2735 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2736 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2737 | 0 \ |
| 2738 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2739 | -S "received FALLBACK_SCSV" \ |
| 2740 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2741 | -C "is a fatal alert message (msg 86)" |
| 2742 | |
| 2743 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2744 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2745 | "$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] | 2746 | 1 \ |
| 2747 | -c "adding FALLBACK_SCSV" \ |
| 2748 | -s "received FALLBACK_SCSV" \ |
| 2749 | -s "inapropriate fallback" \ |
| 2750 | -c "is a fatal alert message (msg 86)" |
| 2751 | |
| 2752 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2753 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2754 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2755 | 0 \ |
| 2756 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2757 | -s "received FALLBACK_SCSV" \ |
| 2758 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2759 | -C "is a fatal alert message (msg 86)" |
| 2760 | |
| 2761 | requires_openssl_with_fallback_scsv |
| 2762 | run_test "Fallback SCSV: default, openssl server" \ |
| 2763 | "$O_SRV" \ |
| 2764 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2765 | 0 \ |
| 2766 | -C "adding FALLBACK_SCSV" \ |
| 2767 | -C "is a fatal alert message (msg 86)" |
| 2768 | |
| 2769 | requires_openssl_with_fallback_scsv |
| 2770 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2771 | "$O_SRV" \ |
| 2772 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2773 | 1 \ |
| 2774 | -c "adding FALLBACK_SCSV" \ |
| 2775 | -c "is a fatal alert message (msg 86)" |
| 2776 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2777 | requires_openssl_with_fallback_scsv |
| 2778 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2779 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2780 | "$O_CLI -tls1_1" \ |
| 2781 | 0 \ |
| 2782 | -S "received FALLBACK_SCSV" \ |
| 2783 | -S "inapropriate fallback" |
| 2784 | |
| 2785 | requires_openssl_with_fallback_scsv |
| 2786 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2787 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2788 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2789 | 1 \ |
| 2790 | -s "received FALLBACK_SCSV" \ |
| 2791 | -s "inapropriate fallback" |
| 2792 | |
| 2793 | requires_openssl_with_fallback_scsv |
| 2794 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2795 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2796 | "$O_CLI -fallback_scsv" \ |
| 2797 | 0 \ |
| 2798 | -s "received FALLBACK_SCSV" \ |
| 2799 | -S "inapropriate fallback" |
| 2800 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2801 | # Test sending and receiving empty application data records |
| 2802 | |
| 2803 | run_test "Encrypt then MAC: empty application data record" \ |
| 2804 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2805 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2806 | 0 \ |
| 2807 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2808 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2809 | -c "0 bytes written in 1 fragments" |
| 2810 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2811 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2812 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2813 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2814 | 0 \ |
| 2815 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2816 | -c "0 bytes written in 1 fragments" |
| 2817 | |
| 2818 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2819 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2820 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2821 | 0 \ |
| 2822 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2823 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2824 | -c "0 bytes written in 1 fragments" |
| 2825 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2826 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2827 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2828 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2829 | 0 \ |
| 2830 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2831 | -c "0 bytes written in 1 fragments" |
| 2832 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2833 | ## ClientHello generated with |
| 2834 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 2835 | ## then manually twiddling the ciphersuite list. |
| 2836 | ## The ClientHello content is spelled out below as a hex string as |
| 2837 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 2838 | ## The expected response is an inappropriate_fallback alert. |
| 2839 | requires_openssl_with_fallback_scsv |
| 2840 | run_test "Fallback SCSV: beginning of list" \ |
| 2841 | "$P_SRV debug_level=2" \ |
| 2842 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 2843 | 0 \ |
| 2844 | -s "received FALLBACK_SCSV" \ |
| 2845 | -s "inapropriate fallback" |
| 2846 | |
| 2847 | requires_openssl_with_fallback_scsv |
| 2848 | run_test "Fallback SCSV: end of list" \ |
| 2849 | "$P_SRV debug_level=2" \ |
| 2850 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 2851 | 0 \ |
| 2852 | -s "received FALLBACK_SCSV" \ |
| 2853 | -s "inapropriate fallback" |
| 2854 | |
| 2855 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 2856 | requires_openssl_with_fallback_scsv |
| 2857 | run_test "Fallback SCSV: not in list" \ |
| 2858 | "$P_SRV debug_level=2" \ |
| 2859 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 2860 | 0 \ |
| 2861 | -S "received FALLBACK_SCSV" \ |
| 2862 | -S "inapropriate fallback" |
| 2863 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2864 | # Tests for CBC 1/n-1 record splitting |
| 2865 | |
| 2866 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2867 | "$P_SRV" \ |
| 2868 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 2869 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2870 | 0 \ |
| 2871 | -s "Read from client: 123 bytes read" \ |
| 2872 | -S "Read from client: 1 bytes read" \ |
| 2873 | -S "122 bytes read" |
| 2874 | |
| 2875 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 2876 | "$P_SRV" \ |
| 2877 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2878 | request_size=123 force_version=tls1_1" \ |
| 2879 | 0 \ |
| 2880 | -s "Read from client: 123 bytes read" \ |
| 2881 | -S "Read from client: 1 bytes read" \ |
| 2882 | -S "122 bytes read" |
| 2883 | |
| 2884 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 2885 | "$P_SRV" \ |
| 2886 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2887 | request_size=123 force_version=tls1" \ |
| 2888 | 0 \ |
| 2889 | -S "Read from client: 123 bytes read" \ |
| 2890 | -s "Read from client: 1 bytes read" \ |
| 2891 | -s "122 bytes read" |
| 2892 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2893 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2894 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2895 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2896 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2897 | request_size=123 force_version=ssl3" \ |
| 2898 | 0 \ |
| 2899 | -S "Read from client: 123 bytes read" \ |
| 2900 | -s "Read from client: 1 bytes read" \ |
| 2901 | -s "122 bytes read" |
| 2902 | |
| 2903 | 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] | 2904 | "$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] | 2905 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 2906 | request_size=123 force_version=tls1" \ |
| 2907 | 0 \ |
| 2908 | -s "Read from client: 123 bytes read" \ |
| 2909 | -S "Read from client: 1 bytes read" \ |
| 2910 | -S "122 bytes read" |
| 2911 | |
| 2912 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 2913 | "$P_SRV" \ |
| 2914 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2915 | request_size=123 force_version=tls1 recsplit=0" \ |
| 2916 | 0 \ |
| 2917 | -s "Read from client: 123 bytes read" \ |
| 2918 | -S "Read from client: 1 bytes read" \ |
| 2919 | -S "122 bytes read" |
| 2920 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2921 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 2922 | "$P_SRV nbio=2" \ |
| 2923 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2924 | request_size=123 force_version=tls1" \ |
| 2925 | 0 \ |
| 2926 | -S "Read from client: 123 bytes read" \ |
| 2927 | -s "Read from client: 1 bytes read" \ |
| 2928 | -s "122 bytes read" |
| 2929 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2930 | # Tests for Session Tickets |
| 2931 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2932 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2933 | "$P_SRV debug_level=3 tickets=1" \ |
| 2934 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2935 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2936 | -c "client hello, adding session ticket extension" \ |
| 2937 | -s "found session ticket extension" \ |
| 2938 | -s "server hello, adding session ticket extension" \ |
| 2939 | -c "found session_ticket extension" \ |
| 2940 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2941 | -S "session successfully restored from cache" \ |
| 2942 | -s "session successfully restored from ticket" \ |
| 2943 | -s "a session has been resumed" \ |
| 2944 | -c "a session has been resumed" |
| 2945 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2946 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2947 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2948 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2949 | 0 \ |
| 2950 | -c "client hello, adding session ticket extension" \ |
| 2951 | -s "found session ticket extension" \ |
| 2952 | -s "server hello, adding session ticket extension" \ |
| 2953 | -c "found session_ticket extension" \ |
| 2954 | -c "parse new session ticket" \ |
| 2955 | -S "session successfully restored from cache" \ |
| 2956 | -s "session successfully restored from ticket" \ |
| 2957 | -s "a session has been resumed" \ |
| 2958 | -c "a session has been resumed" |
| 2959 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2960 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2961 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2962 | "$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] | 2963 | 0 \ |
| 2964 | -c "client hello, adding session ticket extension" \ |
| 2965 | -s "found session ticket extension" \ |
| 2966 | -s "server hello, adding session ticket extension" \ |
| 2967 | -c "found session_ticket extension" \ |
| 2968 | -c "parse new session ticket" \ |
| 2969 | -S "session successfully restored from cache" \ |
| 2970 | -S "session successfully restored from ticket" \ |
| 2971 | -S "a session has been resumed" \ |
| 2972 | -C "a session has been resumed" |
| 2973 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2974 | run_test "Session resume using tickets: session copy" \ |
| 2975 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2976 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2977 | 0 \ |
| 2978 | -c "client hello, adding session ticket extension" \ |
| 2979 | -s "found session ticket extension" \ |
| 2980 | -s "server hello, adding session ticket extension" \ |
| 2981 | -c "found session_ticket extension" \ |
| 2982 | -c "parse new session ticket" \ |
| 2983 | -S "session successfully restored from cache" \ |
| 2984 | -s "session successfully restored from ticket" \ |
| 2985 | -s "a session has been resumed" \ |
| 2986 | -c "a session has been resumed" |
| 2987 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2988 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2989 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2990 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2991 | 0 \ |
| 2992 | -c "client hello, adding session ticket extension" \ |
| 2993 | -c "found session_ticket extension" \ |
| 2994 | -c "parse new session ticket" \ |
| 2995 | -c "a session has been resumed" |
| 2996 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2997 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2998 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2999 | "( $O_CLI -sess_out $SESSION; \ |
| 3000 | $O_CLI -sess_in $SESSION; \ |
| 3001 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3002 | 0 \ |
| 3003 | -s "found session ticket extension" \ |
| 3004 | -s "server hello, adding session ticket extension" \ |
| 3005 | -S "session successfully restored from cache" \ |
| 3006 | -s "session successfully restored from ticket" \ |
| 3007 | -s "a session has been resumed" |
| 3008 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3009 | # Tests for Session Tickets with DTLS |
| 3010 | |
| 3011 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3012 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3013 | "$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] | 3014 | 0 \ |
| 3015 | -c "client hello, adding session ticket extension" \ |
| 3016 | -s "found session ticket extension" \ |
| 3017 | -s "server hello, adding session ticket extension" \ |
| 3018 | -c "found session_ticket extension" \ |
| 3019 | -c "parse new session ticket" \ |
| 3020 | -S "session successfully restored from cache" \ |
| 3021 | -s "session successfully restored from ticket" \ |
| 3022 | -s "a session has been resumed" \ |
| 3023 | -c "a session has been resumed" |
| 3024 | |
| 3025 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3026 | "$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] | 3027 | "$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] | 3028 | 0 \ |
| 3029 | -c "client hello, adding session ticket extension" \ |
| 3030 | -s "found session ticket extension" \ |
| 3031 | -s "server hello, adding session ticket extension" \ |
| 3032 | -c "found session_ticket extension" \ |
| 3033 | -c "parse new session ticket" \ |
| 3034 | -S "session successfully restored from cache" \ |
| 3035 | -s "session successfully restored from ticket" \ |
| 3036 | -s "a session has been resumed" \ |
| 3037 | -c "a session has been resumed" |
| 3038 | |
| 3039 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3040 | "$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] | 3041 | "$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] | 3042 | 0 \ |
| 3043 | -c "client hello, adding session ticket extension" \ |
| 3044 | -s "found session ticket extension" \ |
| 3045 | -s "server hello, adding session ticket extension" \ |
| 3046 | -c "found session_ticket extension" \ |
| 3047 | -c "parse new session ticket" \ |
| 3048 | -S "session successfully restored from cache" \ |
| 3049 | -S "session successfully restored from ticket" \ |
| 3050 | -S "a session has been resumed" \ |
| 3051 | -C "a session has been resumed" |
| 3052 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3053 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3054 | "$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] | 3055 | "$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] | 3056 | 0 \ |
| 3057 | -c "client hello, adding session ticket extension" \ |
| 3058 | -s "found session ticket extension" \ |
| 3059 | -s "server hello, adding session ticket extension" \ |
| 3060 | -c "found session_ticket extension" \ |
| 3061 | -c "parse new session ticket" \ |
| 3062 | -S "session successfully restored from cache" \ |
| 3063 | -s "session successfully restored from ticket" \ |
| 3064 | -s "a session has been resumed" \ |
| 3065 | -c "a session has been resumed" |
| 3066 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3067 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3068 | "$O_SRV -dtls1" \ |
| 3069 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3070 | 0 \ |
| 3071 | -c "client hello, adding session ticket extension" \ |
| 3072 | -c "found session_ticket extension" \ |
| 3073 | -c "parse new session ticket" \ |
| 3074 | -c "a session has been resumed" |
| 3075 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3076 | # 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] | 3077 | # 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] | 3078 | requires_openssl_next |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3079 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3080 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3081 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3082 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3083 | rm -f $SESSION )" \ |
| 3084 | 0 \ |
| 3085 | -s "found session ticket extension" \ |
| 3086 | -s "server hello, adding session ticket extension" \ |
| 3087 | -S "session successfully restored from cache" \ |
| 3088 | -s "session successfully restored from ticket" \ |
| 3089 | -s "a session has been resumed" |
| 3090 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3091 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3092 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3093 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3094 | "$P_SRV debug_level=3 tickets=0" \ |
| 3095 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3096 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3097 | -c "client hello, adding session ticket extension" \ |
| 3098 | -s "found session ticket extension" \ |
| 3099 | -S "server hello, adding session ticket extension" \ |
| 3100 | -C "found session_ticket extension" \ |
| 3101 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3102 | -s "session successfully restored from cache" \ |
| 3103 | -S "session successfully restored from ticket" \ |
| 3104 | -s "a session has been resumed" \ |
| 3105 | -c "a session has been resumed" |
| 3106 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3107 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3108 | "$P_SRV debug_level=3 tickets=1" \ |
| 3109 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3110 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3111 | -C "client hello, adding session ticket extension" \ |
| 3112 | -S "found session ticket extension" \ |
| 3113 | -S "server hello, adding session ticket extension" \ |
| 3114 | -C "found session_ticket extension" \ |
| 3115 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3116 | -s "session successfully restored from cache" \ |
| 3117 | -S "session successfully restored from ticket" \ |
| 3118 | -s "a session has been resumed" \ |
| 3119 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3120 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3121 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3122 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3123 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3124 | 0 \ |
| 3125 | -S "session successfully restored from cache" \ |
| 3126 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3127 | -S "a session has been resumed" \ |
| 3128 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3129 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3130 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3131 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3132 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3133 | 0 \ |
| 3134 | -s "session successfully restored from cache" \ |
| 3135 | -S "session successfully restored from ticket" \ |
| 3136 | -s "a session has been resumed" \ |
| 3137 | -c "a session has been resumed" |
| 3138 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3139 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3140 | "$P_SRV debug_level=3 tickets=0" \ |
| 3141 | "$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] | 3142 | 0 \ |
| 3143 | -s "session successfully restored from cache" \ |
| 3144 | -S "session successfully restored from ticket" \ |
| 3145 | -s "a session has been resumed" \ |
| 3146 | -c "a session has been resumed" |
| 3147 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3148 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3149 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3150 | "$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] | 3151 | 0 \ |
| 3152 | -S "session successfully restored from cache" \ |
| 3153 | -S "session successfully restored from ticket" \ |
| 3154 | -S "a session has been resumed" \ |
| 3155 | -C "a session has been resumed" |
| 3156 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3157 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3158 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3159 | "$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] | 3160 | 0 \ |
| 3161 | -s "session successfully restored from cache" \ |
| 3162 | -S "session successfully restored from ticket" \ |
| 3163 | -s "a session has been resumed" \ |
| 3164 | -c "a session has been resumed" |
| 3165 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3166 | run_test "Session resume using cache: session copy" \ |
| 3167 | "$P_SRV debug_level=3 tickets=0" \ |
| 3168 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3169 | 0 \ |
| 3170 | -s "session successfully restored from cache" \ |
| 3171 | -S "session successfully restored from ticket" \ |
| 3172 | -s "a session has been resumed" \ |
| 3173 | -c "a session has been resumed" |
| 3174 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3175 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3176 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3177 | "( $O_CLI -sess_out $SESSION; \ |
| 3178 | $O_CLI -sess_in $SESSION; \ |
| 3179 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3180 | 0 \ |
| 3181 | -s "found session ticket extension" \ |
| 3182 | -S "server hello, adding session ticket extension" \ |
| 3183 | -s "session successfully restored from cache" \ |
| 3184 | -S "session successfully restored from ticket" \ |
| 3185 | -s "a session has been resumed" |
| 3186 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3187 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3188 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3189 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3190 | 0 \ |
| 3191 | -C "found session_ticket extension" \ |
| 3192 | -C "parse new session ticket" \ |
| 3193 | -c "a session has been resumed" |
| 3194 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3195 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3196 | |
| 3197 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3198 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3199 | "$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] | 3200 | 0 \ |
| 3201 | -c "client hello, adding session ticket extension" \ |
| 3202 | -s "found session ticket extension" \ |
| 3203 | -S "server hello, adding session ticket extension" \ |
| 3204 | -C "found session_ticket extension" \ |
| 3205 | -C "parse new session ticket" \ |
| 3206 | -s "session successfully restored from cache" \ |
| 3207 | -S "session successfully restored from ticket" \ |
| 3208 | -s "a session has been resumed" \ |
| 3209 | -c "a session has been resumed" |
| 3210 | |
| 3211 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3212 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3213 | "$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] | 3214 | 0 \ |
| 3215 | -C "client hello, adding session ticket extension" \ |
| 3216 | -S "found session ticket extension" \ |
| 3217 | -S "server hello, adding session ticket extension" \ |
| 3218 | -C "found session_ticket extension" \ |
| 3219 | -C "parse new session ticket" \ |
| 3220 | -s "session successfully restored from cache" \ |
| 3221 | -S "session successfully restored from ticket" \ |
| 3222 | -s "a session has been resumed" \ |
| 3223 | -c "a session has been resumed" |
| 3224 | |
| 3225 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3226 | "$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] | 3227 | "$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] | 3228 | 0 \ |
| 3229 | -S "session successfully restored from cache" \ |
| 3230 | -S "session successfully restored from ticket" \ |
| 3231 | -S "a session has been resumed" \ |
| 3232 | -C "a session has been resumed" |
| 3233 | |
| 3234 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3235 | "$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] | 3236 | "$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] | 3237 | 0 \ |
| 3238 | -s "session successfully restored from cache" \ |
| 3239 | -S "session successfully restored from ticket" \ |
| 3240 | -s "a session has been resumed" \ |
| 3241 | -c "a session has been resumed" |
| 3242 | |
| 3243 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3244 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3245 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_delay=0" \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3246 | 0 \ |
| 3247 | -s "session successfully restored from cache" \ |
| 3248 | -S "session successfully restored from ticket" \ |
| 3249 | -s "a session has been resumed" \ |
| 3250 | -c "a session has been resumed" |
| 3251 | |
| 3252 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3253 | "$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] | 3254 | "$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] | 3255 | 0 \ |
| 3256 | -S "session successfully restored from cache" \ |
| 3257 | -S "session successfully restored from ticket" \ |
| 3258 | -S "a session has been resumed" \ |
| 3259 | -C "a session has been resumed" |
| 3260 | |
| 3261 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3262 | "$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] | 3263 | "$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] | 3264 | 0 \ |
| 3265 | -s "session successfully restored from cache" \ |
| 3266 | -S "session successfully restored from ticket" \ |
| 3267 | -s "a session has been resumed" \ |
| 3268 | -c "a session has been resumed" |
| 3269 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3270 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3271 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3272 | "$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] | 3273 | 0 \ |
| 3274 | -s "session successfully restored from cache" \ |
| 3275 | -S "session successfully restored from ticket" \ |
| 3276 | -s "a session has been resumed" \ |
| 3277 | -c "a session has been resumed" |
| 3278 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3279 | # 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] | 3280 | # 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] | 3281 | requires_openssl_next |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3282 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3283 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3284 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3285 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3286 | rm -f $SESSION )" \ |
| 3287 | 0 \ |
| 3288 | -s "found session ticket extension" \ |
| 3289 | -S "server hello, adding session ticket extension" \ |
| 3290 | -s "session successfully restored from cache" \ |
| 3291 | -S "session successfully restored from ticket" \ |
| 3292 | -s "a session has been resumed" |
| 3293 | |
| 3294 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3295 | "$O_SRV -dtls1" \ |
| 3296 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3297 | 0 \ |
| 3298 | -C "found session_ticket extension" \ |
| 3299 | -C "parse new session ticket" \ |
| 3300 | -c "a session has been resumed" |
| 3301 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3302 | # Tests for Max Fragment Length extension |
| 3303 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3304 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3305 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3306 | "$P_SRV debug_level=3" \ |
| 3307 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3308 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3309 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3310 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3311 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3312 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3313 | -C "client hello, adding max_fragment_length extension" \ |
| 3314 | -S "found max fragment length extension" \ |
| 3315 | -S "server hello, max_fragment_length extension" \ |
| 3316 | -C "found max_fragment_length extension" |
| 3317 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3318 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3319 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3320 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3321 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3322 | 0 \ |
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" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3331 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3332 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3333 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3334 | |
| 3335 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3336 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3337 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3338 | "$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] | 3339 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3340 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3341 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3342 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3343 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3344 | -C "client hello, adding max_fragment_length extension" \ |
| 3345 | -S "found max fragment length extension" \ |
| 3346 | -S "server hello, max_fragment_length extension" \ |
| 3347 | -C "found max_fragment_length extension" \ |
| 3348 | -c "fragment larger than.*maximum " |
| 3349 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3350 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3351 | # (session fragment length will be 16384 regardless of mbedtls |
| 3352 | # content length configuration.) |
| 3353 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3354 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3355 | run_test "Max fragment length: disabled, larger message" \ |
| 3356 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3357 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3358 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3359 | -C "Maximum input fragment length is 16384" \ |
| 3360 | -C "Maximum output fragment length is 16384" \ |
| 3361 | -S "Maximum input fragment length is 16384" \ |
| 3362 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3363 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3364 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3365 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3366 | |
| 3367 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 18ddccc | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3368 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3369 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3370 | "$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] | 3371 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3372 | -C "Maximum input fragment length is 16384" \ |
| 3373 | -C "Maximum output fragment length is 16384" \ |
| 3374 | -S "Maximum input fragment length is 16384" \ |
| 3375 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3376 | -c "fragment larger than.*maximum " |
| 3377 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3378 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3379 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3380 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3381 | "$P_SRV debug_level=3" \ |
| 3382 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3383 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3384 | -c "Maximum input fragment length is 4096" \ |
| 3385 | -c "Maximum output fragment length is 4096" \ |
| 3386 | -s "Maximum input fragment length is 4096" \ |
| 3387 | -s "Maximum output fragment length is 4096" \ |
| 3388 | -c "client hello, adding max_fragment_length extension" \ |
| 3389 | -s "found max fragment length extension" \ |
| 3390 | -s "server hello, max_fragment_length extension" \ |
| 3391 | -c "found max_fragment_length extension" |
| 3392 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3393 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3394 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3395 | run_test "Max fragment length: client 512, server 1024" \ |
| 3396 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3397 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3398 | 0 \ |
| 3399 | -c "Maximum input fragment length is 512" \ |
| 3400 | -c "Maximum output fragment length is 512" \ |
| 3401 | -s "Maximum input fragment length is 512" \ |
| 3402 | -s "Maximum output fragment length is 512" \ |
| 3403 | -c "client hello, adding max_fragment_length extension" \ |
| 3404 | -s "found max fragment length extension" \ |
| 3405 | -s "server hello, max_fragment_length extension" \ |
| 3406 | -c "found max_fragment_length extension" |
| 3407 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3408 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3409 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3410 | run_test "Max fragment length: client 512, server 2048" \ |
| 3411 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3412 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3413 | 0 \ |
| 3414 | -c "Maximum input fragment length is 512" \ |
| 3415 | -c "Maximum output fragment length is 512" \ |
| 3416 | -s "Maximum input fragment length is 512" \ |
| 3417 | -s "Maximum output fragment length is 512" \ |
| 3418 | -c "client hello, adding max_fragment_length extension" \ |
| 3419 | -s "found max fragment length extension" \ |
| 3420 | -s "server hello, max_fragment_length extension" \ |
| 3421 | -c "found max_fragment_length extension" |
| 3422 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3423 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3424 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3425 | run_test "Max fragment length: client 512, server 4096" \ |
| 3426 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3427 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3428 | 0 \ |
| 3429 | -c "Maximum input fragment length is 512" \ |
| 3430 | -c "Maximum output fragment length is 512" \ |
| 3431 | -s "Maximum input fragment length is 512" \ |
| 3432 | -s "Maximum output fragment length is 512" \ |
| 3433 | -c "client hello, adding max_fragment_length extension" \ |
| 3434 | -s "found max fragment length extension" \ |
| 3435 | -s "server hello, max_fragment_length extension" \ |
| 3436 | -c "found max_fragment_length extension" |
| 3437 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3438 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3439 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3440 | run_test "Max fragment length: client 1024, server 512" \ |
| 3441 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3442 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3443 | 0 \ |
| 3444 | -c "Maximum input fragment length is 1024" \ |
| 3445 | -c "Maximum output fragment length is 1024" \ |
| 3446 | -s "Maximum input fragment length is 1024" \ |
| 3447 | -s "Maximum output fragment length is 512" \ |
| 3448 | -c "client hello, adding max_fragment_length extension" \ |
| 3449 | -s "found max fragment length extension" \ |
| 3450 | -s "server hello, max_fragment_length extension" \ |
| 3451 | -c "found max_fragment_length extension" |
| 3452 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3453 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3454 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3455 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3456 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3457 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3458 | 0 \ |
| 3459 | -c "Maximum input fragment length is 1024" \ |
| 3460 | -c "Maximum output fragment length is 1024" \ |
| 3461 | -s "Maximum input fragment length is 1024" \ |
| 3462 | -s "Maximum output fragment length is 1024" \ |
| 3463 | -c "client hello, adding max_fragment_length extension" \ |
| 3464 | -s "found max fragment length extension" \ |
| 3465 | -s "server hello, max_fragment_length extension" \ |
| 3466 | -c "found max_fragment_length extension" |
| 3467 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3468 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3469 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3470 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3471 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3472 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3473 | 0 \ |
| 3474 | -c "Maximum input fragment length is 1024" \ |
| 3475 | -c "Maximum output fragment length is 1024" \ |
| 3476 | -s "Maximum input fragment length is 1024" \ |
| 3477 | -s "Maximum output fragment length is 1024" \ |
| 3478 | -c "client hello, adding max_fragment_length extension" \ |
| 3479 | -s "found max fragment length extension" \ |
| 3480 | -s "server hello, max_fragment_length extension" \ |
| 3481 | -c "found max_fragment_length extension" |
| 3482 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3483 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3484 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3485 | run_test "Max fragment length: client 2048, server 512" \ |
| 3486 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3487 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3488 | 0 \ |
| 3489 | -c "Maximum input fragment length is 2048" \ |
| 3490 | -c "Maximum output fragment length is 2048" \ |
| 3491 | -s "Maximum input fragment length is 2048" \ |
| 3492 | -s "Maximum output fragment length is 512" \ |
| 3493 | -c "client hello, adding max_fragment_length extension" \ |
| 3494 | -s "found max fragment length extension" \ |
| 3495 | -s "server hello, max_fragment_length extension" \ |
| 3496 | -c "found max_fragment_length extension" |
| 3497 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3498 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3499 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3500 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3501 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3502 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3503 | 0 \ |
| 3504 | -c "Maximum input fragment length is 2048" \ |
| 3505 | -c "Maximum output fragment length is 2048" \ |
| 3506 | -s "Maximum input fragment length is 2048" \ |
| 3507 | -s "Maximum output fragment length is 1024" \ |
| 3508 | -c "client hello, adding max_fragment_length extension" \ |
| 3509 | -s "found max fragment length extension" \ |
| 3510 | -s "server hello, max_fragment_length extension" \ |
| 3511 | -c "found max_fragment_length extension" |
| 3512 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3513 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3514 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3515 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3516 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3517 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3518 | 0 \ |
| 3519 | -c "Maximum input fragment length is 2048" \ |
| 3520 | -c "Maximum output fragment length is 2048" \ |
| 3521 | -s "Maximum input fragment length is 2048" \ |
| 3522 | -s "Maximum output fragment length is 2048" \ |
| 3523 | -c "client hello, adding max_fragment_length extension" \ |
| 3524 | -s "found max fragment length extension" \ |
| 3525 | -s "server hello, max_fragment_length extension" \ |
| 3526 | -c "found max_fragment_length extension" |
| 3527 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3528 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3529 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3530 | run_test "Max fragment length: client 4096, server 512" \ |
| 3531 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3532 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3533 | 0 \ |
| 3534 | -c "Maximum input fragment length is 4096" \ |
| 3535 | -c "Maximum output fragment length is 4096" \ |
| 3536 | -s "Maximum input fragment length is 4096" \ |
| 3537 | -s "Maximum output fragment length is 512" \ |
| 3538 | -c "client hello, adding max_fragment_length extension" \ |
| 3539 | -s "found max fragment length extension" \ |
| 3540 | -s "server hello, max_fragment_length extension" \ |
| 3541 | -c "found max_fragment_length extension" |
| 3542 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3543 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3544 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3545 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3546 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3547 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3548 | 0 \ |
| 3549 | -c "Maximum input fragment length is 4096" \ |
| 3550 | -c "Maximum output fragment length is 4096" \ |
| 3551 | -s "Maximum input fragment length is 4096" \ |
| 3552 | -s "Maximum output fragment length is 1024" \ |
| 3553 | -c "client hello, adding max_fragment_length extension" \ |
| 3554 | -s "found max fragment length extension" \ |
| 3555 | -s "server hello, max_fragment_length extension" \ |
| 3556 | -c "found max_fragment_length extension" |
| 3557 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3558 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3559 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3560 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3561 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3562 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3563 | 0 \ |
| 3564 | -c "Maximum input fragment length is 4096" \ |
| 3565 | -c "Maximum output fragment length is 4096" \ |
| 3566 | -s "Maximum input fragment length is 4096" \ |
| 3567 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3568 | -c "client hello, adding max_fragment_length extension" \ |
| 3569 | -s "found max fragment length extension" \ |
| 3570 | -s "server hello, max_fragment_length extension" \ |
| 3571 | -c "found max_fragment_length extension" |
| 3572 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3573 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3574 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3575 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3576 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3577 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3578 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3579 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3580 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3581 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3582 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3583 | -C "client hello, adding max_fragment_length extension" \ |
| 3584 | -S "found max fragment length extension" \ |
| 3585 | -S "server hello, max_fragment_length extension" \ |
| 3586 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3587 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3588 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3589 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3590 | requires_gnutls |
| 3591 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3592 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3593 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3594 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3595 | -c "Maximum input fragment length is 4096" \ |
| 3596 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3597 | -c "client hello, adding max_fragment_length extension" \ |
| 3598 | -c "found max_fragment_length extension" |
| 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, message just fits" \ |
| 3603 | "$P_SRV debug_level=3" \ |
| 3604 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 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 "2048 bytes written in 1 fragments" \ |
| 3615 | -s "2048 bytes read" |
| 3616 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3617 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3618 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3619 | run_test "Max fragment length: client, larger message" \ |
| 3620 | "$P_SRV debug_level=3" \ |
| 3621 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3622 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3623 | -c "Maximum input fragment length is 2048" \ |
| 3624 | -c "Maximum output fragment length is 2048" \ |
| 3625 | -s "Maximum input fragment length is 2048" \ |
| 3626 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3627 | -c "client hello, adding max_fragment_length extension" \ |
| 3628 | -s "found max fragment length extension" \ |
| 3629 | -s "server hello, max_fragment_length extension" \ |
| 3630 | -c "found max_fragment_length extension" \ |
| 3631 | -c "2345 bytes written in 2 fragments" \ |
| 3632 | -s "2048 bytes read" \ |
| 3633 | -s "297 bytes read" |
| 3634 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3635 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3636 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3637 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3638 | "$P_SRV debug_level=3 dtls=1" \ |
| 3639 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3640 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3641 | -c "Maximum input fragment length is 2048" \ |
| 3642 | -c "Maximum output fragment length is 2048" \ |
| 3643 | -s "Maximum input fragment length is 2048" \ |
| 3644 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3645 | -c "client hello, adding max_fragment_length extension" \ |
| 3646 | -s "found max fragment length extension" \ |
| 3647 | -s "server hello, max_fragment_length extension" \ |
| 3648 | -c "found max_fragment_length extension" \ |
| 3649 | -c "fragment larger than.*maximum" |
| 3650 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3651 | # Tests for renegotiation |
| 3652 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3653 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3654 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3655 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3656 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3657 | 0 \ |
| 3658 | -C "client hello, adding renegotiation extension" \ |
| 3659 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3660 | -S "found renegotiation extension" \ |
| 3661 | -s "server hello, secure renegotiation extension" \ |
| 3662 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3663 | -C "=> renegotiate" \ |
| 3664 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3665 | -S "write hello request" |
| 3666 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3667 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3668 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3669 | "$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] | 3670 | "$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] | 3671 | 0 \ |
| 3672 | -c "client hello, adding renegotiation extension" \ |
| 3673 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3674 | -s "found renegotiation extension" \ |
| 3675 | -s "server hello, secure renegotiation extension" \ |
| 3676 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3677 | -c "=> renegotiate" \ |
| 3678 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3679 | -S "write hello request" |
| 3680 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3681 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3682 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3683 | "$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] | 3684 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 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" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3691 | -c "=> renegotiate" \ |
| 3692 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3693 | -s "write hello request" |
| 3694 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3695 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3696 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3697 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3698 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3699 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3700 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3701 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3702 | 0 \ |
| 3703 | -c "client hello, adding renegotiation extension" \ |
| 3704 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3705 | -s "found renegotiation extension" \ |
| 3706 | -s "server hello, secure renegotiation extension" \ |
| 3707 | -c "found renegotiation extension" \ |
| 3708 | -c "=> renegotiate" \ |
| 3709 | -s "=> renegotiate" \ |
| 3710 | -S "write hello request" \ |
| 3711 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3712 | |
| 3713 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3714 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3715 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3716 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3717 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3718 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3719 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3720 | 0 \ |
| 3721 | -c "client hello, adding renegotiation extension" \ |
| 3722 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3723 | -s "found renegotiation extension" \ |
| 3724 | -s "server hello, secure renegotiation extension" \ |
| 3725 | -c "found renegotiation extension" \ |
| 3726 | -c "=> renegotiate" \ |
| 3727 | -s "=> renegotiate" \ |
| 3728 | -s "write hello request" \ |
| 3729 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3730 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3731 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3732 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3733 | "$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] | 3734 | "$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] | 3735 | 0 \ |
| 3736 | -c "client hello, adding renegotiation extension" \ |
| 3737 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3738 | -s "found renegotiation extension" \ |
| 3739 | -s "server hello, secure renegotiation extension" \ |
| 3740 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3741 | -c "=> renegotiate" \ |
| 3742 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3743 | -s "write hello request" |
| 3744 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3745 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3746 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3747 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3748 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3749 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3750 | "$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" \ |
| 3751 | 0 \ |
| 3752 | -c "Maximum input fragment length is 2048" \ |
| 3753 | -c "Maximum output fragment length is 2048" \ |
| 3754 | -s "Maximum input fragment length is 2048" \ |
| 3755 | -s "Maximum output fragment length is 512" \ |
| 3756 | -c "client hello, adding max_fragment_length extension" \ |
| 3757 | -s "found max fragment length extension" \ |
| 3758 | -s "server hello, max_fragment_length extension" \ |
| 3759 | -c "found max_fragment_length extension" \ |
| 3760 | -c "client hello, adding renegotiation extension" \ |
| 3761 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3762 | -s "found renegotiation extension" \ |
| 3763 | -s "server hello, secure renegotiation extension" \ |
| 3764 | -c "found renegotiation extension" \ |
| 3765 | -c "=> renegotiate" \ |
| 3766 | -s "=> renegotiate" \ |
| 3767 | -s "write hello request" |
| 3768 | |
| 3769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3770 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3771 | "$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] | 3772 | "$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] | 3773 | 1 \ |
| 3774 | -c "client hello, adding renegotiation extension" \ |
| 3775 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3776 | -S "found renegotiation extension" \ |
| 3777 | -s "server hello, secure renegotiation extension" \ |
| 3778 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3779 | -c "=> renegotiate" \ |
| 3780 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3781 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3782 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3783 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3784 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3785 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3786 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3787 | "$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] | 3788 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [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" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3795 | -C "=> renegotiate" \ |
| 3796 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3797 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3798 | -S "SSL - An unexpected message was received from our peer" \ |
| 3799 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3800 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3801 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3802 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3803 | "$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] | 3804 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3805 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3806 | 0 \ |
| 3807 | -C "client hello, adding renegotiation extension" \ |
| 3808 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3809 | -S "found renegotiation extension" \ |
| 3810 | -s "server hello, secure renegotiation extension" \ |
| 3811 | -c "found renegotiation extension" \ |
| 3812 | -C "=> renegotiate" \ |
| 3813 | -S "=> renegotiate" \ |
| 3814 | -s "write hello request" \ |
| 3815 | -S "SSL - An unexpected message was received from our peer" \ |
| 3816 | -S "failed" |
| 3817 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3818 | # delay 2 for 1 alert record + 1 application data record |
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 2" \ |
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=2 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" \ |
| 3833 | -S "SSL - An unexpected message was received from our peer" \ |
| 3834 | -S "failed" |
| 3835 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3836 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3837 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3838 | "$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] | 3839 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3840 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3841 | 0 \ |
| 3842 | -C "client hello, adding renegotiation extension" \ |
| 3843 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3844 | -S "found renegotiation extension" \ |
| 3845 | -s "server hello, secure renegotiation extension" \ |
| 3846 | -c "found renegotiation extension" \ |
| 3847 | -C "=> renegotiate" \ |
| 3848 | -S "=> renegotiate" \ |
| 3849 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3850 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3851 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3852 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3853 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3854 | "$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] | 3855 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3856 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3857 | 0 \ |
| 3858 | -c "client hello, adding renegotiation extension" \ |
| 3859 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3860 | -s "found renegotiation extension" \ |
| 3861 | -s "server hello, secure renegotiation extension" \ |
| 3862 | -c "found renegotiation extension" \ |
| 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 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3869 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3870 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3871 | "$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] | 3872 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3873 | 0 \ |
| 3874 | -C "client hello, adding renegotiation extension" \ |
| 3875 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3876 | -S "found renegotiation extension" \ |
| 3877 | -s "server hello, secure renegotiation extension" \ |
| 3878 | -c "found renegotiation extension" \ |
| 3879 | -S "record counter limit reached: renegotiate" \ |
| 3880 | -C "=> renegotiate" \ |
| 3881 | -S "=> renegotiate" \ |
| 3882 | -S "write hello request" \ |
| 3883 | -S "SSL - An unexpected message was received from our peer" \ |
| 3884 | -S "failed" |
| 3885 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3886 | # one extra exchange to be able to complete renego |
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, just above 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=4 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, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3906 | "$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] | 3907 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 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 | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3922 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3923 | "$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] | 3924 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 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 | -S "record counter limit reached: renegotiate" \ |
| 3932 | -C "=> renegotiate" \ |
| 3933 | -S "=> renegotiate" \ |
| 3934 | -S "write hello request" \ |
| 3935 | -S "SSL - An unexpected message was received from our peer" \ |
| 3936 | -S "failed" |
| 3937 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3938 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3939 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3940 | "$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] | 3941 | "$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] | 3942 | 0 \ |
| 3943 | -c "client hello, adding renegotiation extension" \ |
| 3944 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3945 | -s "found renegotiation extension" \ |
| 3946 | -s "server hello, secure renegotiation extension" \ |
| 3947 | -c "found renegotiation extension" \ |
| 3948 | -c "=> renegotiate" \ |
| 3949 | -s "=> renegotiate" \ |
| 3950 | -S "write hello request" |
| 3951 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3952 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3953 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3954 | "$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] | 3955 | "$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] | 3956 | 0 \ |
| 3957 | -c "client hello, adding renegotiation extension" \ |
| 3958 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3959 | -s "found renegotiation extension" \ |
| 3960 | -s "server hello, secure renegotiation extension" \ |
| 3961 | -c "found renegotiation extension" \ |
| 3962 | -c "=> renegotiate" \ |
| 3963 | -s "=> renegotiate" \ |
| 3964 | -s "write hello request" |
| 3965 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3966 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3967 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3968 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3969 | "$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] | 3970 | 0 \ |
| 3971 | -c "client hello, adding renegotiation extension" \ |
| 3972 | -c "found renegotiation extension" \ |
| 3973 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3974 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3975 | -C "error" \ |
| 3976 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3977 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3978 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3979 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3980 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3981 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3982 | "$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] | 3983 | 0 \ |
| 3984 | -c "client hello, adding renegotiation extension" \ |
| 3985 | -c "found renegotiation extension" \ |
| 3986 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3987 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3988 | -C "error" \ |
| 3989 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3990 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3991 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3992 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3993 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3994 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3995 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3996 | 1 \ |
| 3997 | -c "client hello, adding renegotiation extension" \ |
| 3998 | -C "found renegotiation extension" \ |
| 3999 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4000 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4001 | -c "error" \ |
| 4002 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4003 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4004 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4005 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4006 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 4007 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4008 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4009 | allow_legacy=0" \ |
| 4010 | 1 \ |
| 4011 | -c "client hello, adding renegotiation extension" \ |
| 4012 | -C "found renegotiation extension" \ |
| 4013 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4014 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4015 | -c "error" \ |
| 4016 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4017 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4018 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4019 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4020 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 4021 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4022 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4023 | allow_legacy=1" \ |
| 4024 | 0 \ |
| 4025 | -c "client hello, adding renegotiation extension" \ |
| 4026 | -C "found renegotiation extension" \ |
| 4027 | -c "=> renegotiate" \ |
| 4028 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4029 | -C "error" \ |
| 4030 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4031 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4032 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4033 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4034 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4035 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4036 | 0 \ |
| 4037 | -c "client hello, adding renegotiation extension" \ |
| 4038 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4039 | -s "found renegotiation extension" \ |
| 4040 | -s "server hello, secure renegotiation extension" \ |
| 4041 | -c "found renegotiation extension" \ |
| 4042 | -c "=> renegotiate" \ |
| 4043 | -s "=> renegotiate" \ |
| 4044 | -S "write hello request" |
| 4045 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4046 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4047 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4048 | "$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] | 4049 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4050 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4051 | 0 \ |
| 4052 | -c "client hello, adding renegotiation extension" \ |
| 4053 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4054 | -s "found renegotiation extension" \ |
| 4055 | -s "server hello, secure renegotiation extension" \ |
| 4056 | -c "found renegotiation extension" \ |
| 4057 | -c "=> renegotiate" \ |
| 4058 | -s "=> renegotiate" \ |
| 4059 | -s "write hello request" |
| 4060 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4061 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4062 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4063 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4064 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4065 | 0 \ |
| 4066 | -c "client hello, adding renegotiation extension" \ |
| 4067 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4068 | -s "found renegotiation extension" \ |
| 4069 | -s "server hello, secure renegotiation extension" \ |
| 4070 | -s "record counter limit reached: renegotiate" \ |
| 4071 | -c "=> renegotiate" \ |
| 4072 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4073 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4074 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4075 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4076 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4077 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4078 | "$G_SRV -u --mtu 4096" \ |
| 4079 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4080 | 0 \ |
| 4081 | -c "client hello, adding renegotiation extension" \ |
| 4082 | -c "found renegotiation extension" \ |
| 4083 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4084 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4085 | -C "error" \ |
| 4086 | -s "Extra-header:" |
| 4087 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4088 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 4089 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4090 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4091 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4092 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4093 | "$P_CLI debug_level=3" \ |
| 4094 | 0 \ |
| 4095 | -c "found renegotiation extension" \ |
| 4096 | -C "error" \ |
| 4097 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4098 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4099 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4100 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4101 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4102 | "$P_CLI debug_level=3" \ |
| 4103 | 0 \ |
| 4104 | -C "found renegotiation extension" \ |
| 4105 | -C "error" \ |
| 4106 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 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 server unsafe, client break legacy" \ |
| 4110 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4111 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4112 | 1 \ |
| 4113 | -C "found renegotiation extension" \ |
| 4114 | -c "error" \ |
| 4115 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4116 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4117 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4118 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4119 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4120 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4121 | 0 \ |
| 4122 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4123 | -s "server hello, secure renegotiation extension" |
| 4124 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4125 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4126 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4127 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4128 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4129 | 0 \ |
| 4130 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4131 | -S "server hello, secure renegotiation extension" |
| 4132 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4133 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4134 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4135 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4136 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4137 | 1 \ |
| 4138 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4139 | -S "server hello, secure renegotiation extension" |
| 4140 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4141 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4142 | |
| 4143 | requires_gnutls |
| 4144 | run_test "DER format: no trailing bytes" \ |
| 4145 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4146 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4147 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4148 | 0 \ |
| 4149 | -c "Handshake was completed" \ |
| 4150 | |
| 4151 | requires_gnutls |
| 4152 | run_test "DER format: with a trailing zero byte" \ |
| 4153 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4154 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4155 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4156 | 0 \ |
| 4157 | -c "Handshake was completed" \ |
| 4158 | |
| 4159 | requires_gnutls |
| 4160 | run_test "DER format: with a trailing random byte" \ |
| 4161 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4162 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4163 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4164 | 0 \ |
| 4165 | -c "Handshake was completed" \ |
| 4166 | |
| 4167 | requires_gnutls |
| 4168 | run_test "DER format: with 2 trailing random bytes" \ |
| 4169 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4170 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4171 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4172 | 0 \ |
| 4173 | -c "Handshake was completed" \ |
| 4174 | |
| 4175 | requires_gnutls |
| 4176 | run_test "DER format: with 4 trailing random bytes" \ |
| 4177 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4178 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4179 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4180 | 0 \ |
| 4181 | -c "Handshake was completed" \ |
| 4182 | |
| 4183 | requires_gnutls |
| 4184 | run_test "DER format: with 8 trailing random bytes" \ |
| 4185 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4186 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4187 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4188 | 0 \ |
| 4189 | -c "Handshake was completed" \ |
| 4190 | |
| 4191 | requires_gnutls |
| 4192 | run_test "DER format: with 9 trailing random bytes" \ |
| 4193 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4194 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4195 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4196 | 0 \ |
| 4197 | -c "Handshake was completed" \ |
| 4198 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4199 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4200 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4201 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4202 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4203 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4204 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4205 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4206 | 1 \ |
| 4207 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4208 | -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] | 4209 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4210 | -c "X509 - Certificate verification failed" |
| 4211 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4212 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4213 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4214 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4215 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4216 | 0 \ |
| 4217 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4218 | -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] | 4219 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4220 | -C "X509 - Certificate verification failed" |
| 4221 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4222 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4223 | "$P_SRV" \ |
| 4224 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4225 | 0 \ |
| 4226 | -c "x509_verify_cert() returned" \ |
| 4227 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4228 | -c "! Certificate verification flags"\ |
| 4229 | -C "! mbedtls_ssl_handshake returned" \ |
| 4230 | -C "X509 - Certificate verification failed" \ |
| 4231 | -C "SSL - No CA Chain is set, but required to operate" |
| 4232 | |
| 4233 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4234 | "$P_SRV" \ |
| 4235 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4236 | 1 \ |
| 4237 | -c "x509_verify_cert() returned" \ |
| 4238 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4239 | -c "! Certificate verification flags"\ |
| 4240 | -c "! mbedtls_ssl_handshake returned" \ |
| 4241 | -c "SSL - No CA Chain is set, but required to operate" |
| 4242 | |
| 4243 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4244 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4245 | # the client informs the server about the supported curves - it does, though, in the |
| 4246 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4247 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4248 | # different means to have the server ignoring the client's supported curve list. |
| 4249 | |
| 4250 | requires_config_enabled MBEDTLS_ECP_C |
| 4251 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4252 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4253 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4254 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4255 | 1 \ |
| 4256 | -c "bad certificate (EC key curve)"\ |
| 4257 | -c "! Certificate verification flags"\ |
| 4258 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4259 | |
| 4260 | requires_config_enabled MBEDTLS_ECP_C |
| 4261 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4262 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4263 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4264 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4265 | 1 \ |
| 4266 | -c "bad certificate (EC key curve)"\ |
| 4267 | -c "! Certificate verification flags"\ |
| 4268 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4269 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4270 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4271 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4272 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4273 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4274 | 0 \ |
| 4275 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4276 | -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] | 4277 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4278 | -C "X509 - Certificate verification failed" |
| 4279 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4280 | run_test "Authentication: client SHA256, server required" \ |
| 4281 | "$P_SRV auth_mode=required" \ |
| 4282 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4283 | key_file=data_files/server6.key \ |
| 4284 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4285 | 0 \ |
| 4286 | -c "Supported Signature Algorithm found: 4," \ |
| 4287 | -c "Supported Signature Algorithm found: 5," |
| 4288 | |
| 4289 | run_test "Authentication: client SHA384, server required" \ |
| 4290 | "$P_SRV auth_mode=required" \ |
| 4291 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4292 | key_file=data_files/server6.key \ |
| 4293 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4294 | 0 \ |
| 4295 | -c "Supported Signature Algorithm found: 4," \ |
| 4296 | -c "Supported Signature Algorithm found: 5," |
| 4297 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4298 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4299 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 4300 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 4301 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 4302 | key_file=data_files/server5.key" \ |
| 4303 | 1 \ |
| 4304 | -S "skip write certificate request" \ |
| 4305 | -C "skip parse certificate request" \ |
| 4306 | -c "got a certificate request" \ |
| 4307 | -c "got no certificate to send" \ |
| 4308 | -S "x509_verify_cert() returned" \ |
| 4309 | -s "client has no certificate" \ |
| 4310 | -s "! mbedtls_ssl_handshake returned" \ |
| 4311 | -c "! mbedtls_ssl_handshake returned" \ |
| 4312 | -s "No client certification received from the client, but required by the authentication mode" |
| 4313 | |
| 4314 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4315 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4316 | "$P_CLI debug_level=3 crt_file=none \ |
| 4317 | key_file=data_files/server5.key" \ |
| 4318 | 1 \ |
| 4319 | -S "skip write certificate request" \ |
| 4320 | -C "skip parse certificate request" \ |
| 4321 | -c "got a certificate request" \ |
| 4322 | -c "= write certificate$" \ |
| 4323 | -C "skip write certificate$" \ |
| 4324 | -S "x509_verify_cert() returned" \ |
| 4325 | -s "client has no certificate" \ |
| 4326 | -s "! mbedtls_ssl_handshake returned" \ |
| 4327 | -c "! mbedtls_ssl_handshake returned" \ |
| 4328 | -s "No client certification received from the client, but required by the authentication mode" |
| 4329 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4330 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4331 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4332 | "$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] | 4333 | key_file=data_files/server5.key" \ |
| 4334 | 1 \ |
| 4335 | -S "skip write certificate request" \ |
| 4336 | -C "skip parse certificate request" \ |
| 4337 | -c "got a certificate request" \ |
| 4338 | -C "skip write certificate" \ |
| 4339 | -C "skip write certificate verify" \ |
| 4340 | -S "skip parse certificate verify" \ |
| 4341 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4342 | -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] | 4343 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4344 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4345 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4346 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4347 | # We don't check that the client receives the alert because it might |
| 4348 | # detect that its write end of the connection is closed and abort |
| 4349 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4350 | |
Gilles Peskine | 8c681b7 | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4351 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4352 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4353 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 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" \ |
| 4363 | -S "! The certificate is not correctly signed" \ |
| 4364 | -S "X509 - Certificate verification failed" |
| 4365 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4366 | run_test "Authentication: client cert not trusted, server required" \ |
| 4367 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4368 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4369 | key_file=data_files/server5.key" \ |
| 4370 | 1 \ |
| 4371 | -S "skip write certificate request" \ |
| 4372 | -C "skip parse certificate request" \ |
| 4373 | -c "got a certificate request" \ |
| 4374 | -C "skip write certificate" \ |
| 4375 | -C "skip write certificate verify" \ |
| 4376 | -S "skip parse certificate verify" \ |
| 4377 | -s "x509_verify_cert() returned" \ |
| 4378 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4379 | -s "! mbedtls_ssl_handshake returned" \ |
| 4380 | -c "! mbedtls_ssl_handshake returned" \ |
| 4381 | -s "X509 - Certificate verification failed" |
| 4382 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4383 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4384 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4385 | "$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] | 4386 | key_file=data_files/server5.key" \ |
| 4387 | 0 \ |
| 4388 | -S "skip write certificate request" \ |
| 4389 | -C "skip parse certificate request" \ |
| 4390 | -c "got a certificate request" \ |
| 4391 | -C "skip write certificate" \ |
| 4392 | -C "skip write certificate verify" \ |
| 4393 | -S "skip parse certificate verify" \ |
| 4394 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4395 | -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] | 4396 | -S "! mbedtls_ssl_handshake returned" \ |
| 4397 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4398 | -S "X509 - Certificate verification failed" |
| 4399 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4400 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4401 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4402 | "$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] | 4403 | key_file=data_files/server5.key" \ |
| 4404 | 0 \ |
| 4405 | -s "skip write certificate request" \ |
| 4406 | -C "skip parse certificate request" \ |
| 4407 | -c "got no certificate request" \ |
| 4408 | -c "skip write certificate" \ |
| 4409 | -c "skip write certificate verify" \ |
| 4410 | -s "skip parse certificate verify" \ |
| 4411 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4412 | -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] | 4413 | -S "! mbedtls_ssl_handshake returned" \ |
| 4414 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4415 | -S "X509 - Certificate verification failed" |
| 4416 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4417 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4418 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4419 | "$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] | 4420 | 0 \ |
| 4421 | -S "skip write certificate request" \ |
| 4422 | -C "skip parse certificate request" \ |
| 4423 | -c "got a certificate request" \ |
| 4424 | -C "skip write certificate$" \ |
| 4425 | -C "got no certificate to send" \ |
| 4426 | -S "SSLv3 client has no certificate" \ |
| 4427 | -c "skip write certificate verify" \ |
| 4428 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4429 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4430 | -S "! mbedtls_ssl_handshake returned" \ |
| 4431 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4432 | -S "X509 - Certificate verification failed" |
| 4433 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4434 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4435 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4436 | "$O_CLI" \ |
| 4437 | 0 \ |
| 4438 | -S "skip write certificate request" \ |
| 4439 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4440 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4441 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4442 | -S "X509 - Certificate verification failed" |
| 4443 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4444 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4445 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4446 | "$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] | 4447 | 0 \ |
| 4448 | -C "skip parse certificate request" \ |
| 4449 | -c "got a certificate request" \ |
| 4450 | -C "skip write certificate$" \ |
| 4451 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4452 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4453 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4454 | run_test "Authentication: client no cert, openssl server required" \ |
| 4455 | "$O_SRV -Verify 10" \ |
| 4456 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4457 | 1 \ |
| 4458 | -C "skip parse certificate request" \ |
| 4459 | -c "got a certificate request" \ |
| 4460 | -C "skip write certificate$" \ |
| 4461 | -c "skip write certificate verify" \ |
| 4462 | -c "! mbedtls_ssl_handshake returned" |
| 4463 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4464 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4465 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4466 | "$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] | 4467 | "$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] | 4468 | 0 \ |
| 4469 | -S "skip write certificate request" \ |
| 4470 | -C "skip parse certificate request" \ |
| 4471 | -c "got a certificate request" \ |
| 4472 | -C "skip write certificate$" \ |
| 4473 | -c "skip write certificate verify" \ |
| 4474 | -c "got no certificate to send" \ |
| 4475 | -s "SSLv3 client has no certificate" \ |
| 4476 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4477 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4478 | -S "! mbedtls_ssl_handshake returned" \ |
| 4479 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4480 | -S "X509 - Certificate verification failed" |
| 4481 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4482 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4483 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4484 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4485 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4486 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4487 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4488 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4489 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4490 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4491 | # 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] | 4492 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4493 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4494 | run_test "Authentication: server max_int chain, client default" \ |
| 4495 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4496 | key_file=data_files/dir-maxpath/09.key" \ |
| 4497 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4498 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4499 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4500 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4501 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4502 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4503 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4504 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4505 | key_file=data_files/dir-maxpath/10.key" \ |
| 4506 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4507 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4508 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4509 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4510 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4511 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4512 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4513 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4514 | key_file=data_files/dir-maxpath/10.key" \ |
| 4515 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4516 | auth_mode=optional" \ |
| 4517 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4518 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4519 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4520 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4521 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4522 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4523 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4524 | key_file=data_files/dir-maxpath/10.key" \ |
| 4525 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4526 | auth_mode=none" \ |
| 4527 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4528 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4529 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4530 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4531 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4532 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4533 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4534 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4535 | key_file=data_files/dir-maxpath/10.key" \ |
| 4536 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4537 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4538 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4539 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4540 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4541 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4542 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4543 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4544 | key_file=data_files/dir-maxpath/10.key" \ |
| 4545 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4546 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4547 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4548 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4549 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4550 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4551 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4552 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4553 | key_file=data_files/dir-maxpath/10.key" \ |
| 4554 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4555 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4556 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4557 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4558 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4559 | run_test "Authentication: client max_int chain, server required" \ |
| 4560 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4561 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4562 | key_file=data_files/dir-maxpath/09.key" \ |
| 4563 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4564 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4565 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4566 | # Tests for CA list in CertificateRequest messages |
| 4567 | |
| 4568 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4569 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4570 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4571 | key_file=data_files/server6.key" \ |
| 4572 | 0 \ |
| 4573 | -s "requested DN" |
| 4574 | |
| 4575 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4576 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4577 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4578 | key_file=data_files/server6.key" \ |
| 4579 | 0 \ |
| 4580 | -S "requested DN" |
| 4581 | |
| 4582 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4583 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4584 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4585 | key_file=data_files/server5.key" \ |
| 4586 | 1 \ |
| 4587 | -S "requested DN" \ |
| 4588 | -s "x509_verify_cert() returned" \ |
| 4589 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4590 | -s "! mbedtls_ssl_handshake returned" \ |
| 4591 | -c "! mbedtls_ssl_handshake returned" \ |
| 4592 | -s "X509 - Certificate verification failed" |
| 4593 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4594 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4595 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4596 | |
| 4597 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4598 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4599 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4600 | key_file=data_files/server5.key" \ |
| 4601 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4602 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4603 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4604 | -c "x509_verify_cert() returned" \ |
| 4605 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4606 | -c "! mbedtls_ssl_handshake returned" \ |
| 4607 | -c "X509 - Certificate verification failed" |
| 4608 | |
| 4609 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4610 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4611 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4612 | key_file=data_files/server5.key" \ |
| 4613 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4614 | 0 \ |
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 "x509_verify_cert() returned" \ |
| 4617 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4618 | -C "! mbedtls_ssl_handshake returned" \ |
| 4619 | -C "X509 - Certificate verification failed" |
| 4620 | |
| 4621 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4622 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4623 | # the client informs the server about the supported curves - it does, though, in the |
| 4624 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4625 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4626 | # different means to have the server ignoring the client's supported curve list. |
| 4627 | |
| 4628 | requires_config_enabled MBEDTLS_ECP_C |
| 4629 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4630 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4631 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4632 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4633 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4634 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4635 | -c "use CA callback for X.509 CRT verification" \ |
| 4636 | -c "bad certificate (EC key curve)" \ |
| 4637 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4638 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4639 | |
| 4640 | requires_config_enabled MBEDTLS_ECP_C |
| 4641 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4642 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4643 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4644 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4645 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4646 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4647 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4648 | -c "bad certificate (EC key curve)"\ |
| 4649 | -c "! Certificate verification flags"\ |
| 4650 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4651 | |
| 4652 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4653 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4654 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4655 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4656 | key_file=data_files/server6.key \ |
| 4657 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4658 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4659 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4660 | -c "Supported Signature Algorithm found: 4," \ |
| 4661 | -c "Supported Signature Algorithm found: 5," |
| 4662 | |
| 4663 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4664 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4665 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4666 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4667 | key_file=data_files/server6.key \ |
| 4668 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4669 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4670 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4671 | -c "Supported Signature Algorithm found: 4," \ |
| 4672 | -c "Supported Signature Algorithm found: 5," |
| 4673 | |
| 4674 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4675 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4676 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4677 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4678 | key_file=data_files/server5.key" \ |
| 4679 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4680 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4681 | -S "skip write certificate request" \ |
| 4682 | -C "skip parse certificate request" \ |
| 4683 | -c "got a certificate request" \ |
| 4684 | -C "skip write certificate" \ |
| 4685 | -C "skip write certificate verify" \ |
| 4686 | -S "skip parse certificate verify" \ |
| 4687 | -s "x509_verify_cert() returned" \ |
| 4688 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4689 | -s "! mbedtls_ssl_handshake returned" \ |
| 4690 | -s "send alert level=2 message=48" \ |
| 4691 | -c "! mbedtls_ssl_handshake returned" \ |
| 4692 | -s "X509 - Certificate verification failed" |
| 4693 | # We don't check that the client receives the alert because it might |
| 4694 | # detect that its write end of the connection is closed and abort |
| 4695 | # before reading the alert message. |
| 4696 | |
| 4697 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4698 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4699 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4700 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4701 | key_file=data_files/server5.key" \ |
| 4702 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4703 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4704 | -S "skip write certificate request" \ |
| 4705 | -C "skip parse certificate request" \ |
| 4706 | -c "got a certificate request" \ |
| 4707 | -C "skip write certificate" \ |
| 4708 | -C "skip write certificate verify" \ |
| 4709 | -S "skip parse certificate verify" \ |
| 4710 | -s "x509_verify_cert() returned" \ |
| 4711 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4712 | -s "! mbedtls_ssl_handshake returned" \ |
| 4713 | -c "! mbedtls_ssl_handshake returned" \ |
| 4714 | -s "X509 - Certificate verification failed" |
| 4715 | |
| 4716 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4717 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4718 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4719 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4720 | key_file=data_files/server5.key" \ |
| 4721 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4722 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4723 | -S "skip write certificate request" \ |
| 4724 | -C "skip parse certificate request" \ |
| 4725 | -c "got a certificate request" \ |
| 4726 | -C "skip write certificate" \ |
| 4727 | -C "skip write certificate verify" \ |
| 4728 | -S "skip parse certificate verify" \ |
| 4729 | -s "x509_verify_cert() returned" \ |
| 4730 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4731 | -S "! mbedtls_ssl_handshake returned" \ |
| 4732 | -C "! mbedtls_ssl_handshake returned" \ |
| 4733 | -S "X509 - Certificate verification failed" |
| 4734 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4735 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4736 | requires_full_size_output_buffer |
| 4737 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4738 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4739 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4740 | key_file=data_files/dir-maxpath/09.key" \ |
| 4741 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4742 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4743 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4744 | -C "X509 - A fatal error occurred" |
| 4745 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4746 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4747 | requires_full_size_output_buffer |
| 4748 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4749 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4750 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4751 | key_file=data_files/dir-maxpath/10.key" \ |
| 4752 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4753 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4754 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4755 | -c "X509 - A fatal error occurred" |
| 4756 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4757 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4758 | requires_full_size_output_buffer |
| 4759 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4760 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4761 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4762 | key_file=data_files/dir-maxpath/10.key" \ |
| 4763 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4764 | debug_level=3 auth_mode=optional" \ |
| 4765 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4766 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4767 | -c "X509 - A fatal error occurred" |
| 4768 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4769 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4770 | requires_full_size_output_buffer |
| 4771 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4772 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4773 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4774 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4775 | key_file=data_files/dir-maxpath/10.key" \ |
| 4776 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4777 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4778 | -s "X509 - A fatal error occurred" |
| 4779 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4780 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4781 | requires_full_size_output_buffer |
| 4782 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4783 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4784 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4785 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4786 | key_file=data_files/dir-maxpath/10.key" \ |
| 4787 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4788 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4789 | -s "X509 - A fatal error occurred" |
| 4790 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4791 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4792 | requires_full_size_output_buffer |
| 4793 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4794 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4795 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4796 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4797 | key_file=data_files/dir-maxpath/09.key" \ |
| 4798 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4799 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4800 | -S "X509 - A fatal error occurred" |
| 4801 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4802 | # Tests for certificate selection based on SHA verson |
| 4803 | |
| 4804 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4805 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4806 | key_file=data_files/server5.key \ |
| 4807 | crt_file2=data_files/server5-sha1.crt \ |
| 4808 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 4809 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4810 | 0 \ |
| 4811 | -c "signed using.*ECDSA with SHA256" \ |
| 4812 | -C "signed using.*ECDSA with SHA1" |
| 4813 | |
| 4814 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 4815 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4816 | key_file=data_files/server5.key \ |
| 4817 | crt_file2=data_files/server5-sha1.crt \ |
| 4818 | key_file2=data_files/server5.key" \ |
| 4819 | "$P_CLI force_version=tls1_1" \ |
| 4820 | 0 \ |
| 4821 | -C "signed using.*ECDSA with SHA256" \ |
| 4822 | -c "signed using.*ECDSA with SHA1" |
| 4823 | |
| 4824 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 4825 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4826 | key_file=data_files/server5.key \ |
| 4827 | crt_file2=data_files/server5-sha1.crt \ |
| 4828 | key_file2=data_files/server5.key" \ |
| 4829 | "$P_CLI force_version=tls1" \ |
| 4830 | 0 \ |
| 4831 | -C "signed using.*ECDSA with SHA256" \ |
| 4832 | -c "signed using.*ECDSA with SHA1" |
| 4833 | |
| 4834 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 4835 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4836 | key_file=data_files/server5.key \ |
| 4837 | crt_file2=data_files/server6.crt \ |
| 4838 | key_file2=data_files/server6.key" \ |
| 4839 | "$P_CLI force_version=tls1_1" \ |
| 4840 | 0 \ |
| 4841 | -c "serial number.*09" \ |
| 4842 | -c "signed using.*ECDSA with SHA256" \ |
| 4843 | -C "signed using.*ECDSA with SHA1" |
| 4844 | |
| 4845 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 4846 | "$P_SRV crt_file=data_files/server6.crt \ |
| 4847 | key_file=data_files/server6.key \ |
| 4848 | crt_file2=data_files/server5.crt \ |
| 4849 | key_file2=data_files/server5.key" \ |
| 4850 | "$P_CLI force_version=tls1_1" \ |
| 4851 | 0 \ |
| 4852 | -c "serial number.*0A" \ |
| 4853 | -c "signed using.*ECDSA with SHA256" \ |
| 4854 | -C "signed using.*ECDSA with SHA1" |
| 4855 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4856 | # tests for SNI |
| 4857 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4858 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4859 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4860 | 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] | 4861 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4862 | 0 \ |
| 4863 | -S "parse ServerName extension" \ |
| 4864 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4865 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4866 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4867 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4868 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4869 | 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] | 4870 | 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] | 4871 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4872 | 0 \ |
| 4873 | -s "parse ServerName extension" \ |
| 4874 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4875 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4876 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4877 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4878 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4879 | 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] | 4880 | 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] | 4881 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4882 | 0 \ |
| 4883 | -s "parse ServerName extension" \ |
| 4884 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4885 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4886 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4887 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4888 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4889 | 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] | 4890 | 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] | 4891 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4892 | 1 \ |
| 4893 | -s "parse ServerName extension" \ |
| 4894 | -s "ssl_sni_wrapper() returned" \ |
| 4895 | -s "mbedtls_ssl_handshake returned" \ |
| 4896 | -c "mbedtls_ssl_handshake returned" \ |
| 4897 | -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] | 4898 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4899 | run_test "SNI: client auth no override: optional" \ |
| 4900 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4901 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4902 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4903 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4904 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4905 | -S "skip write certificate request" \ |
| 4906 | -C "skip parse certificate request" \ |
| 4907 | -c "got a certificate request" \ |
| 4908 | -C "skip write certificate" \ |
| 4909 | -C "skip write certificate verify" \ |
| 4910 | -S "skip parse certificate verify" |
| 4911 | |
| 4912 | run_test "SNI: client auth override: none -> optional" \ |
| 4913 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4914 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4915 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4916 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4917 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4918 | -S "skip write certificate request" \ |
| 4919 | -C "skip parse certificate request" \ |
| 4920 | -c "got a certificate request" \ |
| 4921 | -C "skip write certificate" \ |
| 4922 | -C "skip write certificate verify" \ |
| 4923 | -S "skip parse certificate verify" |
| 4924 | |
| 4925 | run_test "SNI: client auth override: optional -> none" \ |
| 4926 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4927 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4928 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4929 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4930 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4931 | -s "skip write certificate request" \ |
| 4932 | -C "skip parse certificate request" \ |
| 4933 | -c "got no certificate request" \ |
| 4934 | -c "skip write certificate" \ |
| 4935 | -c "skip write certificate verify" \ |
| 4936 | -s "skip parse certificate verify" |
| 4937 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4938 | run_test "SNI: CA no override" \ |
| 4939 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4940 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4941 | ca_file=data_files/test-ca.crt \ |
| 4942 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4943 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4944 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4945 | 1 \ |
| 4946 | -S "skip write certificate request" \ |
| 4947 | -C "skip parse certificate request" \ |
| 4948 | -c "got a certificate request" \ |
| 4949 | -C "skip write certificate" \ |
| 4950 | -C "skip write certificate verify" \ |
| 4951 | -S "skip parse certificate verify" \ |
| 4952 | -s "x509_verify_cert() returned" \ |
| 4953 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4954 | -S "The certificate has been revoked (is on a CRL)" |
| 4955 | |
| 4956 | run_test "SNI: CA override" \ |
| 4957 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4958 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4959 | ca_file=data_files/test-ca.crt \ |
| 4960 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4961 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4962 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4963 | 0 \ |
| 4964 | -S "skip write certificate request" \ |
| 4965 | -C "skip parse certificate request" \ |
| 4966 | -c "got a certificate request" \ |
| 4967 | -C "skip write certificate" \ |
| 4968 | -C "skip write certificate verify" \ |
| 4969 | -S "skip parse certificate verify" \ |
| 4970 | -S "x509_verify_cert() returned" \ |
| 4971 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4972 | -S "The certificate has been revoked (is on a CRL)" |
| 4973 | |
| 4974 | run_test "SNI: CA override with CRL" \ |
| 4975 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4976 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4977 | ca_file=data_files/test-ca.crt \ |
| 4978 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4979 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4980 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4981 | 1 \ |
| 4982 | -S "skip write certificate request" \ |
| 4983 | -C "skip parse certificate request" \ |
| 4984 | -c "got a certificate request" \ |
| 4985 | -C "skip write certificate" \ |
| 4986 | -C "skip write certificate verify" \ |
| 4987 | -S "skip parse certificate verify" \ |
| 4988 | -s "x509_verify_cert() returned" \ |
| 4989 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4990 | -s "The certificate has been revoked (is on a CRL)" |
| 4991 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4992 | # Tests for SNI and DTLS |
| 4993 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4994 | run_test "SNI: DTLS, no SNI callback" \ |
| 4995 | "$P_SRV debug_level=3 dtls=1 \ |
| 4996 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4997 | "$P_CLI server_name=localhost dtls=1" \ |
| 4998 | 0 \ |
| 4999 | -S "parse ServerName extension" \ |
| 5000 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5001 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5002 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5003 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5004 | "$P_SRV debug_level=3 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,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5007 | "$P_CLI server_name=localhost dtls=1" \ |
| 5008 | 0 \ |
| 5009 | -s "parse ServerName extension" \ |
| 5010 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5011 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5012 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5013 | run_test "SNI: DTLS, matching cert 2" \ |
| 5014 | "$P_SRV debug_level=3 dtls=1 \ |
| 5015 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5016 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5017 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5018 | 0 \ |
| 5019 | -s "parse ServerName extension" \ |
| 5020 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5021 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5022 | |
| 5023 | run_test "SNI: DTLS, no matching cert" \ |
| 5024 | "$P_SRV debug_level=3 dtls=1 \ |
| 5025 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5026 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5027 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5028 | 1 \ |
| 5029 | -s "parse ServerName extension" \ |
| 5030 | -s "ssl_sni_wrapper() returned" \ |
| 5031 | -s "mbedtls_ssl_handshake returned" \ |
| 5032 | -c "mbedtls_ssl_handshake returned" \ |
| 5033 | -c "SSL - A fatal alert message was received from our peer" |
| 5034 | |
| 5035 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5036 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5037 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5038 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5039 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5040 | 0 \ |
| 5041 | -S "skip write certificate request" \ |
| 5042 | -C "skip parse certificate request" \ |
| 5043 | -c "got a certificate request" \ |
| 5044 | -C "skip write certificate" \ |
| 5045 | -C "skip write certificate verify" \ |
| 5046 | -S "skip parse certificate verify" |
| 5047 | |
| 5048 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5049 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5050 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5051 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5052 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5053 | 0 \ |
| 5054 | -S "skip write certificate request" \ |
| 5055 | -C "skip parse certificate request" \ |
| 5056 | -c "got a certificate request" \ |
| 5057 | -C "skip write certificate" \ |
| 5058 | -C "skip write certificate verify" \ |
| 5059 | -S "skip parse certificate verify" |
| 5060 | |
| 5061 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5062 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5063 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5064 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5065 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5066 | 0 \ |
| 5067 | -s "skip write certificate request" \ |
| 5068 | -C "skip parse certificate request" \ |
| 5069 | -c "got no certificate request" \ |
| 5070 | -c "skip write certificate" \ |
| 5071 | -c "skip write certificate verify" \ |
| 5072 | -s "skip parse certificate verify" |
| 5073 | |
| 5074 | run_test "SNI: DTLS, CA no override" \ |
| 5075 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5076 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5077 | ca_file=data_files/test-ca.crt \ |
| 5078 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5079 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5080 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5081 | 1 \ |
| 5082 | -S "skip write certificate request" \ |
| 5083 | -C "skip parse certificate request" \ |
| 5084 | -c "got a certificate request" \ |
| 5085 | -C "skip write certificate" \ |
| 5086 | -C "skip write certificate verify" \ |
| 5087 | -S "skip parse certificate verify" \ |
| 5088 | -s "x509_verify_cert() returned" \ |
| 5089 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5090 | -S "The certificate has been revoked (is on a CRL)" |
| 5091 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5092 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5093 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5094 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5095 | ca_file=data_files/test-ca.crt \ |
| 5096 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5097 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5098 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5099 | 0 \ |
| 5100 | -S "skip write certificate request" \ |
| 5101 | -C "skip parse certificate request" \ |
| 5102 | -c "got a certificate request" \ |
| 5103 | -C "skip write certificate" \ |
| 5104 | -C "skip write certificate verify" \ |
| 5105 | -S "skip parse certificate verify" \ |
| 5106 | -S "x509_verify_cert() returned" \ |
| 5107 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5108 | -S "The certificate has been revoked (is on a CRL)" |
| 5109 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5110 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5111 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5112 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5113 | ca_file=data_files/test-ca.crt \ |
| 5114 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5115 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5116 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5117 | 1 \ |
| 5118 | -S "skip write certificate request" \ |
| 5119 | -C "skip parse certificate request" \ |
| 5120 | -c "got a certificate request" \ |
| 5121 | -C "skip write certificate" \ |
| 5122 | -C "skip write certificate verify" \ |
| 5123 | -S "skip parse certificate verify" \ |
| 5124 | -s "x509_verify_cert() returned" \ |
| 5125 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5126 | -s "The certificate has been revoked (is on a CRL)" |
| 5127 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5128 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5129 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5130 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5131 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5132 | "$P_CLI nbio=2 tickets=0" \ |
| 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: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5139 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5140 | "$P_CLI nbio=2 tickets=0" \ |
| 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: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5147 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5148 | "$P_CLI nbio=2 tickets=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 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5154 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5155 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5156 | "$P_CLI nbio=2 tickets=1" \ |
| 5157 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5158 | -S "mbedtls_ssl_handshake returned" \ |
| 5159 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5160 | -c "Read from server: .* bytes read" |
| 5161 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5162 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5163 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5164 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5165 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5166 | -S "mbedtls_ssl_handshake returned" \ |
| 5167 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5168 | -c "Read from server: .* bytes read" |
| 5169 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5170 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5171 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5172 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5173 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5174 | -S "mbedtls_ssl_handshake returned" \ |
| 5175 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5176 | -c "Read from server: .* bytes read" |
| 5177 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5178 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5179 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5180 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5181 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5182 | -S "mbedtls_ssl_handshake returned" \ |
| 5183 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5184 | -c "Read from server: .* bytes read" |
| 5185 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5186 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5187 | |
| 5188 | run_test "Event-driven I/O: basic handshake" \ |
| 5189 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5190 | "$P_CLI event=1 tickets=0" \ |
| 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: client auth" \ |
| 5197 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5198 | "$P_CLI event=1 tickets=0" \ |
| 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: ticket" \ |
| 5205 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5206 | "$P_CLI event=1 tickets=1" \ |
| 5207 | 0 \ |
| 5208 | -S "mbedtls_ssl_handshake returned" \ |
| 5209 | -C "mbedtls_ssl_handshake returned" \ |
| 5210 | -c "Read from server: .* bytes read" |
| 5211 | |
| 5212 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5213 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5214 | "$P_CLI event=1 tickets=1" \ |
| 5215 | 0 \ |
| 5216 | -S "mbedtls_ssl_handshake returned" \ |
| 5217 | -C "mbedtls_ssl_handshake returned" \ |
| 5218 | -c "Read from server: .* bytes read" |
| 5219 | |
| 5220 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5221 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5222 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5223 | 0 \ |
| 5224 | -S "mbedtls_ssl_handshake returned" \ |
| 5225 | -C "mbedtls_ssl_handshake returned" \ |
| 5226 | -c "Read from server: .* bytes read" |
| 5227 | |
| 5228 | run_test "Event-driven I/O: ticket + resume" \ |
| 5229 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5230 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5231 | 0 \ |
| 5232 | -S "mbedtls_ssl_handshake returned" \ |
| 5233 | -C "mbedtls_ssl_handshake returned" \ |
| 5234 | -c "Read from server: .* bytes read" |
| 5235 | |
| 5236 | run_test "Event-driven I/O: session-id resume" \ |
| 5237 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5238 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5239 | 0 \ |
| 5240 | -S "mbedtls_ssl_handshake returned" \ |
| 5241 | -C "mbedtls_ssl_handshake returned" \ |
| 5242 | -c "Read from server: .* bytes read" |
| 5243 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5244 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5245 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5246 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5247 | 0 \ |
| 5248 | -c "Read from server: .* bytes read" |
| 5249 | |
| 5250 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5251 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5252 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5253 | 0 \ |
| 5254 | -c "Read from server: .* bytes read" |
| 5255 | |
| 5256 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5257 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5258 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5259 | 0 \ |
| 5260 | -c "Read from server: .* bytes read" |
| 5261 | |
| 5262 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5263 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5264 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5265 | 0 \ |
| 5266 | -c "Read from server: .* bytes read" |
| 5267 | |
| 5268 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5269 | "$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] | 5270 | "$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] | 5271 | 0 \ |
| 5272 | -c "Read from server: .* bytes read" |
| 5273 | |
| 5274 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5275 | "$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] | 5276 | "$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] | 5277 | 0 \ |
| 5278 | -c "Read from server: .* bytes read" |
| 5279 | |
| 5280 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5281 | "$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] | 5282 | "$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] | 5283 | 0 \ |
| 5284 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5285 | |
| 5286 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5287 | # During session resumption, the client will send its ApplicationData record |
| 5288 | # within the same datagram as the Finished messages. In this situation, the |
| 5289 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5290 | # because the ApplicationData request has already been queued internally. |
| 5291 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5292 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5293 | "$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] | 5294 | "$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] | 5295 | 0 \ |
| 5296 | -c "Read from server: .* bytes read" |
| 5297 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5298 | # Tests for version negotiation |
| 5299 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5300 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5301 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5302 | "$P_SRV" \ |
| 5303 | "$P_CLI" \ |
| 5304 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5305 | -S "mbedtls_ssl_handshake returned" \ |
| 5306 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5307 | -s "Protocol is TLSv1.2" \ |
| 5308 | -c "Protocol is TLSv1.2" |
| 5309 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5310 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5311 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5312 | "$P_SRV" \ |
| 5313 | "$P_CLI max_version=tls1_1" \ |
| 5314 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5315 | -S "mbedtls_ssl_handshake returned" \ |
| 5316 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5317 | -s "Protocol is TLSv1.1" \ |
| 5318 | -c "Protocol is TLSv1.1" |
| 5319 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5320 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5321 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5322 | "$P_SRV max_version=tls1_1" \ |
| 5323 | "$P_CLI" \ |
| 5324 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5325 | -S "mbedtls_ssl_handshake returned" \ |
| 5326 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5327 | -s "Protocol is TLSv1.1" \ |
| 5328 | -c "Protocol is TLSv1.1" |
| 5329 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5330 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5331 | 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] | 5332 | "$P_SRV max_version=tls1_1" \ |
| 5333 | "$P_CLI max_version=tls1_1" \ |
| 5334 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5335 | -S "mbedtls_ssl_handshake returned" \ |
| 5336 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5337 | -s "Protocol is TLSv1.1" \ |
| 5338 | -c "Protocol is TLSv1.1" |
| 5339 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5340 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5341 | 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] | 5342 | "$P_SRV min_version=tls1_1" \ |
| 5343 | "$P_CLI max_version=tls1_1" \ |
| 5344 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5345 | -S "mbedtls_ssl_handshake returned" \ |
| 5346 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5347 | -s "Protocol is TLSv1.1" \ |
| 5348 | -c "Protocol is TLSv1.1" |
| 5349 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5350 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5351 | 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] | 5352 | "$P_SRV max_version=tls1_1" \ |
| 5353 | "$P_CLI min_version=tls1_1" \ |
| 5354 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5355 | -S "mbedtls_ssl_handshake returned" \ |
| 5356 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5357 | -s "Protocol is TLSv1.1" \ |
| 5358 | -c "Protocol is TLSv1.1" |
| 5359 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5360 | 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] | 5361 | "$P_SRV max_version=tls1_1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5362 | "$P_CLI min_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5363 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5364 | -s "mbedtls_ssl_handshake returned" \ |
| 5365 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5366 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5367 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5368 | 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] | 5369 | "$P_SRV min_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5370 | "$P_CLI max_version=tls1_1" \ |
| 5371 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5372 | -s "mbedtls_ssl_handshake returned" \ |
| 5373 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5374 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5375 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5376 | # Tests for ALPN extension |
| 5377 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5378 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5379 | "$P_SRV debug_level=3" \ |
| 5380 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5381 | 0 \ |
| 5382 | -C "client hello, adding alpn extension" \ |
| 5383 | -S "found alpn extension" \ |
| 5384 | -C "got an alert message, type: \\[2:120]" \ |
| 5385 | -S "server hello, adding alpn extension" \ |
| 5386 | -C "found alpn extension " \ |
| 5387 | -C "Application Layer Protocol is" \ |
| 5388 | -S "Application Layer Protocol is" |
| 5389 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5390 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5391 | "$P_SRV debug_level=3" \ |
| 5392 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5393 | 0 \ |
| 5394 | -c "client hello, adding alpn extension" \ |
| 5395 | -s "found alpn extension" \ |
| 5396 | -C "got an alert message, type: \\[2:120]" \ |
| 5397 | -S "server hello, adding alpn extension" \ |
| 5398 | -C "found alpn extension " \ |
| 5399 | -c "Application Layer Protocol is (none)" \ |
| 5400 | -S "Application Layer Protocol is" |
| 5401 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5402 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5403 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5404 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5405 | 0 \ |
| 5406 | -C "client hello, adding alpn extension" \ |
| 5407 | -S "found alpn extension" \ |
| 5408 | -C "got an alert message, type: \\[2:120]" \ |
| 5409 | -S "server hello, adding alpn extension" \ |
| 5410 | -C "found alpn extension " \ |
| 5411 | -C "Application Layer Protocol is" \ |
| 5412 | -s "Application Layer Protocol is (none)" |
| 5413 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5414 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5415 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5416 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5417 | 0 \ |
| 5418 | -c "client hello, adding alpn extension" \ |
| 5419 | -s "found alpn extension" \ |
| 5420 | -C "got an alert message, type: \\[2:120]" \ |
| 5421 | -s "server hello, adding alpn extension" \ |
| 5422 | -c "found alpn extension" \ |
| 5423 | -c "Application Layer Protocol is abc" \ |
| 5424 | -s "Application Layer Protocol is abc" |
| 5425 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5426 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5427 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5428 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5429 | 0 \ |
| 5430 | -c "client hello, adding alpn extension" \ |
| 5431 | -s "found alpn extension" \ |
| 5432 | -C "got an alert message, type: \\[2:120]" \ |
| 5433 | -s "server hello, adding alpn extension" \ |
| 5434 | -c "found alpn extension" \ |
| 5435 | -c "Application Layer Protocol is abc" \ |
| 5436 | -s "Application Layer Protocol is abc" |
| 5437 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5438 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5439 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5440 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5441 | 0 \ |
| 5442 | -c "client hello, adding alpn extension" \ |
| 5443 | -s "found alpn extension" \ |
| 5444 | -C "got an alert message, type: \\[2:120]" \ |
| 5445 | -s "server hello, adding alpn extension" \ |
| 5446 | -c "found alpn extension" \ |
| 5447 | -c "Application Layer Protocol is 1234" \ |
| 5448 | -s "Application Layer Protocol is 1234" |
| 5449 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5450 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5451 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5452 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5453 | 1 \ |
| 5454 | -c "client hello, adding alpn extension" \ |
| 5455 | -s "found alpn extension" \ |
| 5456 | -c "got an alert message, type: \\[2:120]" \ |
| 5457 | -S "server hello, adding alpn extension" \ |
| 5458 | -C "found alpn extension" \ |
| 5459 | -C "Application Layer Protocol is 1234" \ |
| 5460 | -S "Application Layer Protocol is 1234" |
| 5461 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5462 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5463 | # Tests for keyUsage in leaf certificates, part 1: |
| 5464 | # server-side certificate/suite selection |
| 5465 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5466 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5467 | "$P_SRV key_file=data_files/server2.key \ |
| 5468 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5469 | "$P_CLI" \ |
| 5470 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5471 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5472 | |
| 5473 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5474 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5475 | "$P_SRV key_file=data_files/server2.key \ |
| 5476 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5477 | "$P_CLI" \ |
| 5478 | 0 \ |
| 5479 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5480 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5481 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5482 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5483 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5484 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5485 | 1 \ |
| 5486 | -C "Ciphersuite is " |
| 5487 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5488 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5489 | "$P_SRV key_file=data_files/server5.key \ |
| 5490 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5491 | "$P_CLI" \ |
| 5492 | 0 \ |
| 5493 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5494 | |
| 5495 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5496 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5497 | "$P_SRV key_file=data_files/server5.key \ |
| 5498 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5499 | "$P_CLI" \ |
| 5500 | 0 \ |
| 5501 | -c "Ciphersuite is TLS-ECDH-" |
| 5502 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5503 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5504 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5505 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5506 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5507 | 1 \ |
| 5508 | -C "Ciphersuite is " |
| 5509 | |
| 5510 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5511 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5512 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5513 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5514 | "$O_SRV -key data_files/server2.key \ |
| 5515 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5516 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5517 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5518 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5519 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5520 | -C "Processing of the Certificate handshake message failed" \ |
| 5521 | -c "Ciphersuite is TLS-" |
| 5522 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5523 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5524 | "$O_SRV -key data_files/server2.key \ |
| 5525 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5526 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5527 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5528 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5529 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5530 | -C "Processing of the Certificate handshake message failed" \ |
| 5531 | -c "Ciphersuite is TLS-" |
| 5532 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5533 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5534 | "$O_SRV -key data_files/server2.key \ |
| 5535 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5536 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5537 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5538 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5539 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5540 | -C "Processing of the Certificate handshake message failed" \ |
| 5541 | -c "Ciphersuite is TLS-" |
| 5542 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5543 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5544 | "$O_SRV -key data_files/server2.key \ |
| 5545 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5546 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5547 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5548 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5549 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5550 | -c "Processing of the Certificate handshake message failed" \ |
| 5551 | -C "Ciphersuite is TLS-" |
| 5552 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5553 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5554 | "$O_SRV -key data_files/server2.key \ |
| 5555 | -cert data_files/server2.ku-ke.crt" \ |
| 5556 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5557 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5558 | 0 \ |
| 5559 | -c "bad certificate (usage extensions)" \ |
| 5560 | -C "Processing of the Certificate handshake message failed" \ |
| 5561 | -c "Ciphersuite is TLS-" \ |
| 5562 | -c "! Usage does not match the keyUsage extension" |
| 5563 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5564 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5565 | "$O_SRV -key data_files/server2.key \ |
| 5566 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5567 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5568 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5569 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5570 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5571 | -C "Processing of the Certificate handshake message failed" \ |
| 5572 | -c "Ciphersuite is TLS-" |
| 5573 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5574 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5575 | "$O_SRV -key data_files/server2.key \ |
| 5576 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5577 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5578 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5579 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5580 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5581 | -c "Processing of the Certificate handshake message failed" \ |
| 5582 | -C "Ciphersuite is TLS-" |
| 5583 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5584 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5585 | "$O_SRV -key data_files/server2.key \ |
| 5586 | -cert data_files/server2.ku-ds.crt" \ |
| 5587 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5588 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5589 | 0 \ |
| 5590 | -c "bad certificate (usage extensions)" \ |
| 5591 | -C "Processing of the Certificate handshake message failed" \ |
| 5592 | -c "Ciphersuite is TLS-" \ |
| 5593 | -c "! Usage does not match the keyUsage extension" |
| 5594 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5595 | # Tests for keyUsage in leaf certificates, part 3: |
| 5596 | # server-side checking of client cert |
| 5597 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5598 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5599 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5600 | "$O_CLI -key data_files/server2.key \ |
| 5601 | -cert data_files/server2.ku-ds.crt" \ |
| 5602 | 0 \ |
| 5603 | -S "bad certificate (usage extensions)" \ |
| 5604 | -S "Processing of the Certificate handshake message failed" |
| 5605 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5606 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5607 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5608 | "$O_CLI -key data_files/server2.key \ |
| 5609 | -cert data_files/server2.ku-ke.crt" \ |
| 5610 | 0 \ |
| 5611 | -s "bad certificate (usage extensions)" \ |
| 5612 | -S "Processing of the Certificate handshake message failed" |
| 5613 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5614 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5615 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5616 | "$O_CLI -key data_files/server2.key \ |
| 5617 | -cert data_files/server2.ku-ke.crt" \ |
| 5618 | 1 \ |
| 5619 | -s "bad certificate (usage extensions)" \ |
| 5620 | -s "Processing of the Certificate handshake message failed" |
| 5621 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5622 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5623 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5624 | "$O_CLI -key data_files/server5.key \ |
| 5625 | -cert data_files/server5.ku-ds.crt" \ |
| 5626 | 0 \ |
| 5627 | -S "bad certificate (usage extensions)" \ |
| 5628 | -S "Processing of the Certificate handshake message failed" |
| 5629 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5630 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5631 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5632 | "$O_CLI -key data_files/server5.key \ |
| 5633 | -cert data_files/server5.ku-ka.crt" \ |
| 5634 | 0 \ |
| 5635 | -s "bad certificate (usage extensions)" \ |
| 5636 | -S "Processing of the Certificate handshake message failed" |
| 5637 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5638 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5639 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5640 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5641 | "$P_SRV key_file=data_files/server5.key \ |
| 5642 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5643 | "$P_CLI" \ |
| 5644 | 0 |
| 5645 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5646 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5647 | "$P_SRV key_file=data_files/server5.key \ |
| 5648 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5649 | "$P_CLI" \ |
| 5650 | 0 |
| 5651 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5652 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5653 | "$P_SRV key_file=data_files/server5.key \ |
| 5654 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5655 | "$P_CLI" \ |
| 5656 | 0 |
| 5657 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5658 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5659 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5660 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5661 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5662 | 1 |
| 5663 | |
| 5664 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5665 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5666 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5667 | "$O_SRV -key data_files/server5.key \ |
| 5668 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5669 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5670 | 0 \ |
| 5671 | -C "bad certificate (usage extensions)" \ |
| 5672 | -C "Processing of the Certificate handshake message failed" \ |
| 5673 | -c "Ciphersuite is TLS-" |
| 5674 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5675 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5676 | "$O_SRV -key data_files/server5.key \ |
| 5677 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5678 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5679 | 0 \ |
| 5680 | -C "bad certificate (usage extensions)" \ |
| 5681 | -C "Processing of the Certificate handshake message failed" \ |
| 5682 | -c "Ciphersuite is TLS-" |
| 5683 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5684 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5685 | "$O_SRV -key data_files/server5.key \ |
| 5686 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5687 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5688 | 0 \ |
| 5689 | -C "bad certificate (usage extensions)" \ |
| 5690 | -C "Processing of the Certificate handshake message failed" \ |
| 5691 | -c "Ciphersuite is TLS-" |
| 5692 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5693 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5694 | "$O_SRV -key data_files/server5.key \ |
| 5695 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5696 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5697 | 1 \ |
| 5698 | -c "bad certificate (usage extensions)" \ |
| 5699 | -c "Processing of the Certificate handshake message failed" \ |
| 5700 | -C "Ciphersuite is TLS-" |
| 5701 | |
| 5702 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5703 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5704 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5705 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5706 | "$O_CLI -key data_files/server5.key \ |
| 5707 | -cert data_files/server5.eku-cli.crt" \ |
| 5708 | 0 \ |
| 5709 | -S "bad certificate (usage extensions)" \ |
| 5710 | -S "Processing of the Certificate handshake message failed" |
| 5711 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5712 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5713 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5714 | "$O_CLI -key data_files/server5.key \ |
| 5715 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5716 | 0 \ |
| 5717 | -S "bad certificate (usage extensions)" \ |
| 5718 | -S "Processing of the Certificate handshake message failed" |
| 5719 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5720 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5721 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5722 | "$O_CLI -key data_files/server5.key \ |
| 5723 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5724 | 0 \ |
| 5725 | -S "bad certificate (usage extensions)" \ |
| 5726 | -S "Processing of the Certificate handshake message failed" |
| 5727 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5728 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5729 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5730 | "$O_CLI -key data_files/server5.key \ |
| 5731 | -cert data_files/server5.eku-cs.crt" \ |
| 5732 | 0 \ |
| 5733 | -s "bad certificate (usage extensions)" \ |
| 5734 | -S "Processing of the Certificate handshake message failed" |
| 5735 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5736 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5737 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5738 | "$O_CLI -key data_files/server5.key \ |
| 5739 | -cert data_files/server5.eku-cs.crt" \ |
| 5740 | 1 \ |
| 5741 | -s "bad certificate (usage extensions)" \ |
| 5742 | -s "Processing of the Certificate handshake message failed" |
| 5743 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5744 | # Tests for DHM parameters loading |
| 5745 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5746 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5747 | "$P_SRV" \ |
| 5748 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5749 | debug_level=3" \ |
| 5750 | 0 \ |
| 5751 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5752 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5753 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5754 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5755 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5756 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5757 | debug_level=3" \ |
| 5758 | 0 \ |
| 5759 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5760 | -c "value of 'DHM: G ' (2 bits)" |
| 5761 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5762 | # Tests for DHM client-side size checking |
| 5763 | |
| 5764 | run_test "DHM size: server default, client default, OK" \ |
| 5765 | "$P_SRV" \ |
| 5766 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5767 | debug_level=1" \ |
| 5768 | 0 \ |
| 5769 | -C "DHM prime too short:" |
| 5770 | |
| 5771 | run_test "DHM size: server default, client 2048, OK" \ |
| 5772 | "$P_SRV" \ |
| 5773 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5774 | debug_level=1 dhmlen=2048" \ |
| 5775 | 0 \ |
| 5776 | -C "DHM prime too short:" |
| 5777 | |
| 5778 | run_test "DHM size: server 1024, client default, OK" \ |
| 5779 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5780 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5781 | debug_level=1" \ |
| 5782 | 0 \ |
| 5783 | -C "DHM prime too short:" |
| 5784 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5785 | run_test "DHM size: server 999, client 999, OK" \ |
| 5786 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5787 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5788 | debug_level=1 dhmlen=999" \ |
| 5789 | 0 \ |
| 5790 | -C "DHM prime too short:" |
| 5791 | |
| 5792 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5793 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5794 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5795 | debug_level=1 dhmlen=1000" \ |
| 5796 | 0 \ |
| 5797 | -C "DHM prime too short:" |
| 5798 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5799 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5800 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5801 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5802 | debug_level=1" \ |
| 5803 | 1 \ |
| 5804 | -c "DHM prime too short:" |
| 5805 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5806 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5807 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5808 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5809 | debug_level=1 dhmlen=1001" \ |
| 5810 | 1 \ |
| 5811 | -c "DHM prime too short:" |
| 5812 | |
| 5813 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5814 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5815 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5816 | debug_level=1 dhmlen=1000" \ |
| 5817 | 1 \ |
| 5818 | -c "DHM prime too short:" |
| 5819 | |
| 5820 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5821 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5822 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5823 | debug_level=1 dhmlen=999" \ |
| 5824 | 1 \ |
| 5825 | -c "DHM prime too short:" |
| 5826 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5827 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5828 | "$P_SRV" \ |
| 5829 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5830 | debug_level=1 dhmlen=2049" \ |
| 5831 | 1 \ |
| 5832 | -c "DHM prime too short:" |
| 5833 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5834 | # Tests for PSK callback |
| 5835 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5836 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5837 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5838 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5839 | psk_identity=foo psk=abc123" \ |
| 5840 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5841 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5842 | -S "SSL - Unknown identity received" \ |
| 5843 | -S "SSL - Verification of the message MAC failed" |
| 5844 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5845 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5846 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5847 | "$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] | 5848 | "$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] | 5849 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5850 | 0 \ |
| 5851 | -c "skip PMS generation for opaque PSK"\ |
| 5852 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5853 | -C "session hash for extended master secret"\ |
| 5854 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5855 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5856 | -S "SSL - Unknown identity received" \ |
| 5857 | -S "SSL - Verification of the message MAC failed" |
| 5858 | |
| 5859 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5860 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5861 | "$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] | 5862 | "$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] | 5863 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5864 | 0 \ |
| 5865 | -c "skip PMS generation for opaque PSK"\ |
| 5866 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5867 | -C "session hash for extended master secret"\ |
| 5868 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5869 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5870 | -S "SSL - Unknown identity received" \ |
| 5871 | -S "SSL - Verification of the message MAC failed" |
| 5872 | |
| 5873 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5874 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5875 | "$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] | 5876 | "$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] | 5877 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5878 | 0 \ |
| 5879 | -c "skip PMS generation for opaque PSK"\ |
| 5880 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5881 | -c "session hash for extended master secret"\ |
| 5882 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5883 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5884 | -S "SSL - Unknown identity received" \ |
| 5885 | -S "SSL - Verification of the message MAC failed" |
| 5886 | |
| 5887 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5888 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5889 | "$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] | 5890 | "$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] | 5891 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5892 | 0 \ |
| 5893 | -c "skip PMS generation for opaque PSK"\ |
| 5894 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5895 | -c "session hash for extended master secret"\ |
| 5896 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5897 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5898 | -S "SSL - Unknown identity received" \ |
| 5899 | -S "SSL - Verification of the message MAC failed" |
| 5900 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5901 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5902 | 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] | 5903 | "$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" \ |
| 5904 | "$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] | 5905 | psk_identity=foo psk=abc123" \ |
| 5906 | 0 \ |
| 5907 | -C "skip PMS generation for opaque PSK"\ |
| 5908 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5909 | -C "session hash for extended master secret"\ |
| 5910 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5911 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5912 | -S "SSL - Unknown identity received" \ |
| 5913 | -S "SSL - Verification of the message MAC failed" |
| 5914 | |
| 5915 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5916 | 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] | 5917 | "$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" \ |
| 5918 | "$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] | 5919 | psk_identity=foo psk=abc123" \ |
| 5920 | 0 \ |
| 5921 | -C "skip PMS generation for opaque PSK"\ |
| 5922 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5923 | -C "session hash for extended master secret"\ |
| 5924 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5925 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5926 | -S "SSL - Unknown identity received" \ |
| 5927 | -S "SSL - Verification of the message MAC failed" |
| 5928 | |
| 5929 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5930 | 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] | 5931 | "$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] | 5932 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5933 | "$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] | 5934 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5935 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5936 | -c "session hash for extended master secret"\ |
| 5937 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5938 | -C "skip PMS generation for opaque PSK"\ |
| 5939 | -s "skip PMS generation for opaque PSK"\ |
| 5940 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5941 | -S "SSL - Unknown identity received" \ |
| 5942 | -S "SSL - Verification of the message MAC failed" |
| 5943 | |
| 5944 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5945 | 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] | 5946 | "$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] | 5947 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5948 | "$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] | 5949 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5950 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5951 | -c "session hash for extended master secret"\ |
| 5952 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5953 | -C "skip PMS generation for opaque PSK"\ |
| 5954 | -s "skip PMS generation for opaque PSK"\ |
| 5955 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5956 | -S "SSL - Unknown identity received" \ |
| 5957 | -S "SSL - Verification of the message MAC failed" |
| 5958 | |
| 5959 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5960 | run_test "PSK callback: 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] | 5961 | "$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" \ |
| 5962 | "$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] | 5963 | psk_identity=def psk=beef" \ |
| 5964 | 0 \ |
| 5965 | -C "skip PMS generation for opaque PSK"\ |
| 5966 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5967 | -C "session hash for extended master secret"\ |
| 5968 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5969 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5970 | -S "SSL - Unknown identity received" \ |
| 5971 | -S "SSL - Verification of the message MAC failed" |
| 5972 | |
| 5973 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5974 | run_test "PSK callback: 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] | 5975 | "$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" \ |
| 5976 | "$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] | 5977 | psk_identity=def psk=beef" \ |
| 5978 | 0 \ |
| 5979 | -C "skip PMS generation for opaque PSK"\ |
| 5980 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5981 | -C "session hash for extended master secret"\ |
| 5982 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5983 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5984 | -S "SSL - Unknown identity received" \ |
| 5985 | -S "SSL - Verification of the message MAC failed" |
| 5986 | |
| 5987 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5988 | 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] | 5989 | "$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] | 5990 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5991 | "$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] | 5992 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5993 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5994 | -c "session hash for extended master secret"\ |
| 5995 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5996 | -C "skip PMS generation for opaque PSK"\ |
| 5997 | -s "skip PMS generation for opaque PSK"\ |
| 5998 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5999 | -S "SSL - Unknown identity received" \ |
| 6000 | -S "SSL - Verification of the message MAC failed" |
| 6001 | |
| 6002 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6003 | 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] | 6004 | "$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] | 6005 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6006 | "$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] | 6007 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6008 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6009 | -c "session hash for extended master secret"\ |
| 6010 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6011 | -C "skip PMS generation for opaque PSK"\ |
| 6012 | -s "skip PMS generation for opaque PSK"\ |
| 6013 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6014 | -S "SSL - Unknown identity received" \ |
| 6015 | -S "SSL - Verification of the message MAC failed" |
| 6016 | |
| 6017 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6018 | 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] | 6019 | "$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" \ |
| 6020 | "$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] | 6021 | psk_identity=def psk=beef" \ |
| 6022 | 0 \ |
| 6023 | -C "skip PMS generation for opaque PSK"\ |
| 6024 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6025 | -C "session hash for extended master secret"\ |
| 6026 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6027 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6028 | -S "SSL - Unknown identity received" \ |
| 6029 | -S "SSL - Verification of the message MAC failed" |
| 6030 | |
| 6031 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6032 | 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] | 6033 | "$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" \ |
| 6034 | "$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] | 6035 | psk_identity=def psk=beef" \ |
| 6036 | 0 \ |
| 6037 | -C "skip PMS generation for opaque PSK"\ |
| 6038 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6039 | -C "session hash for extended master secret"\ |
| 6040 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6041 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6042 | -S "SSL - Unknown identity received" \ |
| 6043 | -S "SSL - Verification of the message MAC failed" |
| 6044 | |
| 6045 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6046 | run_test "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6047 | "$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" \ |
| 6048 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls12 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6049 | psk_identity=def psk=beef" \ |
| 6050 | 0 \ |
| 6051 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6052 | -C "session hash for extended master secret"\ |
| 6053 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6054 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6055 | -S "SSL - Unknown identity received" \ |
| 6056 | -S "SSL - Verification of the message MAC failed" |
| 6057 | |
| 6058 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6059 | 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] | 6060 | "$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" \ |
| 6061 | "$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] | 6062 | psk_identity=def psk=beef" \ |
| 6063 | 0 \ |
| 6064 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6065 | -C "session hash for extended master secret"\ |
| 6066 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6067 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6068 | -S "SSL - Unknown identity received" \ |
| 6069 | -S "SSL - Verification of the message MAC failed" |
| 6070 | |
| 6071 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6072 | 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] | 6073 | "$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" \ |
| 6074 | "$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] | 6075 | psk_identity=def psk=beef" \ |
| 6076 | 1 \ |
| 6077 | -s "SSL - Verification of the message MAC failed" |
| 6078 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6079 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6080 | "$P_SRV" \ |
| 6081 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6082 | psk_identity=foo psk=abc123" \ |
| 6083 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6084 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6085 | -S "SSL - Unknown identity received" \ |
| 6086 | -S "SSL - Verification of the message MAC failed" |
| 6087 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6088 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6089 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 6090 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6091 | psk_identity=foo psk=abc123" \ |
| 6092 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6093 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6094 | -s "SSL - Unknown identity received" \ |
| 6095 | -S "SSL - Verification of the message MAC failed" |
| 6096 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6097 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6098 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6099 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6100 | psk_identity=abc psk=dead" \ |
| 6101 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6102 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6103 | -S "SSL - Unknown identity received" \ |
| 6104 | -S "SSL - Verification of the message MAC failed" |
| 6105 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6106 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6107 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6108 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6109 | psk_identity=def psk=beef" \ |
| 6110 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6111 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6112 | -S "SSL - Unknown identity received" \ |
| 6113 | -S "SSL - Verification of the message MAC failed" |
| 6114 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6115 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6116 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6117 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6118 | psk_identity=ghi psk=beef" \ |
| 6119 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6120 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6121 | -s "SSL - Unknown identity received" \ |
| 6122 | -S "SSL - Verification of the message MAC failed" |
| 6123 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6124 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6125 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6126 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6127 | psk_identity=abc psk=beef" \ |
| 6128 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6129 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6130 | -S "SSL - Unknown identity received" \ |
| 6131 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6132 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6133 | # Tests for EC J-PAKE |
| 6134 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6135 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6136 | run_test "ECJPAKE: client not configured" \ |
| 6137 | "$P_SRV debug_level=3" \ |
| 6138 | "$P_CLI debug_level=3" \ |
| 6139 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6140 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6141 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6142 | -S "found ecjpake kkpp extension" \ |
| 6143 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6144 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6145 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6146 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6147 | -S "None of the common ciphersuites is usable" |
| 6148 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6149 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6150 | run_test "ECJPAKE: server not configured" \ |
| 6151 | "$P_SRV debug_level=3" \ |
| 6152 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6153 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6154 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6155 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6156 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6157 | -s "found ecjpake kkpp extension" \ |
| 6158 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6159 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6160 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6161 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6162 | -s "None of the common ciphersuites is usable" |
| 6163 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6164 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6165 | run_test "ECJPAKE: working, TLS" \ |
| 6166 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6167 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6168 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6169 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6170 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6171 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6172 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6173 | -s "found ecjpake kkpp extension" \ |
| 6174 | -S "skip ecjpake kkpp extension" \ |
| 6175 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6176 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6177 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6178 | -S "None of the common ciphersuites is usable" \ |
| 6179 | -S "SSL - Verification of the message MAC failed" |
| 6180 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6181 | server_needs_more_time 1 |
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 | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6183 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6184 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6185 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6186 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6187 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6188 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6189 | -s "SSL - Verification of the message MAC failed" |
| 6190 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6191 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6192 | run_test "ECJPAKE: working, DTLS" \ |
| 6193 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6194 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6195 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6196 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6197 | -c "re-using cached ecjpake parameters" \ |
| 6198 | -S "SSL - Verification of the message MAC failed" |
| 6199 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6200 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6201 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6202 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6203 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6204 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6205 | 0 \ |
| 6206 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6207 | -S "SSL - Verification of the message MAC failed" |
| 6208 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6209 | server_needs_more_time 1 |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6210 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6211 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6212 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6213 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6214 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6215 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6216 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6217 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6218 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6219 | # for tests with configs/config-thread.h |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6220 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6221 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6222 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6223 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6224 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6225 | 0 |
| 6226 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6227 | # Tests for ciphersuites per version |
| 6228 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6229 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6230 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6231 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6232 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6233 | "$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] | 6234 | "$P_CLI force_version=ssl3" \ |
| 6235 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6236 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6237 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 6239 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6240 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6241 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6242 | "$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] | 6243 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6244 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6245 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6246 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6248 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6249 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6250 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6251 | "$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] | 6252 | "$P_CLI force_version=tls1_1" \ |
| 6253 | 0 \ |
| 6254 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 6255 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6256 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6257 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6258 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6259 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6260 | "$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] | 6261 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6262 | 0 \ |
| 6263 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 6264 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6265 | # Test for ClientHello without extensions |
| 6266 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6267 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6268 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6269 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6270 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6271 | 0 \ |
| 6272 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6273 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6274 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6275 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6276 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6277 | "$P_SRV" \ |
| 6278 | "$P_CLI request_size=100" \ |
| 6279 | 0 \ |
| 6280 | -s "Read from client: 100 bytes read$" |
| 6281 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6282 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6283 | "$P_SRV" \ |
| 6284 | "$P_CLI request_size=500" \ |
| 6285 | 0 \ |
| 6286 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6287 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6288 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6289 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6290 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6291 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6292 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6293 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6294 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6295 | 0 \ |
| 6296 | -s "Read from client: 1 bytes read" |
| 6297 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6298 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6299 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6300 | "$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] | 6301 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6302 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6303 | 0 \ |
| 6304 | -s "Read from client: 1 bytes read" |
| 6305 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6306 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6307 | "$P_SRV" \ |
| 6308 | "$P_CLI request_size=1 force_version=tls1 \ |
| 6309 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6310 | 0 \ |
| 6311 | -s "Read from client: 1 bytes read" |
| 6312 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6313 | 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] | 6314 | "$P_SRV" \ |
| 6315 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 6316 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6317 | 0 \ |
| 6318 | -s "Read from client: 1 bytes read" |
| 6319 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +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 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6322 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6323 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6324 | 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] | 6325 | 0 \ |
| 6326 | -s "Read from client: 1 bytes read" |
| 6327 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6328 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6329 | 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] | 6330 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6331 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6332 | 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] | 6333 | 0 \ |
| 6334 | -s "Read from client: 1 bytes read" |
| 6335 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6336 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6337 | "$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] | 6338 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6339 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6340 | 0 \ |
| 6341 | -s "Read from client: 1 bytes read" |
| 6342 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6343 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6344 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6345 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6346 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
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.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6352 | "$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] | 6353 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6354 | 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] | 6355 | 0 \ |
| 6356 | -s "Read from client: 1 bytes read" |
| 6357 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6358 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6359 | 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] | 6360 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6361 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6362 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6363 | 0 \ |
| 6364 | -s "Read from client: 1 bytes read" |
| 6365 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6366 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6367 | "$P_SRV" \ |
| 6368 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6369 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6370 | 0 \ |
| 6371 | -s "Read from client: 1 bytes read" |
| 6372 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6373 | 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] | 6374 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [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-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6377 | 0 \ |
| 6378 | -s "Read from client: 1 bytes read" |
| 6379 | |
| 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 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6382 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [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-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6385 | 0 \ |
| 6386 | -s "Read from client: 1 bytes read" |
| 6387 | |
| 6388 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6389 | 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] | 6390 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6391 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6392 | 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] | 6393 | 0 \ |
| 6394 | -s "Read from client: 1 bytes read" |
| 6395 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6396 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6397 | "$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] | 6398 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6399 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6400 | 0 \ |
| 6401 | -s "Read from client: 1 bytes read" |
| 6402 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6403 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6404 | "$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] | 6405 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6406 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6407 | 0 \ |
| 6408 | -s "Read from client: 1 bytes read" |
| 6409 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6410 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6411 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6412 | "$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] | 6413 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6414 | 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] | 6415 | 0 \ |
| 6416 | -s "Read from client: 1 bytes read" |
| 6417 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6418 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6419 | 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] | 6420 | "$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] | 6421 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6422 | 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] | 6423 | 0 \ |
| 6424 | -s "Read from client: 1 bytes read" |
| 6425 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6426 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6427 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6428 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6429 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6430 | 0 \ |
| 6431 | -s "Read from client: 1 bytes read" |
| 6432 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6433 | 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] | 6434 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6435 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6436 | 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] | 6437 | 0 \ |
| 6438 | -s "Read from client: 1 bytes read" |
| 6439 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6440 | 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] | 6441 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6442 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6443 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
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 | 32c5501 | 2017-11-10 08:42:54 +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 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6449 | "$P_SRV 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-AES-256-CBC-SHA trunc_hmac=1" \ |
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 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6455 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6456 | 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] | 6457 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6458 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6459 | 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] | 6460 | 0 \ |
| 6461 | -s "Read from client: 1 bytes read" |
| 6462 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6463 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6464 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6465 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6466 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6467 | 0 \ |
| 6468 | -s "Read from client: 1 bytes read" |
| 6469 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6470 | 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] | 6471 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6472 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6473 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6474 | 0 \ |
| 6475 | -s "Read from client: 1 bytes read" |
| 6476 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6477 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6478 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6479 | "$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] | 6480 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6481 | 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] | 6482 | 0 \ |
| 6483 | -s "Read from client: 1 bytes read" |
| 6484 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6485 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6486 | 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] | 6487 | "$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] | 6488 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6489 | 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] | 6490 | 0 \ |
| 6491 | -s "Read from client: 1 bytes read" |
| 6492 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6493 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6494 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6495 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6496 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6497 | 0 \ |
| 6498 | -s "Read from client: 1 bytes read" |
| 6499 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6500 | 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] | 6501 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6502 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6503 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6504 | 0 \ |
| 6505 | -s "Read from client: 1 bytes read" |
| 6506 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6507 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6508 | |
| 6509 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6510 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6511 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6512 | "$P_CLI dtls=1 request_size=1 \ |
| 6513 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6514 | 0 \ |
| 6515 | -s "Read from client: 1 bytes read" |
| 6516 | |
| 6517 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6518 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6519 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6520 | "$P_CLI dtls=1 request_size=1 \ |
| 6521 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6522 | 0 \ |
| 6523 | -s "Read from client: 1 bytes read" |
| 6524 | |
| 6525 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6526 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6527 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6528 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6529 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6530 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6531 | 0 \ |
| 6532 | -s "Read from client: 1 bytes read" |
| 6533 | |
| 6534 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6535 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6536 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6537 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6538 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6539 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6540 | 0 \ |
| 6541 | -s "Read from client: 1 bytes read" |
| 6542 | |
| 6543 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6544 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6545 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6546 | "$P_CLI dtls=1 request_size=1 \ |
| 6547 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6548 | 0 \ |
| 6549 | -s "Read from client: 1 bytes read" |
| 6550 | |
| 6551 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6552 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6553 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6554 | "$P_CLI dtls=1 request_size=1 \ |
| 6555 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6556 | 0 \ |
| 6557 | -s "Read from client: 1 bytes read" |
| 6558 | |
| 6559 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6560 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6561 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6562 | "$P_SRV dtls=1 force_version=dtls12 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6563 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6564 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6565 | 0 \ |
| 6566 | -s "Read from client: 1 bytes read" |
| 6567 | |
| 6568 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6569 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6570 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6571 | "$P_SRV dtls=1 force_version=dtls12 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6572 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6573 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6574 | 0 \ |
| 6575 | -s "Read from client: 1 bytes read" |
| 6576 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6577 | # Tests for small server packets |
| 6578 | |
| 6579 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6580 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 6581 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 6582 | "$P_CLI force_version=ssl3 \ |
| 6583 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6584 | 0 \ |
| 6585 | -c "Read from server: 1 bytes read" |
| 6586 | |
| 6587 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 6588 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 6589 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6590 | "$P_CLI force_version=ssl3 \ |
| 6591 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6592 | 0 \ |
| 6593 | -c "Read from server: 1 bytes read" |
| 6594 | |
| 6595 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6596 | "$P_SRV response_size=1" \ |
| 6597 | "$P_CLI force_version=tls1 \ |
| 6598 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6599 | 0 \ |
| 6600 | -c "Read from server: 1 bytes read" |
| 6601 | |
| 6602 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6603 | "$P_SRV response_size=1" \ |
| 6604 | "$P_CLI force_version=tls1 etm=0 \ |
| 6605 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 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 BlockCipher, truncated MAC" \ |
| 6611 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6612 | "$P_CLI force_version=tls1 \ |
| 6613 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6614 | 0 \ |
| 6615 | -c "Read from server: 1 bytes read" |
| 6616 | |
| 6617 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6618 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6619 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6620 | "$P_CLI force_version=tls1 \ |
| 6621 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6622 | 0 \ |
| 6623 | -c "Read from server: 1 bytes read" |
| 6624 | |
| 6625 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 6626 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6627 | "$P_CLI force_version=tls1 \ |
| 6628 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6629 | 0 \ |
| 6630 | -c "Read from server: 1 bytes read" |
| 6631 | |
| 6632 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6633 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6634 | "$P_CLI force_version=tls1 \ |
| 6635 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 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.0 StreamCipher, truncated MAC" \ |
| 6641 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6642 | "$P_CLI force_version=tls1 \ |
| 6643 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6644 | 0 \ |
| 6645 | -c "Read from server: 1 bytes read" |
| 6646 | |
| 6647 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6648 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6649 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6650 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6651 | trunc_hmac=1 etm=0" \ |
| 6652 | 0 \ |
| 6653 | -c "Read from server: 1 bytes read" |
| 6654 | |
| 6655 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6656 | "$P_SRV response_size=1" \ |
| 6657 | "$P_CLI force_version=tls1_1 \ |
| 6658 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6659 | 0 \ |
| 6660 | -c "Read from server: 1 bytes read" |
| 6661 | |
| 6662 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6663 | "$P_SRV response_size=1" \ |
| 6664 | "$P_CLI force_version=tls1_1 \ |
| 6665 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 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 BlockCipher, truncated MAC" \ |
| 6671 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6672 | "$P_CLI force_version=tls1_1 \ |
| 6673 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6674 | 0 \ |
| 6675 | -c "Read from server: 1 bytes read" |
| 6676 | |
| 6677 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6678 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6679 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6680 | "$P_CLI force_version=tls1_1 \ |
| 6681 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6682 | 0 \ |
| 6683 | -c "Read from server: 1 bytes read" |
| 6684 | |
| 6685 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 6686 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6687 | "$P_CLI force_version=tls1_1 \ |
| 6688 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6689 | 0 \ |
| 6690 | -c "Read from server: 1 bytes read" |
| 6691 | |
| 6692 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6693 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6694 | "$P_CLI force_version=tls1_1 \ |
| 6695 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6696 | 0 \ |
| 6697 | -c "Read from server: 1 bytes read" |
| 6698 | |
| 6699 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6700 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 6701 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6702 | "$P_CLI force_version=tls1_1 \ |
| 6703 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6704 | 0 \ |
| 6705 | -c "Read from server: 1 bytes read" |
| 6706 | |
| 6707 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6708 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6709 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6710 | "$P_CLI force_version=tls1_1 \ |
| 6711 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6712 | 0 \ |
| 6713 | -c "Read from server: 1 bytes read" |
| 6714 | |
| 6715 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6716 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6717 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6718 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6719 | 0 \ |
| 6720 | -c "Read from server: 1 bytes read" |
| 6721 | |
| 6722 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6723 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6724 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6725 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6726 | 0 \ |
| 6727 | -c "Read from server: 1 bytes read" |
| 6728 | |
| 6729 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6730 | "$P_SRV response_size=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-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 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 BlockCipher, truncated MAC" \ |
| 6738 | "$P_SRV response_size=1 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-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6741 | 0 \ |
| 6742 | -c "Read from server: 1 bytes read" |
| 6743 | |
| 6744 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6745 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6746 | "$P_SRV response_size=1 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6747 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6748 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6749 | 0 \ |
| 6750 | -c "Read from server: 1 bytes read" |
| 6751 | |
| 6752 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 6753 | "$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] | 6754 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6755 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6756 | 0 \ |
| 6757 | -c "Read from server: 1 bytes read" |
| 6758 | |
| 6759 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6760 | "$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] | 6761 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6762 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6763 | 0 \ |
| 6764 | -c "Read from server: 1 bytes read" |
| 6765 | |
| 6766 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6767 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6768 | "$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] | 6769 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6770 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6771 | 0 \ |
| 6772 | -c "Read from server: 1 bytes read" |
| 6773 | |
| 6774 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6775 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6776 | "$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] | 6777 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6778 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6779 | 0 \ |
| 6780 | -c "Read from server: 1 bytes read" |
| 6781 | |
| 6782 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6783 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6784 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6785 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6786 | 0 \ |
| 6787 | -c "Read from server: 1 bytes read" |
| 6788 | |
| 6789 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6790 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6791 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6792 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6793 | 0 \ |
| 6794 | -c "Read from server: 1 bytes read" |
| 6795 | |
| 6796 | # Tests for small server packets in DTLS |
| 6797 | |
| 6798 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6799 | run_test "Small server packet DTLS 1.0" \ |
| 6800 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 6801 | "$P_CLI dtls=1 \ |
| 6802 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6803 | 0 \ |
| 6804 | -c "Read from server: 1 bytes read" |
| 6805 | |
| 6806 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6807 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 6808 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 6809 | "$P_CLI dtls=1 \ |
| 6810 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6811 | 0 \ |
| 6812 | -c "Read from server: 1 bytes read" |
| 6813 | |
| 6814 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6815 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6816 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 6817 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 6818 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 6819 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6820 | 0 \ |
| 6821 | -c "Read from server: 1 bytes read" |
| 6822 | |
| 6823 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6824 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6825 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 6826 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 6827 | "$P_CLI dtls=1 \ |
| 6828 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6829 | 0 \ |
| 6830 | -c "Read from server: 1 bytes read" |
| 6831 | |
| 6832 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6833 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6834 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6835 | "$P_CLI dtls=1 \ |
| 6836 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6837 | 0 \ |
| 6838 | -c "Read from server: 1 bytes read" |
| 6839 | |
| 6840 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6841 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6842 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6843 | "$P_CLI dtls=1 \ |
| 6844 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6845 | 0 \ |
| 6846 | -c "Read from server: 1 bytes read" |
| 6847 | |
| 6848 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6849 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6850 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6851 | "$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] | 6852 | "$P_CLI dtls=1 \ |
| 6853 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6854 | 0 \ |
| 6855 | -c "Read from server: 1 bytes read" |
| 6856 | |
| 6857 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6858 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6859 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6860 | "$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] | 6861 | "$P_CLI dtls=1 \ |
| 6862 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 6863 | 0 \ |
| 6864 | -c "Read from server: 1 bytes read" |
| 6865 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6866 | # A test for extensions in SSLv3 |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6867 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6868 | requires_max_content_len 4096 |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6869 | run_test "SSLv3 with extensions, server side" \ |
| 6870 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 6871 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 6872 | 0 \ |
| 6873 | -S "dumping 'client hello extensions'" \ |
| 6874 | -S "server hello, total extension length:" |
| 6875 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6876 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6877 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6878 | # How many fragments do we expect to write $1 bytes? |
| 6879 | fragments_for_write() { |
| 6880 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 6881 | } |
| 6882 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6883 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6884 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6885 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6886 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6887 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6888 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6889 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6890 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6891 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6892 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6893 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6894 | "$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] | 6895 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 6896 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6897 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6898 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6899 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6900 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6901 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6902 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6903 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6904 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6905 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6906 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6907 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6908 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6909 | 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] | 6910 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6911 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 6912 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6913 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6914 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6915 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6916 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6917 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6918 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6919 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6920 | 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] | 6921 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6922 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6923 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6924 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6925 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6926 | 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] | 6927 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6928 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6929 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6930 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6931 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6932 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6933 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6934 | "$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] | 6935 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6936 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6937 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6938 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6939 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6940 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6941 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6942 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6943 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6944 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6945 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6946 | |
| 6947 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6948 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6949 | "$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] | 6950 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6951 | 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] | 6952 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6953 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6954 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6955 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6956 | 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] | 6957 | "$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] | 6958 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6959 | 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] | 6960 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6961 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6962 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6963 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6964 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6965 | "$P_SRV" \ |
| 6966 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6967 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6968 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6969 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 6970 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6971 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6972 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6973 | "$P_SRV" \ |
| 6974 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 6975 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6976 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6977 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6978 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6979 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6980 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6981 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6982 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6983 | 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] | 6984 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6985 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6986 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6987 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6988 | 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] | 6989 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6990 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6991 | 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] | 6992 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6993 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6994 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6995 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6996 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6997 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 6998 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6999 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7000 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7001 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7002 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7003 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7004 | "$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] | 7005 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7006 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7007 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7008 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7009 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7010 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7011 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7012 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7013 | "$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] | 7014 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7015 | 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] | 7016 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7017 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7018 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7019 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7020 | 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] | 7021 | "$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] | 7022 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7023 | 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] | 7024 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7025 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7026 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7027 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7028 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7029 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7030 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7031 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7032 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7033 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7034 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7035 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7036 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7037 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7038 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7039 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7040 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7041 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7042 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7043 | 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] | 7044 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7045 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7046 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7047 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7048 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7049 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7050 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7051 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7052 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7053 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7054 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7055 | 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] | 7056 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7057 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7058 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7059 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7060 | 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] | 7061 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7062 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7063 | 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] | 7064 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7065 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7066 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7067 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7068 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7069 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7070 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7071 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7072 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7073 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7074 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7075 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7076 | 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] | 7077 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7078 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7079 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7080 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7081 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7082 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7083 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7084 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7085 | "$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] | 7086 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7087 | 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] | 7088 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7089 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7090 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7091 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7092 | 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] | 7093 | "$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] | 7094 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7095 | 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] | 7096 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7097 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7098 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7099 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7100 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7101 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7102 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7103 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7104 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7105 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7106 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7107 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7108 | 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] | 7109 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7110 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7111 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7112 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7113 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7114 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7115 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7116 | # Test for large server packets |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7117 | # 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] | 7118 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 7119 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 7120 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7121 | "$P_CLI force_version=ssl3 \ |
| 7122 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7123 | 0 \ |
| 7124 | -c "Read from server: 16384 bytes read" |
| 7125 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 7126 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 7127 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 7128 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 7129 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 7130 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 7131 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7132 | 0 \ |
| 7133 | -c "Read from server: 1 bytes read"\ |
| 7134 | -c "16383 bytes read"\ |
| 7135 | -C "Read from server: 16384 bytes read" |
| 7136 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7137 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 7138 | "$P_SRV response_size=16384" \ |
| 7139 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7140 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7141 | 0 \ |
| 7142 | -c "Read from server: 1 bytes read"\ |
| 7143 | -c "16383 bytes read"\ |
| 7144 | -C "Read from server: 16384 bytes read" |
| 7145 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7146 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 7147 | "$P_SRV response_size=16384" \ |
| 7148 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 7149 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7150 | 0 \ |
| 7151 | -c "Read from server: 1 bytes read"\ |
| 7152 | -c "16383 bytes read"\ |
| 7153 | -C "Read from server: 16384 bytes read" |
| 7154 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7155 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7156 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 7157 | "$P_SRV response_size=16384" \ |
| 7158 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7159 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7160 | trunc_hmac=1" \ |
| 7161 | 0 \ |
| 7162 | -c "Read from server: 1 bytes read"\ |
| 7163 | -c "16383 bytes read"\ |
| 7164 | -C "Read from server: 16384 bytes read" |
| 7165 | |
| 7166 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7167 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 7168 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7169 | "$P_CLI force_version=tls1 \ |
| 7170 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7171 | trunc_hmac=1" \ |
| 7172 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7173 | -s "16384 bytes written in 1 fragments" \ |
| 7174 | -c "Read from server: 16384 bytes read" |
| 7175 | |
| 7176 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 7177 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7178 | "$P_CLI force_version=tls1 \ |
| 7179 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7180 | 0 \ |
| 7181 | -s "16384 bytes written in 1 fragments" \ |
| 7182 | -c "Read from server: 16384 bytes read" |
| 7183 | |
| 7184 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 7185 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7186 | "$P_CLI force_version=tls1 \ |
| 7187 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7188 | 0 \ |
| 7189 | -s "16384 bytes written in 1 fragments" \ |
| 7190 | -c "Read from server: 16384 bytes read" |
| 7191 | |
| 7192 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7193 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 7194 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7195 | "$P_CLI force_version=tls1 \ |
| 7196 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7197 | 0 \ |
| 7198 | -s "16384 bytes written in 1 fragments" \ |
| 7199 | -c "Read from server: 16384 bytes read" |
| 7200 | |
| 7201 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7202 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 7203 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7204 | "$P_CLI force_version=tls1 \ |
| 7205 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7206 | 0 \ |
| 7207 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7208 | -c "Read from server: 16384 bytes read" |
| 7209 | |
| 7210 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 7211 | "$P_SRV response_size=16384" \ |
| 7212 | "$P_CLI force_version=tls1_1 \ |
| 7213 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7214 | 0 \ |
| 7215 | -c "Read from server: 16384 bytes read" |
| 7216 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7217 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 7218 | "$P_SRV response_size=16384" \ |
| 7219 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 7220 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7221 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7222 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7223 | -c "Read from server: 16384 bytes read" |
| 7224 | |
| 7225 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7226 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 7227 | "$P_SRV response_size=16384" \ |
| 7228 | "$P_CLI force_version=tls1_1 \ |
| 7229 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7230 | trunc_hmac=1" \ |
| 7231 | 0 \ |
| 7232 | -c "Read from server: 16384 bytes read" |
| 7233 | |
| 7234 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7235 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 7236 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 7237 | "$P_CLI force_version=tls1_1 \ |
| 7238 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7239 | 0 \ |
| 7240 | -s "16384 bytes written in 1 fragments" \ |
| 7241 | -c "Read from server: 16384 bytes read" |
| 7242 | |
| 7243 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 7244 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7245 | "$P_CLI force_version=tls1_1 \ |
| 7246 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7247 | 0 \ |
| 7248 | -c "Read from server: 16384 bytes read" |
| 7249 | |
| 7250 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 7251 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7252 | "$P_CLI force_version=tls1_1 \ |
| 7253 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7254 | 0 \ |
| 7255 | -s "16384 bytes written in 1 fragments" \ |
| 7256 | -c "Read from server: 16384 bytes read" |
| 7257 | |
| 7258 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7259 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 7260 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7261 | "$P_CLI force_version=tls1_1 \ |
| 7262 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7263 | trunc_hmac=1" \ |
| 7264 | 0 \ |
| 7265 | -c "Read from server: 16384 bytes read" |
| 7266 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7267 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 7268 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7269 | "$P_CLI force_version=tls1_1 \ |
| 7270 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7271 | 0 \ |
| 7272 | -s "16384 bytes written in 1 fragments" \ |
| 7273 | -c "Read from server: 16384 bytes read" |
| 7274 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7275 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 7276 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7277 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7278 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7279 | 0 \ |
| 7280 | -c "Read from server: 16384 bytes read" |
| 7281 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7282 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 7283 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7284 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7285 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7286 | 0 \ |
| 7287 | -s "16384 bytes written in 1 fragments" \ |
| 7288 | -c "Read from server: 16384 bytes read" |
| 7289 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7290 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 7291 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7292 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7293 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 7294 | 0 \ |
| 7295 | -c "Read from server: 16384 bytes read" |
| 7296 | |
| 7297 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7298 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 7299 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7300 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7301 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7302 | trunc_hmac=1" \ |
| 7303 | 0 \ |
| 7304 | -c "Read from server: 16384 bytes read" |
| 7305 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7306 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 7307 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7308 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7309 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7310 | 0 \ |
| 7311 | -s "16384 bytes written in 1 fragments" \ |
| 7312 | -c "Read from server: 16384 bytes read" |
| 7313 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7314 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 7315 | "$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] | 7316 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7317 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7318 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7319 | -s "16384 bytes written in 1 fragments" \ |
| 7320 | -c "Read from server: 16384 bytes read" |
| 7321 | |
| 7322 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 7323 | "$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] | 7324 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7325 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7326 | 0 \ |
| 7327 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7328 | -c "Read from server: 16384 bytes read" |
| 7329 | |
| 7330 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7331 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 7332 | "$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] | 7333 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7334 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7335 | trunc_hmac=1" \ |
| 7336 | 0 \ |
| 7337 | -c "Read from server: 16384 bytes read" |
| 7338 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7339 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7340 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 7341 | "$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] | 7342 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7343 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7344 | 0 \ |
| 7345 | -s "16384 bytes written in 1 fragments" \ |
| 7346 | -c "Read from server: 16384 bytes read" |
| 7347 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7348 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 7349 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7350 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7351 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7352 | 0 \ |
| 7353 | -c "Read from server: 16384 bytes read" |
| 7354 | |
| 7355 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 7356 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7357 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7358 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7359 | 0 \ |
| 7360 | -c "Read from server: 16384 bytes read" |
| 7361 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7362 | # Tests for restartable ECC |
| 7363 | |
| 7364 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7365 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7366 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7367 | "$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] | 7368 | 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] | 7369 | debug_level=1" \ |
| 7370 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7371 | -C "x509_verify_cert.*4b00" \ |
| 7372 | -C "mbedtls_pk_verify.*4b00" \ |
| 7373 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7374 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7375 | |
| 7376 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7377 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7378 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7379 | "$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] | 7380 | 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] | 7381 | debug_level=1 ec_max_ops=0" \ |
| 7382 | 0 \ |
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 | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7387 | |
| 7388 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7389 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7390 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7391 | "$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] | 7392 | 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] | 7393 | debug_level=1 ec_max_ops=65535" \ |
| 7394 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7395 | -C "x509_verify_cert.*4b00" \ |
| 7396 | -C "mbedtls_pk_verify.*4b00" \ |
| 7397 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7398 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7399 | |
| 7400 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7401 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7402 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7403 | "$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] | 7404 | 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] | 7405 | debug_level=1 ec_max_ops=1000" \ |
| 7406 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7407 | -c "x509_verify_cert.*4b00" \ |
| 7408 | -c "mbedtls_pk_verify.*4b00" \ |
| 7409 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7410 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7411 | |
| 7412 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7413 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 7414 | "$P_SRV auth_mode=required \ |
| 7415 | crt_file=data_files/server5-badsign.crt \ |
| 7416 | key_file=data_files/server5.key" \ |
| 7417 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7418 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7419 | debug_level=1 ec_max_ops=1000" \ |
| 7420 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7421 | -c "x509_verify_cert.*4b00" \ |
| 7422 | -C "mbedtls_pk_verify.*4b00" \ |
| 7423 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7424 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7425 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7426 | -c "! mbedtls_ssl_handshake returned" \ |
| 7427 | -c "X509 - Certificate verification failed" |
| 7428 | |
| 7429 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7430 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 7431 | "$P_SRV auth_mode=required \ |
| 7432 | crt_file=data_files/server5-badsign.crt \ |
| 7433 | key_file=data_files/server5.key" \ |
| 7434 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7435 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7436 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7437 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7438 | -c "x509_verify_cert.*4b00" \ |
| 7439 | -c "mbedtls_pk_verify.*4b00" \ |
| 7440 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7441 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7442 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7443 | -C "! mbedtls_ssl_handshake returned" \ |
| 7444 | -C "X509 - Certificate verification failed" |
| 7445 | |
| 7446 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7447 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 7448 | "$P_SRV auth_mode=required \ |
| 7449 | crt_file=data_files/server5-badsign.crt \ |
| 7450 | key_file=data_files/server5.key" \ |
| 7451 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7452 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7453 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7454 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7455 | -C "x509_verify_cert.*4b00" \ |
| 7456 | -c "mbedtls_pk_verify.*4b00" \ |
| 7457 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7458 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7459 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7460 | -C "! mbedtls_ssl_handshake returned" \ |
| 7461 | -C "X509 - Certificate verification failed" |
| 7462 | |
| 7463 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7464 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7465 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7466 | "$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] | 7467 | 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] | 7468 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7469 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7470 | -c "x509_verify_cert.*4b00" \ |
| 7471 | -c "mbedtls_pk_verify.*4b00" \ |
| 7472 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7473 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7474 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7475 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7476 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 7477 | "$P_SRV" \ |
| 7478 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7479 | debug_level=1 ec_max_ops=1000" \ |
| 7480 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7481 | -c "x509_verify_cert.*4b00" \ |
| 7482 | -c "mbedtls_pk_verify.*4b00" \ |
| 7483 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7484 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7485 | |
| 7486 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7487 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 7488 | "$P_SRV psk=abc123" \ |
| 7489 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7490 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7491 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7492 | -C "x509_verify_cert.*4b00" \ |
| 7493 | -C "mbedtls_pk_verify.*4b00" \ |
| 7494 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7495 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7496 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7497 | # Tests of asynchronous private key support in SSL |
| 7498 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7499 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7500 | run_test "SSL async private: sign, delay=0" \ |
| 7501 | "$P_SRV \ |
| 7502 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7503 | "$P_CLI" \ |
| 7504 | 0 \ |
| 7505 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7506 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7507 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7508 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7509 | run_test "SSL async private: sign, delay=1" \ |
| 7510 | "$P_SRV \ |
| 7511 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7512 | "$P_CLI" \ |
| 7513 | 0 \ |
| 7514 | -s "Async sign callback: using key slot " \ |
| 7515 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7516 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7517 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7518 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7519 | run_test "SSL async private: sign, delay=2" \ |
| 7520 | "$P_SRV \ |
| 7521 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7522 | "$P_CLI" \ |
| 7523 | 0 \ |
| 7524 | -s "Async sign callback: using key slot " \ |
| 7525 | -U "Async sign callback: using key slot " \ |
| 7526 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7527 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7528 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7529 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7530 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 7531 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 7532 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7533 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7534 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 7535 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 7536 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 7537 | "$P_CLI force_version=tls1_1" \ |
| 7538 | 0 \ |
| 7539 | -s "Async sign callback: using key slot " \ |
| 7540 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7541 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7542 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7543 | run_test "SSL async private: sign, SNI" \ |
| 7544 | "$P_SRV debug_level=3 \ |
| 7545 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7546 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7547 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7548 | "$P_CLI server_name=polarssl.example" \ |
| 7549 | 0 \ |
| 7550 | -s "Async sign callback: using key slot " \ |
| 7551 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7552 | -s "parse ServerName extension" \ |
| 7553 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7554 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7555 | |
| 7556 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7557 | run_test "SSL async private: decrypt, delay=0" \ |
| 7558 | "$P_SRV \ |
| 7559 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7560 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7561 | 0 \ |
| 7562 | -s "Async decrypt callback: using key slot " \ |
| 7563 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7564 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7565 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7566 | run_test "SSL async private: decrypt, delay=1" \ |
| 7567 | "$P_SRV \ |
| 7568 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7569 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7570 | 0 \ |
| 7571 | -s "Async decrypt callback: using key slot " \ |
| 7572 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7573 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7574 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7575 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7576 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7577 | "$P_SRV psk=abc123 \ |
| 7578 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7579 | "$P_CLI psk=abc123 \ |
| 7580 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7581 | 0 \ |
| 7582 | -s "Async decrypt callback: using key slot " \ |
| 7583 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7584 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7585 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7586 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7587 | "$P_SRV psk=abc123 \ |
| 7588 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7589 | "$P_CLI psk=abc123 \ |
| 7590 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7591 | 0 \ |
| 7592 | -s "Async decrypt callback: using key slot " \ |
| 7593 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7594 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7595 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7596 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7597 | run_test "SSL async private: sign callback not present" \ |
| 7598 | "$P_SRV \ |
| 7599 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7600 | "$P_CLI; [ \$? -eq 1 ] && |
| 7601 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7602 | 0 \ |
| 7603 | -S "Async sign callback" \ |
| 7604 | -s "! mbedtls_ssl_handshake returned" \ |
| 7605 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7606 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7607 | -s "Successful connection" |
| 7608 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7609 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7610 | run_test "SSL async private: decrypt callback not present" \ |
| 7611 | "$P_SRV debug_level=1 \ |
| 7612 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7613 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7614 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7615 | 0 \ |
| 7616 | -S "Async decrypt callback" \ |
| 7617 | -s "! mbedtls_ssl_handshake returned" \ |
| 7618 | -s "got no RSA private key" \ |
| 7619 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7620 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7621 | |
| 7622 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7623 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7624 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7625 | "$P_SRV \ |
| 7626 | async_operations=s async_private_delay1=1 \ |
| 7627 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7628 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7629 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7630 | 0 \ |
| 7631 | -s "Async sign callback: using key slot 0," \ |
| 7632 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7633 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7634 | |
| 7635 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7636 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7637 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7638 | "$P_SRV \ |
| 7639 | async_operations=s async_private_delay2=1 \ |
| 7640 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7641 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7642 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7643 | 0 \ |
| 7644 | -s "Async sign callback: using key slot 0," \ |
| 7645 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7646 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7647 | |
| 7648 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7649 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7650 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7651 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7652 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7653 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7654 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7655 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7656 | 0 \ |
| 7657 | -s "Async sign callback: using key slot 1," \ |
| 7658 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7659 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7660 | |
| 7661 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7662 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7663 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7664 | "$P_SRV \ |
| 7665 | async_operations=s async_private_delay1=1 \ |
| 7666 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7667 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7668 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7669 | 0 \ |
| 7670 | -s "Async sign callback: no key matches this certificate." |
| 7671 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7672 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7673 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7674 | "$P_SRV \ |
| 7675 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7676 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7677 | "$P_CLI" \ |
| 7678 | 1 \ |
| 7679 | -s "Async sign callback: injected error" \ |
| 7680 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7681 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7682 | -s "! mbedtls_ssl_handshake returned" |
| 7683 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7684 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7685 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7686 | "$P_SRV \ |
| 7687 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7688 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7689 | "$P_CLI" \ |
| 7690 | 1 \ |
| 7691 | -s "Async sign callback: using key slot " \ |
| 7692 | -S "Async resume" \ |
| 7693 | -s "Async cancel" |
| 7694 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7695 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7696 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7697 | "$P_SRV \ |
| 7698 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7699 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7700 | "$P_CLI" \ |
| 7701 | 1 \ |
| 7702 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7703 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7704 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7705 | -s "! mbedtls_ssl_handshake returned" |
| 7706 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7707 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7708 | run_test "SSL async private: decrypt, error in start" \ |
| 7709 | "$P_SRV \ |
| 7710 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7711 | async_private_error=1" \ |
| 7712 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7713 | 1 \ |
| 7714 | -s "Async decrypt callback: injected error" \ |
| 7715 | -S "Async resume" \ |
| 7716 | -S "Async cancel" \ |
| 7717 | -s "! mbedtls_ssl_handshake returned" |
| 7718 | |
| 7719 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7720 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7721 | "$P_SRV \ |
| 7722 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7723 | async_private_error=2" \ |
| 7724 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7725 | 1 \ |
| 7726 | -s "Async decrypt callback: using key slot " \ |
| 7727 | -S "Async resume" \ |
| 7728 | -s "Async cancel" |
| 7729 | |
| 7730 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7731 | run_test "SSL async private: decrypt, error in resume" \ |
| 7732 | "$P_SRV \ |
| 7733 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7734 | async_private_error=3" \ |
| 7735 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7736 | 1 \ |
| 7737 | -s "Async decrypt callback: using key slot " \ |
| 7738 | -s "Async resume callback: decrypt done but injected error" \ |
| 7739 | -S "Async cancel" \ |
| 7740 | -s "! mbedtls_ssl_handshake returned" |
| 7741 | |
| 7742 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7743 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7744 | "$P_SRV \ |
| 7745 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7746 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7747 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7748 | 0 \ |
| 7749 | -s "Async cancel" \ |
| 7750 | -s "! mbedtls_ssl_handshake returned" \ |
| 7751 | -s "Async resume" \ |
| 7752 | -s "Successful connection" |
| 7753 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7754 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7755 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7756 | "$P_SRV \ |
| 7757 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7758 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7759 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7760 | 0 \ |
| 7761 | -s "! mbedtls_ssl_handshake returned" \ |
| 7762 | -s "Async resume" \ |
| 7763 | -s "Successful connection" |
| 7764 | |
| 7765 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7766 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7767 | 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] | 7768 | "$P_SRV \ |
| 7769 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7770 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7771 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7772 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7773 | [ \$? -eq 1 ] && |
| 7774 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7775 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7776 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7777 | -S "Async resume" \ |
| 7778 | -s "Async cancel" \ |
| 7779 | -s "! mbedtls_ssl_handshake returned" \ |
| 7780 | -s "Async sign callback: no key matches this certificate." \ |
| 7781 | -s "Successful connection" |
| 7782 | |
| 7783 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7784 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7785 | 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] | 7786 | "$P_SRV \ |
| 7787 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7788 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7789 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7790 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7791 | [ \$? -eq 1 ] && |
| 7792 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7793 | 0 \ |
| 7794 | -s "Async resume" \ |
| 7795 | -s "! mbedtls_ssl_handshake returned" \ |
| 7796 | -s "Async sign callback: no key matches this certificate." \ |
| 7797 | -s "Successful connection" |
| 7798 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7799 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7800 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7801 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7802 | "$P_SRV \ |
| 7803 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7804 | exchanges=2 renegotiation=1" \ |
| 7805 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7806 | 0 \ |
| 7807 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7808 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7809 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7810 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7811 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7812 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7813 | "$P_SRV \ |
| 7814 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7815 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7816 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 7817 | 0 \ |
| 7818 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7819 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7820 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7821 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7822 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7823 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7824 | "$P_SRV \ |
| 7825 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7826 | exchanges=2 renegotiation=1" \ |
| 7827 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 7828 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7829 | 0 \ |
| 7830 | -s "Async decrypt callback: using key slot " \ |
| 7831 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7832 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7833 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7834 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7835 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7836 | "$P_SRV \ |
| 7837 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7838 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 7839 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 7840 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7841 | 0 \ |
| 7842 | -s "Async decrypt callback: using key slot " \ |
| 7843 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7844 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7845 | # Tests for ECC extensions (rfc 4492) |
| 7846 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7847 | requires_config_enabled MBEDTLS_AES_C |
| 7848 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7849 | requires_config_enabled MBEDTLS_SHA256_C |
| 7850 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7851 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 7852 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7853 | "$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] | 7854 | 0 \ |
| 7855 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 7856 | -C "client hello, adding supported_point_formats extension" \ |
| 7857 | -S "found supported elliptic curves extension" \ |
| 7858 | -S "found supported point formats extension" |
| 7859 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7860 | requires_config_enabled MBEDTLS_AES_C |
| 7861 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7862 | requires_config_enabled MBEDTLS_SHA256_C |
| 7863 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7864 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7865 | "$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] | 7866 | "$P_CLI debug_level=3" \ |
| 7867 | 0 \ |
| 7868 | -C "found supported_point_formats extension" \ |
| 7869 | -S "server hello, supported_point_formats extension" |
| 7870 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7871 | requires_config_enabled MBEDTLS_AES_C |
| 7872 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7873 | requires_config_enabled MBEDTLS_SHA256_C |
| 7874 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7875 | run_test "Force an ECC ciphersuite in the client side" \ |
| 7876 | "$P_SRV debug_level=3" \ |
| 7877 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7878 | 0 \ |
| 7879 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 7880 | -c "client hello, adding supported_point_formats extension" \ |
| 7881 | -s "found supported elliptic curves extension" \ |
| 7882 | -s "found supported point formats extension" |
| 7883 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7884 | requires_config_enabled MBEDTLS_AES_C |
| 7885 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7886 | requires_config_enabled MBEDTLS_SHA256_C |
| 7887 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7888 | run_test "Force an ECC ciphersuite in the server side" \ |
| 7889 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7890 | "$P_CLI debug_level=3" \ |
| 7891 | 0 \ |
| 7892 | -c "found supported_point_formats extension" \ |
| 7893 | -s "server hello, supported_point_formats extension" |
| 7894 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7895 | # Tests for DTLS HelloVerifyRequest |
| 7896 | |
| 7897 | run_test "DTLS cookie: enabled" \ |
| 7898 | "$P_SRV dtls=1 debug_level=2" \ |
| 7899 | "$P_CLI dtls=1 debug_level=2" \ |
| 7900 | 0 \ |
| 7901 | -s "cookie verification failed" \ |
| 7902 | -s "cookie verification passed" \ |
| 7903 | -S "cookie verification skipped" \ |
| 7904 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7905 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7906 | -S "SSL - The requested feature is not available" |
| 7907 | |
| 7908 | run_test "DTLS cookie: disabled" \ |
| 7909 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 7910 | "$P_CLI dtls=1 debug_level=2" \ |
| 7911 | 0 \ |
| 7912 | -S "cookie verification failed" \ |
| 7913 | -S "cookie verification passed" \ |
| 7914 | -s "cookie verification skipped" \ |
| 7915 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7916 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7917 | -S "SSL - The requested feature is not available" |
| 7918 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7919 | run_test "DTLS cookie: default (failing)" \ |
| 7920 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 7921 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 7922 | 1 \ |
| 7923 | -s "cookie verification failed" \ |
| 7924 | -S "cookie verification passed" \ |
| 7925 | -S "cookie verification skipped" \ |
| 7926 | -C "received hello verify request" \ |
| 7927 | -S "hello verification requested" \ |
| 7928 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7929 | |
| 7930 | requires_ipv6 |
| 7931 | run_test "DTLS cookie: enabled, IPv6" \ |
| 7932 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 7933 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 7934 | 0 \ |
| 7935 | -s "cookie verification failed" \ |
| 7936 | -s "cookie verification passed" \ |
| 7937 | -S "cookie verification skipped" \ |
| 7938 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7939 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7940 | -S "SSL - The requested feature is not available" |
| 7941 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7942 | run_test "DTLS cookie: enabled, nbio" \ |
| 7943 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 7944 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 7945 | 0 \ |
| 7946 | -s "cookie verification failed" \ |
| 7947 | -s "cookie verification passed" \ |
| 7948 | -S "cookie verification skipped" \ |
| 7949 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7950 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7951 | -S "SSL - The requested feature is not available" |
| 7952 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7953 | # Tests for client reconnecting from the same port with DTLS |
| 7954 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7955 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7956 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7957 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7958 | "$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] | 7959 | 0 \ |
| 7960 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7961 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7962 | -S "Client initiated reconnection from same port" |
| 7963 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7964 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7965 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7966 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 7967 | "$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] | 7968 | 0 \ |
| 7969 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7970 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7971 | -s "Client initiated reconnection from same port" |
| 7972 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7973 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 7974 | 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] | 7975 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 7976 | "$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] | 7977 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7978 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7979 | -s "Client initiated reconnection from same port" |
| 7980 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7981 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 7982 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 7983 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 7984 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 7985 | 0 \ |
| 7986 | -S "The operation timed out" \ |
| 7987 | -s "Client initiated reconnection from same port" |
| 7988 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7989 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 7990 | "$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] | 7991 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 7992 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7993 | -s "The operation timed out" \ |
| 7994 | -S "Client initiated reconnection from same port" |
| 7995 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7996 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 7997 | -p "$P_PXY inject_clihlo=1" \ |
| 7998 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 7999 | "$P_CLI dtls=1 exchanges=2" \ |
| 8000 | 0 \ |
| 8001 | -s "possible client reconnect from the same port" \ |
| 8002 | -S "Client initiated reconnection from same port" |
| 8003 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8004 | # Tests for various cases of client authentication with DTLS |
| 8005 | # (focused on handshake flows and message parsing) |
| 8006 | |
| 8007 | run_test "DTLS client auth: required" \ |
| 8008 | "$P_SRV dtls=1 auth_mode=required" \ |
| 8009 | "$P_CLI dtls=1" \ |
| 8010 | 0 \ |
| 8011 | -s "Verifying peer X.509 certificate... ok" |
| 8012 | |
| 8013 | run_test "DTLS client auth: optional, client has no cert" \ |
| 8014 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 8015 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 8016 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8017 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8018 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8019 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8020 | "$P_SRV dtls=1 auth_mode=none" \ |
| 8021 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 8022 | 0 \ |
| 8023 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8024 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8025 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 8026 | run_test "DTLS wrong PSK: badmac alert" \ |
| 8027 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 8028 | "$P_CLI dtls=1 psk=abc124" \ |
| 8029 | 1 \ |
| 8030 | -s "SSL - Verification of the message MAC failed" \ |
| 8031 | -c "SSL - A fatal alert message was received from our peer" |
| 8032 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8033 | # Tests for receiving fragmented handshake messages with DTLS |
| 8034 | |
| 8035 | requires_gnutls |
| 8036 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 8037 | "$G_SRV -u --mtu 2048 -a" \ |
| 8038 | "$P_CLI dtls=1 debug_level=2" \ |
| 8039 | 0 \ |
| 8040 | -C "found fragmented DTLS handshake message" \ |
| 8041 | -C "error" |
| 8042 | |
| 8043 | requires_gnutls |
| 8044 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 8045 | "$G_SRV -u --mtu 512" \ |
| 8046 | "$P_CLI dtls=1 debug_level=2" \ |
| 8047 | 0 \ |
| 8048 | -c "found fragmented DTLS handshake message" \ |
| 8049 | -C "error" |
| 8050 | |
| 8051 | requires_gnutls |
| 8052 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 8053 | "$G_SRV -u --mtu 128" \ |
| 8054 | "$P_CLI dtls=1 debug_level=2" \ |
| 8055 | 0 \ |
| 8056 | -c "found fragmented DTLS handshake message" \ |
| 8057 | -C "error" |
| 8058 | |
| 8059 | requires_gnutls |
| 8060 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 8061 | "$G_SRV -u --mtu 128" \ |
| 8062 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8063 | 0 \ |
| 8064 | -c "found fragmented DTLS handshake message" \ |
| 8065 | -C "error" |
| 8066 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8067 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8068 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8069 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 8070 | "$G_SRV -u --mtu 256" \ |
| 8071 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8072 | 0 \ |
| 8073 | -c "found fragmented DTLS handshake message" \ |
| 8074 | -c "client hello, adding renegotiation extension" \ |
| 8075 | -c "found renegotiation extension" \ |
| 8076 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8077 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8078 | -C "error" \ |
| 8079 | -s "Extra-header:" |
| 8080 | |
| 8081 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8082 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8083 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 8084 | "$G_SRV -u --mtu 256" \ |
| 8085 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8086 | 0 \ |
| 8087 | -c "found fragmented DTLS handshake message" \ |
| 8088 | -c "client hello, adding renegotiation extension" \ |
| 8089 | -c "found renegotiation extension" \ |
| 8090 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8091 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8092 | -C "error" \ |
| 8093 | -s "Extra-header:" |
| 8094 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8095 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 8096 | "$O_SRV -dtls1 -mtu 2048" \ |
| 8097 | "$P_CLI dtls=1 debug_level=2" \ |
| 8098 | 0 \ |
| 8099 | -C "found fragmented DTLS handshake message" \ |
| 8100 | -C "error" |
| 8101 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8102 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 8103 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8104 | "$P_CLI dtls=1 debug_level=2" \ |
| 8105 | 0 \ |
| 8106 | -c "found fragmented DTLS handshake message" \ |
| 8107 | -C "error" |
| 8108 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8109 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8110 | "$O_SRV -dtls1 -mtu 256" \ |
| 8111 | "$P_CLI dtls=1 debug_level=2" \ |
| 8112 | 0 \ |
| 8113 | -c "found fragmented DTLS handshake message" \ |
| 8114 | -C "error" |
| 8115 | |
| 8116 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 8117 | "$O_SRV -dtls1 -mtu 256" \ |
| 8118 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8119 | 0 \ |
| 8120 | -c "found fragmented DTLS handshake message" \ |
| 8121 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8122 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8123 | # Tests for sending fragmented handshake messages with DTLS |
| 8124 | # |
| 8125 | # Use client auth when we need the client to send large messages, |
| 8126 | # and use large cert chains on both sides too (the long chains we have all use |
| 8127 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 8128 | # Sizes reached (UDP payload): |
| 8129 | # - 2037B for server certificate |
| 8130 | # - 1542B for client certificate |
| 8131 | # - 1013B for newsessionticket |
| 8132 | # - all others below 512B |
| 8133 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 8134 | |
| 8135 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8136 | requires_config_enabled MBEDTLS_RSA_C |
| 8137 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8138 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8139 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8140 | run_test "DTLS fragmenting: none (for reference)" \ |
| 8141 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8142 | crt_file=data_files/server7_int-ca.crt \ |
| 8143 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8144 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8145 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8146 | "$P_CLI dtls=1 debug_level=2 \ |
| 8147 | crt_file=data_files/server8_int-ca2.crt \ |
| 8148 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8149 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8150 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8151 | 0 \ |
| 8152 | -S "found fragmented DTLS handshake message" \ |
| 8153 | -C "found fragmented DTLS handshake message" \ |
| 8154 | -C "error" |
| 8155 | |
| 8156 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8157 | requires_config_enabled MBEDTLS_RSA_C |
| 8158 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8159 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8160 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8161 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8162 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8163 | crt_file=data_files/server7_int-ca.crt \ |
| 8164 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8165 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8166 | max_frag_len=1024" \ |
| 8167 | "$P_CLI dtls=1 debug_level=2 \ |
| 8168 | crt_file=data_files/server8_int-ca2.crt \ |
| 8169 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8170 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8171 | max_frag_len=2048" \ |
| 8172 | 0 \ |
| 8173 | -S "found fragmented DTLS handshake message" \ |
| 8174 | -c "found fragmented DTLS handshake message" \ |
| 8175 | -C "error" |
| 8176 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8177 | # With the MFL extension, the server has no way of forcing |
| 8178 | # the client to not exceed a certain MTU; hence, the following |
| 8179 | # test can't be replicated with an MTU proxy such as the one |
| 8180 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8181 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8182 | requires_config_enabled MBEDTLS_RSA_C |
| 8183 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8184 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8185 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8186 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8187 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8188 | crt_file=data_files/server7_int-ca.crt \ |
| 8189 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8190 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8191 | max_frag_len=512" \ |
| 8192 | "$P_CLI dtls=1 debug_level=2 \ |
| 8193 | crt_file=data_files/server8_int-ca2.crt \ |
| 8194 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8195 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8196 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8197 | 0 \ |
| 8198 | -S "found fragmented DTLS handshake message" \ |
| 8199 | -c "found fragmented DTLS handshake message" \ |
| 8200 | -C "error" |
| 8201 | |
| 8202 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8203 | requires_config_enabled MBEDTLS_RSA_C |
| 8204 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8205 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8206 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8207 | 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] | 8208 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8209 | crt_file=data_files/server7_int-ca.crt \ |
| 8210 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8211 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8212 | max_frag_len=2048" \ |
| 8213 | "$P_CLI dtls=1 debug_level=2 \ |
| 8214 | crt_file=data_files/server8_int-ca2.crt \ |
| 8215 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8216 | hs_timeout=2500-60000 \ |
| 8217 | max_frag_len=1024" \ |
| 8218 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8219 | -S "found fragmented DTLS handshake message" \ |
| 8220 | -c "found fragmented DTLS handshake message" \ |
| 8221 | -C "error" |
| 8222 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8223 | # While not required by the standard defining the MFL extension |
| 8224 | # (according to which it only applies to records, not to datagrams), |
| 8225 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8226 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8227 | # to the peer. |
| 8228 | # The next test checks that no datagrams significantly larger than the |
| 8229 | # negotiated MFL are sent. |
| 8230 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8231 | requires_config_enabled MBEDTLS_RSA_C |
| 8232 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8233 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8234 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8235 | 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] | 8236 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8237 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8238 | crt_file=data_files/server7_int-ca.crt \ |
| 8239 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8240 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8241 | max_frag_len=2048" \ |
| 8242 | "$P_CLI dtls=1 debug_level=2 \ |
| 8243 | crt_file=data_files/server8_int-ca2.crt \ |
| 8244 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8245 | hs_timeout=2500-60000 \ |
| 8246 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8247 | 0 \ |
| 8248 | -S "found fragmented DTLS handshake message" \ |
| 8249 | -c "found fragmented DTLS handshake message" \ |
| 8250 | -C "error" |
| 8251 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8252 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8253 | requires_config_enabled MBEDTLS_RSA_C |
| 8254 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8255 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8256 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8257 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8258 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8259 | crt_file=data_files/server7_int-ca.crt \ |
| 8260 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8261 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8262 | max_frag_len=2048" \ |
| 8263 | "$P_CLI dtls=1 debug_level=2 \ |
| 8264 | crt_file=data_files/server8_int-ca2.crt \ |
| 8265 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8266 | hs_timeout=2500-60000 \ |
| 8267 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8268 | 0 \ |
| 8269 | -s "found fragmented DTLS handshake message" \ |
| 8270 | -c "found fragmented DTLS handshake message" \ |
| 8271 | -C "error" |
| 8272 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8273 | # While not required by the standard defining the MFL extension |
| 8274 | # (according to which it only applies to records, not to datagrams), |
| 8275 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8276 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8277 | # to the peer. |
| 8278 | # The next test checks that no datagrams significantly larger than the |
| 8279 | # negotiated MFL are sent. |
| 8280 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8281 | requires_config_enabled MBEDTLS_RSA_C |
| 8282 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8283 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8284 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8285 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 8286 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8287 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8288 | crt_file=data_files/server7_int-ca.crt \ |
| 8289 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8290 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8291 | max_frag_len=2048" \ |
| 8292 | "$P_CLI dtls=1 debug_level=2 \ |
| 8293 | crt_file=data_files/server8_int-ca2.crt \ |
| 8294 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8295 | hs_timeout=2500-60000 \ |
| 8296 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8297 | 0 \ |
| 8298 | -s "found fragmented DTLS handshake message" \ |
| 8299 | -c "found fragmented DTLS handshake message" \ |
| 8300 | -C "error" |
| 8301 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8302 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8303 | requires_config_enabled MBEDTLS_RSA_C |
| 8304 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8305 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8306 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 8307 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8308 | crt_file=data_files/server7_int-ca.crt \ |
| 8309 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8310 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8311 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8312 | "$P_CLI dtls=1 debug_level=2 \ |
| 8313 | crt_file=data_files/server8_int-ca2.crt \ |
| 8314 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8315 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8316 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8317 | 0 \ |
| 8318 | -S "found fragmented DTLS handshake message" \ |
| 8319 | -C "found fragmented DTLS handshake message" \ |
| 8320 | -C "error" |
| 8321 | |
| 8322 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8323 | requires_config_enabled MBEDTLS_RSA_C |
| 8324 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8325 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8326 | run_test "DTLS fragmenting: client (MTU)" \ |
| 8327 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8328 | crt_file=data_files/server7_int-ca.crt \ |
| 8329 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8330 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8331 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8332 | "$P_CLI dtls=1 debug_level=2 \ |
| 8333 | crt_file=data_files/server8_int-ca2.crt \ |
| 8334 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8335 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8336 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8337 | 0 \ |
| 8338 | -s "found fragmented DTLS handshake message" \ |
| 8339 | -C "found fragmented DTLS handshake message" \ |
| 8340 | -C "error" |
| 8341 | |
| 8342 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8343 | requires_config_enabled MBEDTLS_RSA_C |
| 8344 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8345 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8346 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8347 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8348 | crt_file=data_files/server7_int-ca.crt \ |
| 8349 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8350 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8351 | mtu=512" \ |
| 8352 | "$P_CLI dtls=1 debug_level=2 \ |
| 8353 | crt_file=data_files/server8_int-ca2.crt \ |
| 8354 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8355 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8356 | mtu=2048" \ |
| 8357 | 0 \ |
| 8358 | -S "found fragmented DTLS handshake message" \ |
| 8359 | -c "found fragmented DTLS handshake message" \ |
| 8360 | -C "error" |
| 8361 | |
| 8362 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8363 | requires_config_enabled MBEDTLS_RSA_C |
| 8364 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8365 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8366 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8367 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8368 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8369 | crt_file=data_files/server7_int-ca.crt \ |
| 8370 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8371 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8372 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8373 | "$P_CLI dtls=1 debug_level=2 \ |
| 8374 | crt_file=data_files/server8_int-ca2.crt \ |
| 8375 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8376 | hs_timeout=2500-60000 \ |
| 8377 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8378 | 0 \ |
| 8379 | -s "found fragmented DTLS handshake message" \ |
| 8380 | -c "found fragmented DTLS handshake message" \ |
| 8381 | -C "error" |
| 8382 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8383 | # 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] | 8384 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8385 | requires_config_enabled MBEDTLS_RSA_C |
| 8386 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8387 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8388 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8389 | requires_config_enabled MBEDTLS_AES_C |
| 8390 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8391 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8392 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8393 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8394 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8395 | crt_file=data_files/server7_int-ca.crt \ |
| 8396 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8397 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8398 | mtu=512" \ |
| 8399 | "$P_CLI dtls=1 debug_level=2 \ |
| 8400 | crt_file=data_files/server8_int-ca2.crt \ |
| 8401 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8402 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8403 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8404 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8405 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8406 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8407 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8408 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8409 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8410 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8411 | # 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] | 8412 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8413 | # retransmissions, but in some cases (like both the server and client using |
| 8414 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8415 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8416 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8417 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8418 | requires_config_enabled MBEDTLS_RSA_C |
| 8419 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8420 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8421 | requires_config_enabled MBEDTLS_AES_C |
| 8422 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8423 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8424 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8425 | -p "$P_PXY mtu=508" \ |
| 8426 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8427 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8428 | key_file=data_files/server7.key \ |
| 8429 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8430 | "$P_CLI dtls=1 debug_level=2 \ |
| 8431 | crt_file=data_files/server8_int-ca2.crt \ |
| 8432 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8433 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8434 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8435 | 0 \ |
| 8436 | -s "found fragmented DTLS handshake message" \ |
| 8437 | -c "found fragmented DTLS handshake message" \ |
| 8438 | -C "error" |
| 8439 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8440 | # 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] | 8441 | only_with_valgrind |
| 8442 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8443 | requires_config_enabled MBEDTLS_RSA_C |
| 8444 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8445 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8446 | requires_config_enabled MBEDTLS_AES_C |
| 8447 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8448 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8449 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8450 | -p "$P_PXY mtu=508" \ |
| 8451 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8452 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8453 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8454 | hs_timeout=250-10000" \ |
| 8455 | "$P_CLI dtls=1 debug_level=2 \ |
| 8456 | crt_file=data_files/server8_int-ca2.crt \ |
| 8457 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8458 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8459 | hs_timeout=250-10000" \ |
| 8460 | 0 \ |
| 8461 | -s "found fragmented DTLS handshake message" \ |
| 8462 | -c "found fragmented DTLS handshake message" \ |
| 8463 | -C "error" |
| 8464 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8465 | # 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] | 8466 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8467 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8468 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8469 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8470 | requires_config_enabled MBEDTLS_RSA_C |
| 8471 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8472 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8473 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8474 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8475 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8476 | crt_file=data_files/server7_int-ca.crt \ |
| 8477 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8478 | hs_timeout=10000-60000 \ |
| 8479 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8480 | "$P_CLI dtls=1 debug_level=2 \ |
| 8481 | crt_file=data_files/server8_int-ca2.crt \ |
| 8482 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8483 | hs_timeout=10000-60000 \ |
| 8484 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8485 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8486 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8487 | -s "found fragmented DTLS handshake message" \ |
| 8488 | -c "found fragmented DTLS handshake message" \ |
| 8489 | -C "error" |
| 8490 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8491 | # 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] | 8492 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8493 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8494 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8495 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8496 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8497 | requires_config_enabled MBEDTLS_RSA_C |
| 8498 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8499 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8500 | requires_config_enabled MBEDTLS_AES_C |
| 8501 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8502 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8503 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8504 | -p "$P_PXY mtu=512" \ |
| 8505 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8506 | crt_file=data_files/server7_int-ca.crt \ |
| 8507 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8508 | hs_timeout=10000-60000 \ |
| 8509 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8510 | "$P_CLI dtls=1 debug_level=2 \ |
| 8511 | crt_file=data_files/server8_int-ca2.crt \ |
| 8512 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8513 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8514 | hs_timeout=10000-60000 \ |
| 8515 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8516 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8517 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8518 | -s "found fragmented DTLS handshake message" \ |
| 8519 | -c "found fragmented DTLS handshake message" \ |
| 8520 | -C "error" |
| 8521 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8522 | not_with_valgrind # spurious autoreduction due to timeout |
| 8523 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8524 | requires_config_enabled MBEDTLS_RSA_C |
| 8525 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8526 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8527 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8528 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8529 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8530 | crt_file=data_files/server7_int-ca.crt \ |
| 8531 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8532 | hs_timeout=10000-60000 \ |
| 8533 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8534 | "$P_CLI dtls=1 debug_level=2 \ |
| 8535 | crt_file=data_files/server8_int-ca2.crt \ |
| 8536 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8537 | hs_timeout=10000-60000 \ |
| 8538 | mtu=1024 nbio=2" \ |
| 8539 | 0 \ |
| 8540 | -S "autoreduction" \ |
| 8541 | -s "found fragmented DTLS handshake message" \ |
| 8542 | -c "found fragmented DTLS handshake message" \ |
| 8543 | -C "error" |
| 8544 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8545 | # 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] | 8546 | not_with_valgrind # spurious autoreduction due to timeout |
| 8547 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8548 | requires_config_enabled MBEDTLS_RSA_C |
| 8549 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8550 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8551 | requires_config_enabled MBEDTLS_AES_C |
| 8552 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8553 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8554 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8555 | -p "$P_PXY mtu=512" \ |
| 8556 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8557 | crt_file=data_files/server7_int-ca.crt \ |
| 8558 | key_file=data_files/server7.key \ |
| 8559 | hs_timeout=10000-60000 \ |
| 8560 | mtu=512 nbio=2" \ |
| 8561 | "$P_CLI dtls=1 debug_level=2 \ |
| 8562 | crt_file=data_files/server8_int-ca2.crt \ |
| 8563 | key_file=data_files/server8.key \ |
| 8564 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8565 | hs_timeout=10000-60000 \ |
| 8566 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8567 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8568 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8569 | -s "found fragmented DTLS handshake message" \ |
| 8570 | -c "found fragmented DTLS handshake message" \ |
| 8571 | -C "error" |
| 8572 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8573 | # 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] | 8574 | # This ensures things still work after session_reset(). |
| 8575 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8576 | # Since we don't support reading fragmented ClientHello yet, |
| 8577 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8578 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8579 | # An autoreduction on the client-side might happen if the server is |
| 8580 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8581 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8582 | # resumed listening, which would result in a spurious autoreduction. |
| 8583 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8584 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8585 | requires_config_enabled MBEDTLS_RSA_C |
| 8586 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8587 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8588 | requires_config_enabled MBEDTLS_AES_C |
| 8589 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8590 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8591 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8592 | -p "$P_PXY mtu=1450" \ |
| 8593 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8594 | crt_file=data_files/server7_int-ca.crt \ |
| 8595 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8596 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8597 | mtu=1450" \ |
| 8598 | "$P_CLI dtls=1 debug_level=2 \ |
| 8599 | crt_file=data_files/server8_int-ca2.crt \ |
| 8600 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8601 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8602 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8603 | 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] | 8604 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8605 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8606 | -s "found fragmented DTLS handshake message" \ |
| 8607 | -c "found fragmented DTLS handshake message" \ |
| 8608 | -C "error" |
| 8609 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8610 | # An autoreduction on the client-side might happen if the server is |
| 8611 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8612 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8613 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8614 | requires_config_enabled MBEDTLS_RSA_C |
| 8615 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8616 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8617 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8618 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8619 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8620 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8621 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8622 | -p "$P_PXY mtu=512" \ |
| 8623 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8624 | crt_file=data_files/server7_int-ca.crt \ |
| 8625 | key_file=data_files/server7.key \ |
| 8626 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8627 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8628 | mtu=512" \ |
| 8629 | "$P_CLI dtls=1 debug_level=2 \ |
| 8630 | crt_file=data_files/server8_int-ca2.crt \ |
| 8631 | key_file=data_files/server8.key \ |
| 8632 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8633 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8634 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8635 | mtu=512" \ |
| 8636 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8637 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8638 | -s "found fragmented DTLS handshake message" \ |
| 8639 | -c "found fragmented DTLS handshake message" \ |
| 8640 | -C "error" |
| 8641 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8642 | # An autoreduction on the client-side might happen if the server is |
| 8643 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8644 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8645 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8646 | requires_config_enabled MBEDTLS_RSA_C |
| 8647 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8648 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8649 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8650 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8651 | requires_config_enabled MBEDTLS_AES_C |
| 8652 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8653 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8654 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8655 | -p "$P_PXY mtu=512" \ |
| 8656 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8657 | crt_file=data_files/server7_int-ca.crt \ |
| 8658 | key_file=data_files/server7.key \ |
| 8659 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8660 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8661 | mtu=512" \ |
| 8662 | "$P_CLI dtls=1 debug_level=2 \ |
| 8663 | crt_file=data_files/server8_int-ca2.crt \ |
| 8664 | key_file=data_files/server8.key \ |
| 8665 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8666 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8667 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8668 | mtu=512" \ |
| 8669 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8670 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8671 | -s "found fragmented DTLS handshake message" \ |
| 8672 | -c "found fragmented DTLS handshake message" \ |
| 8673 | -C "error" |
| 8674 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8675 | # An autoreduction on the client-side might happen if the server is |
| 8676 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8677 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8678 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8679 | requires_config_enabled MBEDTLS_RSA_C |
| 8680 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8681 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8682 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8683 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8684 | requires_config_enabled MBEDTLS_AES_C |
| 8685 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8686 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8687 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8688 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8689 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8690 | crt_file=data_files/server7_int-ca.crt \ |
| 8691 | key_file=data_files/server7.key \ |
| 8692 | exchanges=2 renegotiation=1 \ |
| 8693 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8694 | hs_timeout=10000-60000 \ |
| 8695 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8696 | "$P_CLI dtls=1 debug_level=2 \ |
| 8697 | crt_file=data_files/server8_int-ca2.crt \ |
| 8698 | key_file=data_files/server8.key \ |
| 8699 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8700 | hs_timeout=10000-60000 \ |
| 8701 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8702 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8703 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8704 | -s "found fragmented DTLS handshake message" \ |
| 8705 | -c "found fragmented DTLS handshake message" \ |
| 8706 | -C "error" |
| 8707 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8708 | # An autoreduction on the client-side might happen if the server is |
| 8709 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8710 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8711 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8712 | requires_config_enabled MBEDTLS_RSA_C |
| 8713 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8714 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8715 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8716 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8717 | requires_config_enabled MBEDTLS_AES_C |
| 8718 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8719 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8720 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8721 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8722 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8723 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8724 | crt_file=data_files/server7_int-ca.crt \ |
| 8725 | key_file=data_files/server7.key \ |
| 8726 | exchanges=2 renegotiation=1 \ |
| 8727 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8728 | hs_timeout=10000-60000 \ |
| 8729 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8730 | "$P_CLI dtls=1 debug_level=2 \ |
| 8731 | crt_file=data_files/server8_int-ca2.crt \ |
| 8732 | key_file=data_files/server8.key \ |
| 8733 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8734 | hs_timeout=10000-60000 \ |
| 8735 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8736 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8737 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8738 | -s "found fragmented DTLS handshake message" \ |
| 8739 | -c "found fragmented DTLS handshake message" \ |
| 8740 | -C "error" |
| 8741 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8742 | # An autoreduction on the client-side might happen if the server is |
| 8743 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8744 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8745 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8746 | requires_config_enabled MBEDTLS_RSA_C |
| 8747 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8748 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8749 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8750 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8751 | requires_config_enabled MBEDTLS_AES_C |
| 8752 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8753 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8754 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8755 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8756 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8757 | crt_file=data_files/server7_int-ca.crt \ |
| 8758 | key_file=data_files/server7.key \ |
| 8759 | exchanges=2 renegotiation=1 \ |
| 8760 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8761 | hs_timeout=10000-60000 \ |
| 8762 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8763 | "$P_CLI dtls=1 debug_level=2 \ |
| 8764 | crt_file=data_files/server8_int-ca2.crt \ |
| 8765 | key_file=data_files/server8.key \ |
| 8766 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8767 | hs_timeout=10000-60000 \ |
| 8768 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8769 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8770 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8771 | -s "found fragmented DTLS handshake message" \ |
| 8772 | -c "found fragmented DTLS handshake message" \ |
| 8773 | -C "error" |
| 8774 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8775 | # 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] | 8776 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8777 | requires_config_enabled MBEDTLS_RSA_C |
| 8778 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8779 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8780 | requires_config_enabled MBEDTLS_AES_C |
| 8781 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8782 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8783 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8784 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8785 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8786 | "$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] | 8787 | crt_file=data_files/server7_int-ca.crt \ |
| 8788 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8789 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8790 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8791 | crt_file=data_files/server8_int-ca2.crt \ |
| 8792 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8793 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8794 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8795 | 0 \ |
| 8796 | -s "found fragmented DTLS handshake message" \ |
| 8797 | -c "found fragmented DTLS handshake message" \ |
| 8798 | -C "error" |
| 8799 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8800 | # 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] | 8801 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8802 | requires_config_enabled MBEDTLS_RSA_C |
| 8803 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8804 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8805 | requires_config_enabled MBEDTLS_AES_C |
| 8806 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8807 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8808 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8809 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 8810 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 8811 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8812 | crt_file=data_files/server7_int-ca.crt \ |
| 8813 | key_file=data_files/server7.key \ |
| 8814 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8815 | "$P_CLI dtls=1 debug_level=2 \ |
| 8816 | crt_file=data_files/server8_int-ca2.crt \ |
| 8817 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8818 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8819 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 8820 | 0 \ |
| 8821 | -s "found fragmented DTLS handshake message" \ |
| 8822 | -c "found fragmented DTLS handshake message" \ |
| 8823 | -C "error" |
| 8824 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8825 | # interop tests for DTLS fragmentating with reliable connection |
| 8826 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8827 | # here and below we just want to test that the we fragment in a way that |
| 8828 | # pleases other implementations, so we don't need the peer to fragment |
| 8829 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8830 | requires_config_enabled MBEDTLS_RSA_C |
| 8831 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8833 | requires_gnutls |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8834 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8835 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 8836 | "$G_SRV -u" \ |
| 8837 | "$P_CLI dtls=1 debug_level=2 \ |
| 8838 | crt_file=data_files/server8_int-ca2.crt \ |
| 8839 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8840 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8841 | 0 \ |
| 8842 | -c "fragmenting handshake message" \ |
| 8843 | -C "error" |
| 8844 | |
| 8845 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8846 | requires_config_enabled MBEDTLS_RSA_C |
| 8847 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8848 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8849 | requires_gnutls |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8850 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8851 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 8852 | "$G_SRV -u" \ |
| 8853 | "$P_CLI dtls=1 debug_level=2 \ |
| 8854 | crt_file=data_files/server8_int-ca2.crt \ |
| 8855 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8856 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8857 | 0 \ |
| 8858 | -c "fragmenting handshake message" \ |
| 8859 | -C "error" |
| 8860 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8861 | # We use --insecure for the GnuTLS client because it expects |
| 8862 | # the hostname / IP it connects to to be the name used in the |
| 8863 | # certificate obtained from the server. Here, however, it |
| 8864 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 8865 | # as the server name in the certificate. This will make the |
| 8866 | # certifiate validation fail, but passing --insecure makes |
| 8867 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8868 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8869 | requires_config_enabled MBEDTLS_RSA_C |
| 8870 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8871 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8872 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8873 | requires_not_i686 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8874 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8875 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8876 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8877 | crt_file=data_files/server7_int-ca.crt \ |
| 8878 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8879 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8880 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8881 | 0 \ |
| 8882 | -s "fragmenting handshake message" |
| 8883 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8884 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8885 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8886 | requires_config_enabled MBEDTLS_RSA_C |
| 8887 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8888 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8889 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8890 | requires_not_i686 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8891 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8892 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8893 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8894 | crt_file=data_files/server7_int-ca.crt \ |
| 8895 | key_file=data_files/server7.key \ |
| 8896 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8897 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8898 | 0 \ |
| 8899 | -s "fragmenting handshake message" |
| 8900 | |
| 8901 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8902 | requires_config_enabled MBEDTLS_RSA_C |
| 8903 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8904 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8905 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8906 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 8907 | "$O_SRV -dtls1_2 -verify 10" \ |
| 8908 | "$P_CLI dtls=1 debug_level=2 \ |
| 8909 | crt_file=data_files/server8_int-ca2.crt \ |
| 8910 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8911 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8912 | 0 \ |
| 8913 | -c "fragmenting handshake message" \ |
| 8914 | -C "error" |
| 8915 | |
| 8916 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8917 | requires_config_enabled MBEDTLS_RSA_C |
| 8918 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8919 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8920 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8921 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 8922 | "$O_SRV -dtls1 -verify 10" \ |
| 8923 | "$P_CLI dtls=1 debug_level=2 \ |
| 8924 | crt_file=data_files/server8_int-ca2.crt \ |
| 8925 | key_file=data_files/server8.key \ |
| 8926 | mtu=512 force_version=dtls1" \ |
| 8927 | 0 \ |
| 8928 | -c "fragmenting handshake message" \ |
| 8929 | -C "error" |
| 8930 | |
| 8931 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8932 | requires_config_enabled MBEDTLS_RSA_C |
| 8933 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8934 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8935 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8936 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 8937 | "$P_SRV dtls=1 debug_level=2 \ |
| 8938 | crt_file=data_files/server7_int-ca.crt \ |
| 8939 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8940 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8941 | "$O_CLI -dtls1_2" \ |
| 8942 | 0 \ |
| 8943 | -s "fragmenting handshake message" |
| 8944 | |
| 8945 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8946 | requires_config_enabled MBEDTLS_RSA_C |
| 8947 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8948 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8949 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8950 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 8951 | "$P_SRV dtls=1 debug_level=2 \ |
| 8952 | crt_file=data_files/server7_int-ca.crt \ |
| 8953 | key_file=data_files/server7.key \ |
| 8954 | mtu=512 force_version=dtls1" \ |
| 8955 | "$O_CLI -dtls1" \ |
| 8956 | 0 \ |
| 8957 | -s "fragmenting handshake message" |
| 8958 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8959 | # interop tests for DTLS fragmentating with unreliable connection |
| 8960 | # |
| 8961 | # again we just want to test that the we fragment in a way that |
| 8962 | # pleases other implementations, so we don't need the peer to fragment |
| 8963 | requires_gnutls_next |
| 8964 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8965 | requires_config_enabled MBEDTLS_RSA_C |
| 8966 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8967 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8968 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8969 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8970 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 8971 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8972 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8973 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8974 | crt_file=data_files/server8_int-ca2.crt \ |
| 8975 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 8976 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8977 | 0 \ |
| 8978 | -c "fragmenting handshake message" \ |
| 8979 | -C "error" |
| 8980 | |
| 8981 | requires_gnutls_next |
| 8982 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8983 | requires_config_enabled MBEDTLS_RSA_C |
| 8984 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8985 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8986 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 8987 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8988 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 8989 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 8990 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8991 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8992 | crt_file=data_files/server8_int-ca2.crt \ |
| 8993 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8994 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8995 | 0 \ |
| 8996 | -c "fragmenting handshake message" \ |
| 8997 | -C "error" |
| 8998 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8999 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9000 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9001 | requires_config_enabled MBEDTLS_RSA_C |
| 9002 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9003 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9004 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9005 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9006 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 9007 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9008 | "$P_SRV dtls=1 debug_level=2 \ |
| 9009 | crt_file=data_files/server7_int-ca.crt \ |
| 9010 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9011 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9012 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9013 | 0 \ |
| 9014 | -s "fragmenting handshake message" |
| 9015 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9016 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9017 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9018 | requires_config_enabled MBEDTLS_RSA_C |
| 9019 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9020 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 9021 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9022 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9023 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 9024 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9025 | "$P_SRV dtls=1 debug_level=2 \ |
| 9026 | crt_file=data_files/server7_int-ca.crt \ |
| 9027 | key_file=data_files/server7.key \ |
| 9028 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9029 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9030 | 0 \ |
| 9031 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9032 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9033 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 9034 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9035 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9036 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9037 | ## (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] | 9038 | skip_next_test |
| 9039 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9040 | requires_config_enabled MBEDTLS_RSA_C |
| 9041 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9042 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9043 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9044 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9045 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 9046 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9047 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9048 | "$P_CLI dtls=1 debug_level=2 \ |
| 9049 | crt_file=data_files/server8_int-ca2.crt \ |
| 9050 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9051 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9052 | 0 \ |
| 9053 | -c "fragmenting handshake message" \ |
| 9054 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9055 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9056 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9057 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9058 | requires_config_enabled MBEDTLS_RSA_C |
| 9059 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9060 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9061 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9062 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9063 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 9064 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9065 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9066 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9067 | crt_file=data_files/server8_int-ca2.crt \ |
| 9068 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9069 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9070 | 0 \ |
| 9071 | -c "fragmenting handshake message" \ |
| 9072 | -C "error" |
| 9073 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9074 | skip_next_test |
| 9075 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9076 | requires_config_enabled MBEDTLS_RSA_C |
| 9077 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9078 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 9079 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9080 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9081 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 9082 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9083 | "$P_SRV dtls=1 debug_level=2 \ |
| 9084 | crt_file=data_files/server7_int-ca.crt \ |
| 9085 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9086 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9087 | "$O_CLI -dtls1_2" \ |
| 9088 | 0 \ |
| 9089 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9090 | |
| 9091 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 9092 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9093 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9094 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9095 | requires_config_enabled MBEDTLS_RSA_C |
| 9096 | requires_config_enabled MBEDTLS_ECDSA_C |
| 9097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9098 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9099 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9100 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 9101 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9102 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9103 | crt_file=data_files/server7_int-ca.crt \ |
| 9104 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9105 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9106 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9107 | 0 \ |
| 9108 | -s "fragmenting handshake message" |
| 9109 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9110 | # Tests for DTLS-SRTP (RFC 5764) |
| 9111 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9112 | run_test "DTLS-SRTP all profiles supported" \ |
| 9113 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9114 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9115 | 0 \ |
| 9116 | -s "found use_srtp extension" \ |
| 9117 | -s "found srtp profile" \ |
| 9118 | -s "selected srtp profile" \ |
| 9119 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9120 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9121 | -c "client hello, adding use_srtp extension" \ |
| 9122 | -c "found use_srtp extension" \ |
| 9123 | -c "found srtp profile" \ |
| 9124 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9125 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9126 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9127 | -C "error" |
| 9128 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9129 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9130 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9131 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 9132 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9133 | "$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] | 9134 | 0 \ |
| 9135 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9136 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 9137 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9138 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9139 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9140 | -c "client hello, adding use_srtp extension" \ |
| 9141 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9142 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9143 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9144 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9145 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9146 | -C "error" |
| 9147 | |
| 9148 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9149 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9150 | "$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] | 9151 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9152 | 0 \ |
| 9153 | -s "found use_srtp extension" \ |
| 9154 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9155 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9156 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9157 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9158 | -c "client hello, adding use_srtp extension" \ |
| 9159 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9160 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9161 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9162 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9163 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9164 | -C "error" |
| 9165 | |
| 9166 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9167 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 9168 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9169 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9170 | 0 \ |
| 9171 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9172 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9173 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9174 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9175 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9176 | -c "client hello, adding use_srtp extension" \ |
| 9177 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9178 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9179 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9180 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9181 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9182 | -C "error" |
| 9183 | |
| 9184 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9185 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 9186 | "$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] | 9187 | "$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] | 9188 | 0 \ |
| 9189 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9190 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9191 | -S "selected srtp profile" \ |
| 9192 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9193 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9194 | -c "client hello, adding use_srtp extension" \ |
| 9195 | -C "found use_srtp extension" \ |
| 9196 | -C "found srtp profile" \ |
| 9197 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9198 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9199 | -C "error" |
| 9200 | |
| 9201 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9202 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 9203 | "$P_SRV dtls=1 debug_level=3" \ |
| 9204 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9205 | 0 \ |
| 9206 | -s "found use_srtp extension" \ |
| 9207 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9208 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9209 | -c "client hello, adding use_srtp extension" \ |
| 9210 | -C "found use_srtp extension" \ |
| 9211 | -C "found srtp profile" \ |
| 9212 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9213 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9214 | -C "error" |
| 9215 | |
| 9216 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9217 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 9218 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 9219 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9220 | 0 \ |
| 9221 | -s "found use_srtp extension" \ |
| 9222 | -s "found srtp profile" \ |
| 9223 | -s "selected srtp profile" \ |
| 9224 | -s "server hello, adding use_srtp extension" \ |
| 9225 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9226 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9227 | -c "client hello, adding use_srtp extension" \ |
| 9228 | -c "found use_srtp extension" \ |
| 9229 | -c "found srtp profile" \ |
| 9230 | -c "selected srtp profile" \ |
| 9231 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9232 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9233 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9234 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9235 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9236 | -C "error" |
| 9237 | |
| 9238 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9239 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 9240 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9241 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9242 | 0 \ |
| 9243 | -s "found use_srtp extension" \ |
| 9244 | -s "found srtp profile" \ |
| 9245 | -s "selected srtp profile" \ |
| 9246 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9247 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9248 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9249 | -S "dumping 'using mki' (8 bytes)" \ |
| 9250 | -c "client hello, adding use_srtp extension" \ |
| 9251 | -c "found use_srtp extension" \ |
| 9252 | -c "found srtp profile" \ |
| 9253 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9254 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9255 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9256 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9257 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9258 | -C "dumping 'received mki' (8 bytes)" \ |
| 9259 | -C "error" |
| 9260 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9261 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9262 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 9263 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9264 | "$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] | 9265 | 0 \ |
| 9266 | -s "found use_srtp extension" \ |
| 9267 | -s "found srtp profile" \ |
| 9268 | -s "selected srtp profile" \ |
| 9269 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9270 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9271 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9272 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 9273 | |
| 9274 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9275 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 9276 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9277 | "$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] | 9278 | 0 \ |
| 9279 | -s "found use_srtp extension" \ |
| 9280 | -s "found srtp profile" \ |
| 9281 | -s "selected srtp profile" \ |
| 9282 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9283 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9284 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9285 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9286 | |
| 9287 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9288 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 9289 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9290 | "$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] | 9291 | 0 \ |
| 9292 | -s "found use_srtp extension" \ |
| 9293 | -s "found srtp profile" \ |
| 9294 | -s "selected srtp profile" \ |
| 9295 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9296 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9297 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9298 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9299 | |
| 9300 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9301 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 9302 | "$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] | 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 "found srtp profile" \ |
| 9307 | -s "selected srtp profile" \ |
| 9308 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9309 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9310 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9311 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9312 | |
| 9313 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9314 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 9315 | "$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] | 9316 | "$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] | 9317 | 0 \ |
| 9318 | -s "found use_srtp extension" \ |
| 9319 | -s "found srtp profile" \ |
| 9320 | -s "selected srtp profile" \ |
| 9321 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9322 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9323 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9324 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9325 | |
| 9326 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9327 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 9328 | "$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] | 9329 | "$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] | 9330 | 0 \ |
| 9331 | -s "found use_srtp extension" \ |
| 9332 | -s "found srtp profile" \ |
| 9333 | -S "selected srtp profile" \ |
| 9334 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9335 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9336 | -C "SRTP Extension negotiated, profile" |
| 9337 | |
| 9338 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9339 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 9340 | "$P_SRV dtls=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9341 | "$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] | 9342 | 0 \ |
| 9343 | -s "found use_srtp extension" \ |
| 9344 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9345 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9346 | -C "SRTP Extension negotiated, profile" |
| 9347 | |
| 9348 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9349 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9350 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9351 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9352 | 0 \ |
| 9353 | -c "client hello, adding use_srtp extension" \ |
| 9354 | -c "found use_srtp extension" \ |
| 9355 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9356 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9357 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9358 | -C "error" |
| 9359 | |
| 9360 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9361 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9362 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9363 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9364 | 0 \ |
| 9365 | -c "client hello, adding use_srtp extension" \ |
| 9366 | -c "found use_srtp extension" \ |
| 9367 | -c "found srtp profile" \ |
| 9368 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9369 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9370 | -C "error" |
| 9371 | |
| 9372 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9373 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9374 | "$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] | 9375 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9376 | 0 \ |
| 9377 | -c "client hello, adding use_srtp extension" \ |
| 9378 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9379 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9380 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9381 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9382 | -C "error" |
| 9383 | |
| 9384 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9385 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9386 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9387 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9388 | 0 \ |
| 9389 | -c "client hello, adding use_srtp extension" \ |
| 9390 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9391 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9392 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9393 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9394 | -C "error" |
| 9395 | |
| 9396 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9397 | 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] | 9398 | "$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] | 9399 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9400 | 0 \ |
| 9401 | -c "client hello, adding use_srtp extension" \ |
| 9402 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9403 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9404 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9405 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9406 | -C "error" |
| 9407 | |
| 9408 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9409 | 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] | 9410 | "$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] | 9411 | "$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] | 9412 | 0 \ |
| 9413 | -c "client hello, adding use_srtp extension" \ |
| 9414 | -C "found use_srtp extension" \ |
| 9415 | -C "found srtp profile" \ |
| 9416 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9417 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9418 | -C "error" |
| 9419 | |
| 9420 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9421 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 9422 | "$O_SRV -dtls1" \ |
| 9423 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9424 | 0 \ |
| 9425 | -c "client hello, adding use_srtp extension" \ |
| 9426 | -C "found use_srtp extension" \ |
| 9427 | -C "found srtp profile" \ |
| 9428 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9429 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9430 | -C "error" |
| 9431 | |
| 9432 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9433 | 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] | 9434 | "$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] | 9435 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9436 | 0 \ |
| 9437 | -c "client hello, adding use_srtp extension" \ |
| 9438 | -c "found use_srtp extension" \ |
| 9439 | -c "found srtp profile" \ |
| 9440 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9441 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9442 | -c "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9443 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9444 | -C "dumping 'received mki' (8 bytes)" \ |
| 9445 | -C "error" |
| 9446 | |
| 9447 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9448 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9449 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9450 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9451 | "$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] | 9452 | 0 \ |
| 9453 | -s "found use_srtp extension" \ |
| 9454 | -s "found srtp profile" \ |
| 9455 | -s "selected srtp profile" \ |
| 9456 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9457 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9458 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 9459 | |
| 9460 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9461 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9462 | 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] | 9463 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9464 | "$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] | 9465 | 0 \ |
| 9466 | -s "found use_srtp extension" \ |
| 9467 | -s "found srtp profile" \ |
| 9468 | -s "selected srtp profile" \ |
| 9469 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9470 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9471 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 9472 | |
| 9473 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9474 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9475 | 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] | 9476 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9477 | "$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] | 9478 | 0 \ |
| 9479 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9480 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9481 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9482 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9483 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9484 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9485 | |
| 9486 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9487 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9488 | 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] | 9489 | "$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] | 9490 | "$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] | 9491 | 0 \ |
| 9492 | -s "found use_srtp extension" \ |
| 9493 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9494 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9495 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9496 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9497 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9498 | |
| 9499 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9500 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9501 | 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] | 9502 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9503 | "$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] | 9504 | 0 \ |
| 9505 | -s "found use_srtp extension" \ |
| 9506 | -s "found srtp profile" \ |
| 9507 | -s "selected srtp profile" \ |
| 9508 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9509 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9510 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9511 | |
| 9512 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9513 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9514 | 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] | 9515 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9516 | "$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] | 9517 | 0 \ |
| 9518 | -s "found use_srtp extension" \ |
| 9519 | -s "found srtp profile" \ |
| 9520 | -S "selected srtp profile" \ |
| 9521 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9522 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9523 | -C "SRTP profile:" |
| 9524 | |
| 9525 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9526 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9527 | 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] | 9528 | "$P_SRV dtls=1 debug_level=3" \ |
| 9529 | "$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] | 9530 | 0 \ |
| 9531 | -s "found use_srtp extension" \ |
| 9532 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9533 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9534 | -C "SRTP profile:" |
| 9535 | |
| 9536 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9537 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9538 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9539 | "$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" \ |
| 9540 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9541 | 0 \ |
| 9542 | -c "client hello, adding use_srtp extension" \ |
| 9543 | -c "found use_srtp extension" \ |
| 9544 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9545 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9546 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9547 | -C "error" |
| 9548 | |
| 9549 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9550 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9551 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9552 | "$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" \ |
| 9553 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9554 | 0 \ |
| 9555 | -c "client hello, adding use_srtp extension" \ |
| 9556 | -c "found use_srtp extension" \ |
| 9557 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9558 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9559 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9560 | -C "error" |
| 9561 | |
| 9562 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9563 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9564 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9565 | "$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" \ |
| 9566 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9567 | 0 \ |
| 9568 | -c "client hello, adding use_srtp extension" \ |
| 9569 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9570 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9571 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9572 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9573 | -C "error" |
| 9574 | |
| 9575 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9576 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9577 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9578 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9579 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9580 | 0 \ |
| 9581 | -c "client hello, adding use_srtp extension" \ |
| 9582 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9583 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9584 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9585 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9586 | -C "error" |
| 9587 | |
| 9588 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9589 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9590 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9591 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9592 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9593 | 0 \ |
| 9594 | -c "client hello, adding use_srtp extension" \ |
| 9595 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9596 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9597 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9598 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9599 | -C "error" |
| 9600 | |
| 9601 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9602 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9603 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9604 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9605 | "$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] | 9606 | 0 \ |
| 9607 | -c "client hello, adding use_srtp extension" \ |
| 9608 | -C "found use_srtp extension" \ |
| 9609 | -C "found srtp profile" \ |
| 9610 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9611 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9612 | -C "error" |
| 9613 | |
| 9614 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9615 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9616 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9617 | "$G_SRV -u" \ |
| 9618 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9619 | 0 \ |
| 9620 | -c "client hello, adding use_srtp extension" \ |
| 9621 | -C "found use_srtp extension" \ |
| 9622 | -C "found srtp profile" \ |
| 9623 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9624 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9625 | -C "error" |
| 9626 | |
| 9627 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9628 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9629 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9630 | "$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" \ |
| 9631 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9632 | 0 \ |
| 9633 | -c "client hello, adding use_srtp extension" \ |
| 9634 | -c "found use_srtp extension" \ |
| 9635 | -c "found srtp profile" \ |
| 9636 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9637 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9638 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9639 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9640 | -c "dumping 'received mki' (8 bytes)" \ |
| 9641 | -C "error" |
| 9642 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9643 | # Tests for specific things with "unreliable" UDP connection |
| 9644 | |
| 9645 | not_with_valgrind # spurious resend due to timeout |
| 9646 | run_test "DTLS proxy: reference" \ |
| 9647 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9648 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9649 | "$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] | 9650 | 0 \ |
| 9651 | -C "replayed record" \ |
| 9652 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9653 | -C "Buffer record from epoch" \ |
| 9654 | -S "Buffer record from epoch" \ |
| 9655 | -C "ssl_buffer_message" \ |
| 9656 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9657 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9658 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9659 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9660 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9661 | -c "HTTP/1.0 200 OK" |
| 9662 | |
| 9663 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9664 | run_test "DTLS proxy: duplicate every packet" \ |
| 9665 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9666 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9667 | "$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] | 9668 | 0 \ |
| 9669 | -c "replayed record" \ |
| 9670 | -s "replayed record" \ |
| 9671 | -c "record from another epoch" \ |
| 9672 | -s "record from another epoch" \ |
| 9673 | -S "resend" \ |
| 9674 | -s "Extra-header:" \ |
| 9675 | -c "HTTP/1.0 200 OK" |
| 9676 | |
| 9677 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9678 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9679 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9680 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9681 | 0 \ |
| 9682 | -c "replayed record" \ |
| 9683 | -S "replayed record" \ |
| 9684 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9685 | -s "record from another epoch" \ |
| 9686 | -c "resend" \ |
| 9687 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9688 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9689 | -c "HTTP/1.0 200 OK" |
| 9690 | |
| 9691 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9692 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9693 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9694 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9695 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9696 | -c "next record in same datagram" \ |
| 9697 | -s "next record in same datagram" |
| 9698 | |
| 9699 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9700 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9701 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9702 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9703 | 0 \ |
| 9704 | -c "next record in same datagram" \ |
| 9705 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9706 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9707 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9708 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9709 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9710 | "$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] | 9711 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9712 | -c "discarding invalid record (mac)" \ |
| 9713 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9714 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9715 | -c "HTTP/1.0 200 OK" \ |
| 9716 | -S "too many records with bad MAC" \ |
| 9717 | -S "Verification of the message MAC failed" |
| 9718 | |
| 9719 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9720 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9721 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9722 | "$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] | 9723 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9724 | -C "discarding invalid record (mac)" \ |
| 9725 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9726 | -S "Extra-header:" \ |
| 9727 | -C "HTTP/1.0 200 OK" \ |
| 9728 | -s "too many records with bad MAC" \ |
| 9729 | -s "Verification of the message MAC failed" |
| 9730 | |
| 9731 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9732 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9733 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9734 | "$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] | 9735 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9736 | -c "discarding invalid record (mac)" \ |
| 9737 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9738 | -s "Extra-header:" \ |
| 9739 | -c "HTTP/1.0 200 OK" \ |
| 9740 | -S "too many records with bad MAC" \ |
| 9741 | -S "Verification of the message MAC failed" |
| 9742 | |
| 9743 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9744 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9745 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9746 | "$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] | 9747 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9748 | -c "discarding invalid record (mac)" \ |
| 9749 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9750 | -s "Extra-header:" \ |
| 9751 | -c "HTTP/1.0 200 OK" \ |
| 9752 | -s "too many records with bad MAC" \ |
| 9753 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9754 | |
| 9755 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9756 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9757 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9758 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9759 | 0 \ |
| 9760 | -c "record from another epoch" \ |
| 9761 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9762 | -s "Extra-header:" \ |
| 9763 | -c "HTTP/1.0 200 OK" |
| 9764 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9765 | # Tests for reordering support with DTLS |
| 9766 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9767 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9768 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9769 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9770 | hs_timeout=2500-60000" \ |
| 9771 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9772 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9773 | 0 \ |
| 9774 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9775 | -c "Next handshake message has been buffered - load"\ |
| 9776 | -S "Buffering HS message" \ |
| 9777 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9778 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9779 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9780 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9781 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9782 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9783 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9784 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9785 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9786 | hs_timeout=2500-60000" \ |
| 9787 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9788 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9789 | 0 \ |
| 9790 | -c "Buffering HS message" \ |
| 9791 | -c "found fragmented DTLS handshake message"\ |
| 9792 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9793 | -c "Next handshake message has been buffered - load"\ |
| 9794 | -S "Buffering HS message" \ |
| 9795 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9796 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9797 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9798 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9799 | -S "Remember CCS message" |
| 9800 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9801 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9802 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9803 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9804 | # while keeping the ServerKeyExchange. |
| 9805 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 9806 | 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] | 9807 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9808 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9809 | hs_timeout=2500-60000" \ |
| 9810 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9811 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9812 | 0 \ |
| 9813 | -c "Buffering HS message" \ |
| 9814 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9815 | -C "attempt to make space by freeing buffered messages" \ |
| 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 | a1adcca | 2018-08-24 14:41:07 +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 | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9821 | -S "Remember CCS message" |
| 9822 | |
| 9823 | # The size constraints ensure that the delayed certificate message can't |
| 9824 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 9825 | # when dropping it first. |
| 9826 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 9827 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 9828 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 9829 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9830 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9831 | hs_timeout=2500-60000" \ |
| 9832 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9833 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9834 | 0 \ |
| 9835 | -c "Buffering HS message" \ |
| 9836 | -c "attempt to make space by freeing buffered future messages" \ |
| 9837 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9838 | -S "Buffering HS message" \ |
| 9839 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9840 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9841 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9842 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9843 | -S "Remember CCS message" |
| 9844 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9845 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 9846 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9847 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 9848 | hs_timeout=2500-60000" \ |
| 9849 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9850 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9851 | 0 \ |
| 9852 | -C "Buffering HS message" \ |
| 9853 | -C "Next handshake message has been buffered - load"\ |
| 9854 | -s "Buffering HS message" \ |
| 9855 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9856 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9857 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9858 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9859 | -S "Remember CCS message" |
| 9860 | |
| 9861 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 9862 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9863 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9864 | hs_timeout=2500-60000" \ |
| 9865 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9866 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9867 | 0 \ |
| 9868 | -C "Buffering HS message" \ |
| 9869 | -C "Next handshake message has been buffered - load"\ |
| 9870 | -S "Buffering HS message" \ |
| 9871 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9872 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9873 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9874 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9875 | -S "Remember CCS message" |
| 9876 | |
| 9877 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 9878 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9879 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9880 | hs_timeout=2500-60000" \ |
| 9881 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9882 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9883 | 0 \ |
| 9884 | -C "Buffering HS message" \ |
| 9885 | -C "Next handshake message has been buffered - load"\ |
| 9886 | -S "Buffering HS message" \ |
| 9887 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9888 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9889 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9890 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9891 | -s "Remember CCS message" |
| 9892 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9893 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9894 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9895 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9896 | hs_timeout=2500-60000" \ |
| 9897 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9898 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9899 | 0 \ |
| 9900 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9901 | -s "Found buffered record from current epoch - load" \ |
| 9902 | -c "Buffer record from epoch 1" \ |
| 9903 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9904 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9905 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 9906 | # from the server are delayed, so that the encrypted Finished message |
| 9907 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 9908 | # in afterwards, the encrypted Finished message must be freed in order |
| 9909 | # to make space for the NewSessionTicket to be reassembled. |
| 9910 | # This works only in very particular circumstances: |
| 9911 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 9912 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 9913 | # the encrypted Finished message. |
| 9914 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 9915 | # needs to be fragmented. |
| 9916 | # - All messages sent by the server must be small enough to be either sent |
| 9917 | # without fragmentation or be reassembled within the bounds of |
| 9918 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 9919 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9920 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 9921 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9922 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 9923 | -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] | 9924 | "$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] | 9925 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 9926 | 0 \ |
| 9927 | -s "Buffer record from epoch 1" \ |
| 9928 | -s "Found buffered record from current epoch - load" \ |
| 9929 | -c "Buffer record from epoch 1" \ |
| 9930 | -C "Found buffered record from current epoch - load" \ |
| 9931 | -c "Enough space available after freeing future epoch record" |
| 9932 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9933 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 9934 | |
| 9935 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9936 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 9937 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9938 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9939 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9940 | "$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] | 9941 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 9942 | 0 \ |
| 9943 | -s "Extra-header:" \ |
| 9944 | -c "HTTP/1.0 200 OK" |
| 9945 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9946 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9947 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 9948 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9949 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9950 | "$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] | 9951 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 9952 | 0 \ |
| 9953 | -s "Extra-header:" \ |
| 9954 | -c "HTTP/1.0 200 OK" |
| 9955 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9956 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9957 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 9958 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9959 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 9960 | "$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] | 9961 | 0 \ |
| 9962 | -s "Extra-header:" \ |
| 9963 | -c "HTTP/1.0 200 OK" |
| 9964 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9965 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9966 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 9967 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9968 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 9969 | "$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] | 9970 | 0 \ |
| 9971 | -s "Extra-header:" \ |
| 9972 | -c "HTTP/1.0 200 OK" |
| 9973 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9974 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9975 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 9976 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9977 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 9978 | "$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] | 9979 | 0 \ |
| 9980 | -s "Extra-header:" \ |
| 9981 | -c "HTTP/1.0 200 OK" |
| 9982 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9983 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9984 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 9985 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9986 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 9987 | "$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] | 9988 | 0 \ |
| 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 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9993 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 9994 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9995 | "$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] | 9996 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9997 | "$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] | 9998 | 0 \ |
| 9999 | -s "Extra-header:" \ |
| 10000 | -c "HTTP/1.0 200 OK" |
| 10001 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10002 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10003 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 10004 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10005 | "$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] | 10006 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10007 | "$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] | 10008 | 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] | 10009 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10010 | 0 \ |
| 10011 | -s "a session has been resumed" \ |
| 10012 | -c "a session has been resumed" \ |
| 10013 | -s "Extra-header:" \ |
| 10014 | -c "HTTP/1.0 200 OK" |
| 10015 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10016 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 10017 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 10018 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10019 | "$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] | 10020 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10021 | "$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] | 10022 | 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] | 10023 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 10024 | 0 \ |
| 10025 | -s "a session has been resumed" \ |
| 10026 | -c "a session has been resumed" \ |
| 10027 | -s "Extra-header:" \ |
| 10028 | -c "HTTP/1.0 200 OK" |
| 10029 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10030 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10031 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10032 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10033 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10034 | "$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] | 10035 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10036 | "$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] | 10037 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10038 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10039 | 0 \ |
| 10040 | -c "=> renegotiate" \ |
| 10041 | -s "=> renegotiate" \ |
| 10042 | -s "Extra-header:" \ |
| 10043 | -c "HTTP/1.0 200 OK" |
| 10044 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10045 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10046 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10047 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 10048 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10049 | "$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] | 10050 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10051 | "$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] | 10052 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10053 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10054 | 0 \ |
| 10055 | -c "=> renegotiate" \ |
| 10056 | -s "=> renegotiate" \ |
| 10057 | -s "Extra-header:" \ |
| 10058 | -c "HTTP/1.0 200 OK" |
| 10059 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10060 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10061 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10062 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10063 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10064 | "$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] | 10065 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10066 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10067 | "$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] | 10068 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10069 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10070 | 0 \ |
| 10071 | -c "=> renegotiate" \ |
| 10072 | -s "=> renegotiate" \ |
| 10073 | -s "Extra-header:" \ |
| 10074 | -c "HTTP/1.0 200 OK" |
| 10075 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10076 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10077 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10078 | 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] | 10079 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10080 | "$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] | 10081 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10082 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10083 | "$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] | 10084 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10085 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10086 | 0 \ |
| 10087 | -c "=> renegotiate" \ |
| 10088 | -s "=> renegotiate" \ |
| 10089 | -s "Extra-header:" \ |
| 10090 | -c "HTTP/1.0 200 OK" |
| 10091 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10092 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 10093 | ## all versions installed on the CI machines), reported here: |
| 10094 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 10095 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 10096 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 10097 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10098 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10099 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10100 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10101 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10102 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10103 | "$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] | 10104 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10105 | -c "HTTP/1.0 200 OK" |
| 10106 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10107 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10108 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10109 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10110 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 10111 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10112 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10113 | "$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] | 10114 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10115 | -c "HTTP/1.0 200 OK" |
| 10116 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10117 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10118 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10119 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10120 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 10121 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10122 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10123 | "$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] | 10124 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10125 | -c "HTTP/1.0 200 OK" |
| 10126 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 10127 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10128 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10129 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10130 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 10131 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 10132 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10133 | "$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] | 10134 | 0 \ |
| 10135 | -s "Extra-header:" \ |
| 10136 | -c "Extra-header:" |
| 10137 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10138 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10139 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10140 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10141 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 10142 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10143 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10144 | "$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] | 10145 | 0 \ |
| 10146 | -s "Extra-header:" \ |
| 10147 | -c "Extra-header:" |
| 10148 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10149 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10150 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10151 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10152 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 10153 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10154 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10155 | "$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] | 10156 | 0 \ |
| 10157 | -s "Extra-header:" \ |
| 10158 | -c "Extra-header:" |
| 10159 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10160 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 10161 | run_test "export keys functionality" \ |
| 10162 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 10163 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 10164 | 0 \ |
| 10165 | -s "exported maclen is " \ |
| 10166 | -s "exported keylen is " \ |
| 10167 | -s "exported ivlen is " \ |
| 10168 | -c "exported maclen is " \ |
| 10169 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 10170 | -c "exported ivlen is " \ |
| 10171 | -c "EAP-TLS key material is:"\ |
| 10172 | -s "EAP-TLS key material is:"\ |
| 10173 | -c "EAP-TLS IV is:" \ |
| 10174 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10175 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10176 | # Test heap memory usage after handshake |
| 10177 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 10178 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 10179 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10180 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10181 | run_tests_memory_after_hanshake |
| 10182 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 10183 | # Final report |
| 10184 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10185 | echo "------------------------------------------------------------------------" |
| 10186 | |
| 10187 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10188 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10189 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10190 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10191 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 10192 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 10193 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10194 | |
| 10195 | exit $FAILS |