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 | 4b137d1 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 262 | # Require Mbed TLS to support the given protocol version. |
| 263 | # |
| 264 | # Inputs: |
| 265 | # * $1: protocol version in mbedtls syntax (argument to force_version=) |
| 266 | requires_protocol_version() { |
| 267 | # Support for DTLS is detected separately in detect_dtls(). |
| 268 | case "$1" in |
| 269 | ssl3) requires_config_enabled MBEDTLS_SSL_PROTO_SSL3;; |
| 270 | tls1) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1;; |
| 271 | tls1_1|dtls1) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1;; |
| 272 | tls12|dtls12) requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2;; |
| 273 | *) echo "Unknown required protocol version: $1"; exit 1;; |
| 274 | esac |
| 275 | } |
| 276 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 277 | # Space-separated list of ciphersuites supported by this build of |
| 278 | # Mbed TLS. |
| 279 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
| 280 | grep TLS- | |
| 281 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 282 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 283 | case $P_CIPHERSUITES in |
| 284 | *" $1 "*) :;; |
| 285 | *) SKIP_NEXT="YES";; |
| 286 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 287 | } |
| 288 | |
Gilles Peskine | 511fdf4 | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 289 | # detect_required_features CMD [RUN_TEST_OPTION...] |
| 290 | # If CMD (call to a TLS client or server program) requires certain features, |
| 291 | # arrange to only run the following test case if those features are enabled. |
| 292 | detect_required_features() { |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 293 | case "$1" in |
Gilles Peskine | 4b137d1 | 2022-04-08 19:33:07 +0200 | [diff] [blame] | 294 | *\ force_version=*) |
| 295 | tmp="${1##*\ force_version=}" |
| 296 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 297 | requires_protocol_version "$tmp";; |
| 298 | esac |
| 299 | |
| 300 | case "$1" in |
Gilles Peskine | 511fdf4 | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 301 | *\ force_ciphersuite=*) |
| 302 | tmp="${1##*\ force_ciphersuite=}" |
| 303 | tmp="${tmp%%[!-0-9A-Z_a-z]*}" |
| 304 | case "$*" in |
| 305 | *"-s SSL - The server has no ciphersuites in common"*) |
| 306 | # This test case expects a ciphersuite mismatch, so it |
| 307 | # doesn't actually require the ciphersuite to be enabled. |
| 308 | :;; |
| 309 | *) requires_ciphersuite_enabled "$tmp";; |
| 310 | esac;; |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 311 | esac |
| 312 | |
Gilles Peskine | 3c985f6 | 2022-04-08 19:29:27 +0200 | [diff] [blame] | 313 | case " $1 " in |
| 314 | *[-_\ =]tickets=[^0]*) |
| 315 | requires_config_enabled MBEDTLS_SSL_TICKET_C;; |
| 316 | esac |
| 317 | case " $1 " in |
| 318 | *[-_\ =]alpn=*) |
| 319 | requires_config_enabled MBEDTLS_SSL_ALPN;; |
| 320 | esac |
| 321 | |
Gilles Peskine | bba3b4c | 2022-04-09 00:08:47 +0200 | [diff] [blame] | 322 | case " $1 " in |
Gilles Peskine | 6e257b0 | 2022-04-13 14:19:57 +0200 | [diff] [blame] | 323 | *\ badmac_limit=*) |
| 324 | requires_config_enabled MBEDTLS_SSL_DTLS_BADMAC_LIMIT;; |
| 325 | esac |
| 326 | |
| 327 | case " $1 " in |
Gilles Peskine | bba3b4c | 2022-04-09 00:08:47 +0200 | [diff] [blame] | 328 | *\ fallback=1\ *|*\ -fallback_scsv\ *) |
| 329 | requires_config_enabled MBEDTLS_SSL_FALLBACK_SCSV;; |
| 330 | esac |
| 331 | |
Gilles Peskine | 511fdf4 | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 332 | unset tmp |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 333 | } |
| 334 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 335 | requires_certificate_authentication () { |
| 336 | if [ "$PSK_ONLY" = "YES" ]; then |
| 337 | SKIP_NEXT="YES" |
| 338 | fi |
| 339 | } |
| 340 | |
Gilles Peskine | 89d892f | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 341 | adapt_cmd_for_psk () { |
| 342 | case "$2" in |
| 343 | *openssl*) s='-psk abc123 -nocert';; |
| 344 | *gnutls-*) s='--pskkey=abc123';; |
| 345 | *) s='psk=abc123';; |
| 346 | esac |
| 347 | eval $1='"$2 $s"' |
| 348 | unset s |
| 349 | } |
| 350 | |
| 351 | # maybe_adapt_for_psk [RUN_TEST_OPTION...] |
| 352 | # If running in a PSK-only build, maybe adapt the test to use a pre-shared key. |
| 353 | # |
| 354 | # If not running in a PSK-only build, do nothing. |
| 355 | # If the test looks like it doesn't use a pre-shared key but can run with a |
| 356 | # pre-shared key, pass a pre-shared key. If the test looks like it can't run |
| 357 | # with a pre-shared key, skip it. If the test looks like it's already using |
| 358 | # a pre-shared key, do nothing. |
| 359 | # |
Gilles Peskine | d5b1a30 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 360 | # This code does not consider builds with ECDHE-PSK or RSA-PSK. |
Gilles Peskine | 89d892f | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 361 | # |
| 362 | # Inputs: |
| 363 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: client/server/proxy commands. |
| 364 | # * $PSK_ONLY: YES if running in a PSK-only build (no asymmetric key exchanges). |
| 365 | # * "$@": options passed to run_test. |
| 366 | # |
| 367 | # Outputs: |
| 368 | # * $CLI_CMD, $SRV_CMD: may be modified to add PSK-relevant arguments. |
| 369 | # * $SKIP_NEXT: set to YES if the test can't run with PSK. |
| 370 | maybe_adapt_for_psk() { |
| 371 | if [ "$PSK_ONLY" != "YES" ]; then |
| 372 | return |
| 373 | fi |
| 374 | if [ "$SKIP_NEXT" = "YES" ]; then |
| 375 | return |
| 376 | fi |
| 377 | case "$CLI_CMD $SRV_CMD" in |
| 378 | *[-_\ =]psk*|*[-_\ =]PSK*) |
| 379 | return;; |
| 380 | *force_ciphersuite*) |
| 381 | # The test case forces a non-PSK cipher suite. In some cases, a |
| 382 | # PSK cipher suite could be substituted, but we're not ready for |
| 383 | # that yet. |
| 384 | SKIP_NEXT="YES" |
| 385 | return;; |
| 386 | *\ auth_mode=*|*[-_\ =]crt[_=]*) |
| 387 | # The test case involves certificates. PSK won't do. |
| 388 | SKIP_NEXT="YES" |
| 389 | return;; |
| 390 | esac |
| 391 | adapt_cmd_for_psk CLI_CMD "$CLI_CMD" |
| 392 | adapt_cmd_for_psk SRV_CMD "$SRV_CMD" |
| 393 | } |
| 394 | |
| 395 | case " $CONFIGS_ENABLED " in |
| 396 | *\ MBEDTLS_KEY_EXCHANGE_[^P]*) PSK_ONLY="NO";; |
| 397 | *\ MBEDTLS_KEY_EXCHANGE_P[^S]*) PSK_ONLY="NO";; |
| 398 | *\ MBEDTLS_KEY_EXCHANGE_PS[^K]*) PSK_ONLY="NO";; |
| 399 | *\ MBEDTLS_KEY_EXCHANGE_PSK[^_]*) PSK_ONLY="NO";; |
| 400 | *\ MBEDTLS_KEY_EXCHANGE_PSK_ENABLED\ *) PSK_ONLY="YES";; |
| 401 | *) PSK_ONLY="NO";; |
| 402 | esac |
| 403 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 404 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 405 | requires_openssl_with_fallback_scsv() { |
| 406 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 407 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 408 | then |
| 409 | OPENSSL_HAS_FBSCSV="YES" |
| 410 | else |
| 411 | OPENSSL_HAS_FBSCSV="NO" |
| 412 | fi |
| 413 | fi |
| 414 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 415 | SKIP_NEXT="YES" |
| 416 | fi |
| 417 | } |
| 418 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 419 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 420 | requires_max_content_len() { |
| 421 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 422 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 423 | } |
| 424 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 425 | # skip next test if GnuTLS isn't available |
| 426 | requires_gnutls() { |
| 427 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 428 | 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] | 429 | GNUTLS_AVAILABLE="YES" |
| 430 | else |
| 431 | GNUTLS_AVAILABLE="NO" |
| 432 | fi |
| 433 | fi |
| 434 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 435 | SKIP_NEXT="YES" |
| 436 | fi |
| 437 | } |
| 438 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 439 | # skip next test if GnuTLS-next isn't available |
| 440 | requires_gnutls_next() { |
| 441 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 442 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 443 | GNUTLS_NEXT_AVAILABLE="YES" |
| 444 | else |
| 445 | GNUTLS_NEXT_AVAILABLE="NO" |
| 446 | fi |
| 447 | fi |
| 448 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 449 | SKIP_NEXT="YES" |
| 450 | fi |
| 451 | } |
| 452 | |
| 453 | # skip next test if OpenSSL-legacy isn't available |
| 454 | requires_openssl_legacy() { |
| 455 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 456 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 457 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 458 | else |
| 459 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 460 | fi |
| 461 | fi |
| 462 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 463 | SKIP_NEXT="YES" |
| 464 | fi |
| 465 | } |
| 466 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 467 | requires_openssl_next() { |
| 468 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 469 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 470 | OPENSSL_NEXT_AVAILABLE="YES" |
| 471 | else |
| 472 | OPENSSL_NEXT_AVAILABLE="NO" |
| 473 | fi |
| 474 | fi |
| 475 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 476 | SKIP_NEXT="YES" |
| 477 | fi |
| 478 | } |
| 479 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 480 | # skip next test if IPv6 isn't available on this host |
| 481 | requires_ipv6() { |
| 482 | if [ -z "${HAS_IPV6:-}" ]; then |
| 483 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 484 | SRV_PID=$! |
| 485 | sleep 1 |
| 486 | kill $SRV_PID >/dev/null 2>&1 |
| 487 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 488 | HAS_IPV6="NO" |
| 489 | else |
| 490 | HAS_IPV6="YES" |
| 491 | fi |
| 492 | rm -r $SRV_OUT |
| 493 | fi |
| 494 | |
| 495 | if [ "$HAS_IPV6" = "NO" ]; then |
| 496 | SKIP_NEXT="YES" |
| 497 | fi |
| 498 | } |
| 499 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 500 | # skip next test if it's i686 or uname is not available |
| 501 | requires_not_i686() { |
| 502 | if [ -z "${IS_I686:-}" ]; then |
| 503 | IS_I686="YES" |
| 504 | if which "uname" >/dev/null 2>&1; then |
| 505 | if [ -z "$(uname -a | grep i686)" ]; then |
| 506 | IS_I686="NO" |
| 507 | fi |
| 508 | fi |
| 509 | fi |
| 510 | if [ "$IS_I686" = "YES" ]; then |
| 511 | SKIP_NEXT="YES" |
| 512 | fi |
| 513 | } |
| 514 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 515 | # Calculate the input & output maximum content lengths set in the config |
Yuto Takano | ab9e4333 | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 516 | MAX_CONTENT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_MAX_CONTENT_LEN" ) |
| 517 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 518 | 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] | 519 | |
Yuto Takano | 18ddccc | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 520 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 521 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 522 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 523 | fi |
| 524 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 525 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 526 | fi |
| 527 | |
| 528 | # skip the next test if the SSL output buffer is less than 16KB |
| 529 | requires_full_size_output_buffer() { |
| 530 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 531 | SKIP_NEXT="YES" |
| 532 | fi |
| 533 | } |
| 534 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 535 | # skip the next test if valgrind is in use |
| 536 | not_with_valgrind() { |
| 537 | if [ "$MEMCHECK" -gt 0 ]; then |
| 538 | SKIP_NEXT="YES" |
| 539 | fi |
| 540 | } |
| 541 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 542 | # skip the next test if valgrind is NOT in use |
| 543 | only_with_valgrind() { |
| 544 | if [ "$MEMCHECK" -eq 0 ]; then |
| 545 | SKIP_NEXT="YES" |
| 546 | fi |
| 547 | } |
| 548 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 549 | # 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] | 550 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 551 | CLI_DELAY_FACTOR=$1 |
| 552 | } |
| 553 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 554 | # wait for the given seconds after the client finished in the next test |
| 555 | server_needs_more_time() { |
| 556 | SRV_DELAY_SECONDS=$1 |
| 557 | } |
| 558 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 559 | # print_name <name> |
| 560 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 561 | TESTS=$(( $TESTS + 1 )) |
| 562 | LINE="" |
| 563 | |
| 564 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 565 | LINE="$TESTS " |
| 566 | fi |
| 567 | |
| 568 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 569 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 570 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 571 | for i in `seq 1 $LEN`; do printf '.'; done |
| 572 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 573 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 574 | } |
| 575 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 576 | # record_outcome <outcome> [<failure-reason>] |
| 577 | # The test name must be in $NAME. |
| 578 | record_outcome() { |
| 579 | echo "$1" |
| 580 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 581 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 582 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 583 | "ssl-opt" "$NAME" \ |
| 584 | "$1" "${2-}" \ |
| 585 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 586 | fi |
| 587 | } |
| 588 | |
Gilles Peskine | aa1d6ad | 2021-10-20 14:17:02 +0200 | [diff] [blame] | 589 | # True if the presence of the given pattern in a log definitely indicates |
| 590 | # that the test has failed. False if the presence is inconclusive. |
| 591 | # |
| 592 | # Inputs: |
| 593 | # * $1: pattern found in the logs |
| 594 | # * $TIMES_LEFT: >0 if retrying is an option |
| 595 | # |
| 596 | # Outputs: |
| 597 | # * $outcome: set to a retry reason if the pattern is inconclusive, |
| 598 | # unchanged otherwise. |
| 599 | # * Return value: 1 if the pattern is inconclusive, |
| 600 | # 0 if the failure is definitive. |
| 601 | log_pattern_presence_is_conclusive() { |
| 602 | # If we've run out of attempts, then don't retry no matter what. |
| 603 | if [ $TIMES_LEFT -eq 0 ]; then |
| 604 | return 0 |
| 605 | fi |
| 606 | case $1 in |
| 607 | "resend") |
| 608 | # An undesired resend may have been caused by the OS dropping or |
| 609 | # delaying a packet at an inopportune time. |
| 610 | outcome="RETRY(resend)" |
| 611 | return 1;; |
| 612 | esac |
| 613 | } |
| 614 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 615 | # fail <message> |
| 616 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 617 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 618 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 619 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 620 | mv $SRV_OUT o-srv-${TESTS}.log |
| 621 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 622 | if [ -n "$PXY_CMD" ]; then |
| 623 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 624 | fi |
| 625 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 626 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 627 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 628 | echo " ! server output:" |
| 629 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 630 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 631 | echo " ! client output:" |
| 632 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 633 | if [ -n "$PXY_CMD" ]; then |
| 634 | echo " ! ========================================================" |
| 635 | echo " ! proxy output:" |
| 636 | cat o-pxy-${TESTS}.log |
| 637 | fi |
| 638 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 639 | fi |
| 640 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 641 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 642 | } |
| 643 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 644 | # is_polar <cmd_line> |
| 645 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 646 | case "$1" in |
| 647 | *ssl_client2*) true;; |
| 648 | *ssl_server2*) true;; |
| 649 | *) false;; |
| 650 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 651 | } |
| 652 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 653 | # openssl s_server doesn't have -www with DTLS |
| 654 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 655 | case "$SRV_CMD" in |
| 656 | *s_server*-dtls*) |
| 657 | NEEDS_INPUT=1 |
| 658 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 659 | *) NEEDS_INPUT=0;; |
| 660 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 661 | } |
| 662 | |
| 663 | # provide input to commands that need it |
| 664 | provide_input() { |
| 665 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 666 | return |
| 667 | fi |
| 668 | |
| 669 | while true; do |
| 670 | echo "HTTP/1.0 200 OK" |
| 671 | sleep 1 |
| 672 | done |
| 673 | } |
| 674 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 675 | # has_mem_err <log_file_name> |
| 676 | has_mem_err() { |
| 677 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 678 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 679 | then |
| 680 | return 1 # false: does not have errors |
| 681 | else |
| 682 | return 0 # true: has errors |
| 683 | fi |
| 684 | } |
| 685 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 686 | # 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] | 687 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 688 | wait_app_start() { |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 689 | newline=' |
| 690 | ' |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 691 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 692 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 693 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 694 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 695 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 696 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 697 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 6cd97ce | 2021-10-19 17:56:39 +0100 | [diff] [blame] | 698 | while true; do |
Gilles Peskine | 36019d5 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 699 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t) |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 700 | # When we use a proxy, it will be listening on the same port we |
| 701 | # are checking for as well as the server and lsof will list both. |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 702 | case ${newline}${SERVER_PIDS}${newline} in |
Gilles Peskine | 36019d5 | 2022-04-15 22:53:18 +0200 | [diff] [blame] | 703 | *${newline}${2}${newline}*) break;; |
Paul Elliott | ce77738 | 2021-10-20 15:59:33 +0100 | [diff] [blame] | 704 | esac |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 705 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 706 | echo "$3 START TIMEOUT" |
| 707 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 708 | break |
| 709 | fi |
| 710 | # Linux and *BSD support decimal arguments to sleep. On other |
| 711 | # OSes this may be a tight loop. |
| 712 | sleep 0.1 2>/dev/null || true |
| 713 | done |
| 714 | } |
| 715 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 716 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 717 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 718 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 719 | } |
| 720 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 721 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 722 | # Wait for server process $2 to be listening on port $1. |
| 723 | wait_server_start() { |
| 724 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 725 | } |
| 726 | |
| 727 | # Wait for proxy process $2 to be listening on port $1. |
| 728 | wait_proxy_start() { |
| 729 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 730 | } |
| 731 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 732 | # 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] | 733 | # 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] | 734 | # acceptable bounds |
| 735 | check_server_hello_time() { |
| 736 | # 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] | 737 | 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] | 738 | # Get the Unix timestamp for now |
| 739 | CUR_TIME=$(date +'%s') |
| 740 | THRESHOLD_IN_SECS=300 |
| 741 | |
| 742 | # Check if the ServerHello time was printed |
| 743 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 744 | return 1 |
| 745 | fi |
| 746 | |
| 747 | # Check the time in ServerHello is within acceptable bounds |
| 748 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 749 | # The time in ServerHello is at least 5 minutes before now |
| 750 | return 1 |
| 751 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 752 | # 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] | 753 | return 1 |
| 754 | else |
| 755 | return 0 |
| 756 | fi |
| 757 | } |
| 758 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 759 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 760 | handshake_memory_get() { |
| 761 | OUTPUT_VARIABLE="$1" |
| 762 | OUTPUT_FILE="$2" |
| 763 | |
| 764 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 765 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 766 | |
| 767 | # Check if memory usage was read |
| 768 | if [ -z "$MEM_USAGE" ]; then |
| 769 | echo "Error: Can not read the value of handshake memory usage" |
| 770 | return 1 |
| 771 | else |
| 772 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 773 | return 0 |
| 774 | fi |
| 775 | } |
| 776 | |
| 777 | # Get handshake memory usage from server or client output and check if this value |
| 778 | # is not higher than the maximum given by the first argument |
| 779 | handshake_memory_check() { |
| 780 | MAX_MEMORY="$1" |
| 781 | OUTPUT_FILE="$2" |
| 782 | |
| 783 | # Get memory usage |
| 784 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 785 | return 1 |
| 786 | fi |
| 787 | |
| 788 | # Check if memory usage is below max value |
| 789 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 790 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 791 | "but should be below $MAX_MEMORY bytes" |
| 792 | return 1 |
| 793 | else |
| 794 | return 0 |
| 795 | fi |
| 796 | } |
| 797 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 798 | # wait for client to terminate and set CLI_EXIT |
| 799 | # must be called right after starting the client |
| 800 | wait_client_done() { |
| 801 | CLI_PID=$! |
| 802 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 803 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 804 | CLI_DELAY_FACTOR=1 |
| 805 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 806 | ( 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] | 807 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 808 | |
| 809 | wait $CLI_PID |
| 810 | CLI_EXIT=$? |
| 811 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 812 | kill $DOG_PID >/dev/null 2>&1 |
| 813 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 814 | |
| 815 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 816 | |
| 817 | sleep $SRV_DELAY_SECONDS |
| 818 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 819 | } |
| 820 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 821 | # check if the given command uses dtls and sets global variable DTLS |
| 822 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 823 | case "$1" in |
Paul Elliott | 405fccc | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 824 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 825 | *) DTLS=0;; |
| 826 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 827 | } |
| 828 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 829 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 830 | is_gnutls() { |
| 831 | case "$1" in |
| 832 | *gnutls-cli*) |
| 833 | CMD_IS_GNUTLS=1 |
| 834 | ;; |
| 835 | *gnutls-serv*) |
| 836 | CMD_IS_GNUTLS=1 |
| 837 | ;; |
| 838 | *) |
| 839 | CMD_IS_GNUTLS=0 |
| 840 | ;; |
| 841 | esac |
| 842 | } |
| 843 | |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 844 | # Determine what calc_verify trace is to be expected, if any. |
| 845 | # |
| 846 | # calc_verify is only called for two things: to calculate the |
| 847 | # extended master secret, and to process client authentication. |
| 848 | # |
| 849 | # Warning: the current implementation assumes that extended_ms is not |
| 850 | # disabled on the client or on the server. |
| 851 | # |
| 852 | # Inputs: |
Gilles Peskine | f2e1f47 | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 853 | # * $1: the value of the server auth_mode parameter. |
| 854 | # 'required' if client authentication is expected, |
| 855 | # 'none' or absent if not. |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 856 | # * $CONFIGS_ENABLED |
| 857 | # |
| 858 | # Outputs: |
| 859 | # * $maybe_calc_verify: set to a trace expected in the debug logs |
| 860 | set_maybe_calc_verify() { |
| 861 | maybe_calc_verify= |
| 862 | case $CONFIGS_ENABLED in |
| 863 | *\ MBEDTLS_SSL_EXTENDED_MASTER_SECRET\ *) :;; |
| 864 | *) |
| 865 | case ${1-} in |
Gilles Peskine | f2e1f47 | 2022-04-06 22:23:45 +0200 | [diff] [blame] | 866 | ''|none) return;; |
| 867 | required) :;; |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 868 | *) echo "Bad parameter 1 to set_maybe_calc_verify: $1"; exit 1;; |
| 869 | esac |
| 870 | esac |
| 871 | case $CONFIGS_ENABLED in |
| 872 | *\ MBEDTLS_USE_PSA_CRYPTO\ *) maybe_calc_verify="PSA calc verify";; |
| 873 | *) maybe_calc_verify="<= calc verify";; |
| 874 | esac |
| 875 | } |
| 876 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 877 | # Compare file content |
| 878 | # Usage: find_in_both pattern file1 file2 |
| 879 | # extract from file1 the first line matching the pattern |
| 880 | # check in file2 that the same line can be found |
| 881 | find_in_both() { |
| 882 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 883 | if [ -z "$srv_pattern" ]; then |
| 884 | return 1; |
| 885 | fi |
| 886 | |
| 887 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 888 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 889 | else |
| 890 | return 1; |
| 891 | fi |
| 892 | } |
| 893 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 894 | # Analyze the commands that will be used in a test. |
| 895 | # |
| 896 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 897 | # extra arguments or go through wrappers. |
Gilles Peskine | d5b1a30 | 2022-04-05 22:00:17 +0200 | [diff] [blame] | 898 | # |
| 899 | # Inputs: |
| 900 | # * $@: supplemental options to run_test() (after the mandatory arguments). |
| 901 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: the client, proxy and server commands. |
| 902 | # * $DTLS: 1 if DTLS, otherwise 0. |
| 903 | # |
| 904 | # Outputs: |
| 905 | # * $CLI_CMD, $PXY_CMD, $SRV_CMD: may be tweaked. |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 906 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 907 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 908 | # 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] | 909 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 910 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 911 | case " $SRV_CMD " in |
| 912 | *' server_addr=::1 '*) |
| 913 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 914 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 915 | fi |
| 916 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 917 | # update CMD_IS_GNUTLS variable |
| 918 | is_gnutls "$SRV_CMD" |
| 919 | |
| 920 | # if the server uses gnutls but doesn't set priority, explicitly |
| 921 | # set the default priority |
| 922 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 923 | case "$SRV_CMD" in |
| 924 | *--priority*) :;; |
| 925 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 926 | esac |
| 927 | fi |
| 928 | |
| 929 | # update CMD_IS_GNUTLS variable |
| 930 | is_gnutls "$CLI_CMD" |
| 931 | |
| 932 | # if the client uses gnutls but doesn't set priority, explicitly |
| 933 | # set the default priority |
| 934 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 935 | case "$CLI_CMD" in |
| 936 | *--priority*) :;; |
| 937 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 938 | esac |
| 939 | fi |
| 940 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 941 | # fix client port |
| 942 | if [ -n "$PXY_CMD" ]; then |
| 943 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 944 | else |
| 945 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 946 | fi |
| 947 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 948 | # prepend valgrind to our commands if active |
| 949 | if [ "$MEMCHECK" -gt 0 ]; then |
| 950 | if is_polar "$SRV_CMD"; then |
| 951 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 952 | fi |
| 953 | if is_polar "$CLI_CMD"; then |
| 954 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 955 | fi |
| 956 | fi |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 957 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 958 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 959 | # Check for failure conditions after a test case. |
| 960 | # |
| 961 | # Inputs from run_test: |
| 962 | # * positional parameters: test options (see run_test documentation) |
| 963 | # * $CLI_EXIT: client return code |
| 964 | # * $CLI_EXPECT: expected client return code |
| 965 | # * $SRV_RET: server return code |
| 966 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 967 | # * $TIMES_LEFT: if nonzero, a RETRY outcome is allowed |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 968 | # |
| 969 | # Outputs: |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 970 | # * $outcome: one of PASS/RETRY*/FAIL |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 971 | check_test_failure() { |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 972 | outcome=FAIL |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 973 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 974 | if [ $TIMES_LEFT -gt 0 ] && |
| 975 | grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null |
| 976 | then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 977 | outcome="RETRY(client-timeout)" |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 978 | return |
| 979 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 980 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 981 | # 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] | 982 | # (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] | 983 | # expected client exit to incorrectly succeed in case of catastrophic |
| 984 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 985 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 986 | 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] | 987 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 988 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 989 | return |
| 990 | fi |
| 991 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 992 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 993 | 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] | 994 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 995 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 996 | return |
| 997 | fi |
| 998 | fi |
| 999 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 1000 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 1001 | # exit with status 0 when interrupted by a signal, and we don't really |
| 1002 | # care anyway), in case e.g. the server reports a memory leak. |
| 1003 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 1004 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 1005 | return |
| 1006 | fi |
| 1007 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1008 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1009 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 1010 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1011 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1012 | 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] | 1013 | return |
| 1014 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1015 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1016 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1017 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1018 | # 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] | 1019 | while [ $# -gt 0 ] |
| 1020 | do |
| 1021 | case $1 in |
| 1022 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1023 | 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] | 1024 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1025 | return |
| 1026 | fi |
| 1027 | ;; |
| 1028 | |
| 1029 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1030 | 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] | 1031 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1032 | return |
| 1033 | fi |
| 1034 | ;; |
| 1035 | |
| 1036 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1037 | 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] | 1038 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1039 | fail "pattern '$2' MUST NOT be present in the Server output" |
| 1040 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1041 | return |
| 1042 | fi |
| 1043 | ;; |
| 1044 | |
| 1045 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1046 | 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] | 1047 | if log_pattern_presence_is_conclusive "$2"; then |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1048 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1049 | fi |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1050 | return |
| 1051 | fi |
| 1052 | ;; |
| 1053 | |
| 1054 | # The filtering in the following two options (-u and -U) do the following |
| 1055 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1056 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1057 | # - keep one of each non-unique line |
| 1058 | # - count how many lines remain |
| 1059 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1060 | # if there were no duplicates. |
| 1061 | "-U") |
| 1062 | 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 |
| 1063 | fail "lines following pattern '$2' must be unique in Server output" |
| 1064 | return |
| 1065 | fi |
| 1066 | ;; |
| 1067 | |
| 1068 | "-u") |
| 1069 | 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 |
| 1070 | 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] | 1071 | return |
| 1072 | fi |
| 1073 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1074 | "-F") |
| 1075 | if ! $2 "$SRV_OUT"; then |
| 1076 | fail "function call to '$2' failed on Server output" |
| 1077 | return |
| 1078 | fi |
| 1079 | ;; |
| 1080 | "-f") |
| 1081 | if ! $2 "$CLI_OUT"; then |
| 1082 | fail "function call to '$2' failed on Client output" |
| 1083 | return |
| 1084 | fi |
| 1085 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1086 | "-g") |
| 1087 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1088 | fail "function call to '$2' failed on Server and Client output" |
| 1089 | return |
| 1090 | fi |
| 1091 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1092 | |
| 1093 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1094 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1095 | exit 1 |
| 1096 | esac |
| 1097 | shift 2 |
| 1098 | done |
| 1099 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1100 | # check valgrind's results |
| 1101 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1102 | 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] | 1103 | fail "Server has memory errors" |
| 1104 | return |
| 1105 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1106 | 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] | 1107 | fail "Client has memory errors" |
| 1108 | return |
| 1109 | fi |
| 1110 | fi |
| 1111 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1112 | # if we're here, everything is ok |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1113 | outcome=PASS |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1114 | } |
| 1115 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1116 | # Run the current test case: start the server and if applicable the proxy, run |
| 1117 | # the client, wait for all processes to finish or time out. |
| 1118 | # |
| 1119 | # Inputs: |
| 1120 | # * $NAME: test case name |
| 1121 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1122 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1123 | # |
| 1124 | # Outputs: |
| 1125 | # * $CLI_EXIT: client return code |
| 1126 | # * $SRV_RET: server return code |
| 1127 | do_run_test_once() { |
| 1128 | # run the commands |
| 1129 | if [ -n "$PXY_CMD" ]; then |
| 1130 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1131 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1132 | PXY_PID=$! |
| 1133 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1134 | fi |
| 1135 | |
| 1136 | check_osrv_dtls |
| 1137 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1138 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1139 | SRV_PID=$! |
| 1140 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1141 | |
| 1142 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Andrzej Kurek | d27cdcc | 2022-05-27 06:44:19 -0400 | [diff] [blame] | 1143 | # The client must be a subprocess of the script in order for killing it to |
| 1144 | # work properly, that's why the ampersand is placed inside the eval command, |
| 1145 | # not at the end of the line: the latter approach will spawn eval as a |
| 1146 | # subprocess, and the $CLI_CMD as a grandchild. |
| 1147 | eval "$CLI_CMD &" >> $CLI_OUT 2>&1 |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1148 | wait_client_done |
| 1149 | |
| 1150 | sleep 0.05 |
| 1151 | |
| 1152 | # terminate the server (and the proxy) |
| 1153 | kill $SRV_PID |
| 1154 | wait $SRV_PID |
| 1155 | SRV_RET=$? |
| 1156 | |
| 1157 | if [ -n "$PXY_CMD" ]; then |
| 1158 | kill $PXY_PID >/dev/null 2>&1 |
| 1159 | wait $PXY_PID |
| 1160 | fi |
| 1161 | } |
| 1162 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1163 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1164 | # Options: -s pattern pattern that must be present in server output |
| 1165 | # -c pattern pattern that must be present in client output |
| 1166 | # -u pattern lines after pattern must be unique in client output |
| 1167 | # -f call shell function on client output |
| 1168 | # -S pattern pattern that must be absent in server output |
| 1169 | # -C pattern pattern that must be absent in client output |
| 1170 | # -U pattern lines after pattern must be unique in server output |
| 1171 | # -F call shell function on server output |
| 1172 | # -g call shell function on server and client output |
| 1173 | run_test() { |
| 1174 | NAME="$1" |
| 1175 | shift 1 |
| 1176 | |
| 1177 | if is_excluded "$NAME"; then |
| 1178 | SKIP_NEXT="NO" |
| 1179 | # There was no request to run the test, so don't record its outcome. |
| 1180 | return |
| 1181 | fi |
| 1182 | |
| 1183 | print_name "$NAME" |
| 1184 | |
| 1185 | # Do we only run numbered tests? |
| 1186 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1187 | case ",$RUN_TEST_NUMBER," in |
| 1188 | *",$TESTS,"*) :;; |
| 1189 | *) SKIP_NEXT="YES";; |
| 1190 | esac |
| 1191 | fi |
| 1192 | |
| 1193 | # does this test use a proxy? |
| 1194 | if [ "X$1" = "X-p" ]; then |
| 1195 | PXY_CMD="$2" |
| 1196 | shift 2 |
| 1197 | else |
| 1198 | PXY_CMD="" |
| 1199 | fi |
| 1200 | |
| 1201 | # get commands and client output |
| 1202 | SRV_CMD="$1" |
| 1203 | CLI_CMD="$2" |
| 1204 | CLI_EXPECT="$3" |
| 1205 | shift 3 |
| 1206 | |
| 1207 | # Check if test uses files |
| 1208 | case "$SRV_CMD $CLI_CMD" in |
| 1209 | *data_files/*) |
| 1210 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1211 | esac |
| 1212 | |
Gilles Peskine | e5f4958 | 2022-02-25 19:46:30 +0100 | [diff] [blame] | 1213 | # Check if the test uses DTLS. |
| 1214 | detect_dtls "$SRV_CMD" |
| 1215 | if [ "$DTLS" -eq 1 ]; then |
| 1216 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 1217 | fi |
| 1218 | |
Gilles Peskine | 511fdf4 | 2022-04-08 19:26:26 +0200 | [diff] [blame] | 1219 | # If the client or server requires certain features that can be detected |
| 1220 | # from their command-line arguments, check that they're enabled. |
| 1221 | detect_required_features "$SRV_CMD" "$@" |
| 1222 | detect_required_features "$CLI_CMD" "$@" |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1223 | |
Gilles Peskine | 89d892f | 2022-02-25 19:52:52 +0100 | [diff] [blame] | 1224 | # If we're in a PSK-only build and the test can be adapted to PSK, do that. |
| 1225 | maybe_adapt_for_psk "$@" |
| 1226 | |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1227 | # should we skip? |
| 1228 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1229 | SKIP_NEXT="NO" |
| 1230 | record_outcome "SKIP" |
| 1231 | SKIPS=$(( $SKIPS + 1 )) |
| 1232 | return |
| 1233 | fi |
| 1234 | |
| 1235 | analyze_test_commands "$@" |
| 1236 | |
Andrzej Kurek | 363553b | 2022-04-01 08:52:06 -0400 | [diff] [blame] | 1237 | # One regular run and two retries |
| 1238 | TIMES_LEFT=3 |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1239 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1240 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1241 | |
Gilles Peskine | 5d8e702 | 2021-10-19 16:35:35 +0200 | [diff] [blame] | 1242 | do_run_test_once |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1243 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1244 | check_test_failure "$@" |
| 1245 | case $outcome in |
| 1246 | PASS) break;; |
Gilles Peskine | 2d3c9f8 | 2021-10-19 18:00:10 +0200 | [diff] [blame] | 1247 | RETRY*) printf "$outcome ";; |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1248 | FAIL) return;; |
| 1249 | esac |
Gilles Peskine | f9022b0 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1250 | done |
| 1251 | |
Gilles Peskine | a28fd41 | 2021-10-19 17:23:25 +0200 | [diff] [blame] | 1252 | # If we get this far, the test case passed. |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1253 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1254 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1255 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1256 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1257 | if [ -n "$PXY_CMD" ]; then |
| 1258 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1259 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1260 | fi |
| 1261 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1262 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1263 | } |
| 1264 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1265 | run_test_psa() { |
| 1266 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1267 | set_maybe_calc_verify none |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1268 | run_test "PSA-supported ciphersuite: $1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1269 | "$P_SRV debug_level=3 force_version=tls12" \ |
| 1270 | "$P_CLI debug_level=3 force_version=tls12 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1271 | 0 \ |
| 1272 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1273 | -c "Successfully setup PSA-based encryption cipher context" \ |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1274 | -c "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1275 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1276 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1277 | -s "Successfully setup PSA-based encryption cipher context" \ |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1278 | -s "$maybe_calc_verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1279 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1280 | -C "Failed to setup PSA-based cipher context"\ |
| 1281 | -S "Failed to setup PSA-based cipher context"\ |
| 1282 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1283 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1284 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1285 | -S "error" \ |
| 1286 | -C "error" |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1287 | unset maybe_calc_verify |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1288 | } |
| 1289 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1290 | run_test_psa_force_curve() { |
| 1291 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1292 | set_maybe_calc_verify none |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1293 | run_test "PSA - ECDH with $1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1294 | "$P_SRV debug_level=4 force_version=tls12" \ |
| 1295 | "$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] | 1296 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1297 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1298 | -c "Successfully setup PSA-based encryption cipher context" \ |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1299 | -c "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1300 | -c "calc PSA finished" \ |
| 1301 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1302 | -s "Successfully setup PSA-based encryption cipher context" \ |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1303 | -s "$maybe_calc_verify" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1304 | -s "calc PSA finished" \ |
| 1305 | -C "Failed to setup PSA-based cipher context"\ |
| 1306 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1307 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1308 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1309 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1310 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1311 | -C "error" |
Gilles Peskine | 64c683f | 2022-03-14 17:55:04 +0100 | [diff] [blame] | 1312 | unset maybe_calc_verify |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1313 | } |
| 1314 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1315 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1316 | # a maximum fragment length. |
| 1317 | # first argument ($1) is MFL for SSL client |
| 1318 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1319 | run_test_memory_after_hanshake_with_mfl() |
| 1320 | { |
| 1321 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1322 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1323 | |
| 1324 | # Leave some margin for robustness |
| 1325 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1326 | |
| 1327 | run_test "Handshake memory usage (MFL $1)" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1328 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1329 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1330 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1331 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1332 | 0 \ |
| 1333 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1334 | } |
| 1335 | |
| 1336 | |
| 1337 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1338 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1339 | run_tests_memory_after_hanshake() |
| 1340 | { |
| 1341 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1342 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1343 | |
| 1344 | # first test with default MFU is to get reference memory usage |
| 1345 | MEMORY_USAGE_MFL_16K=0 |
| 1346 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 1347 | "$P_SRV debug_level=3 auth_mode=required force_version=tls12" \ |
| 1348 | "$P_CLI debug_level=3 force_version=tls12 \ |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1349 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1350 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1351 | 0 \ |
| 1352 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1353 | |
| 1354 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1355 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1356 | |
| 1357 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1358 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1359 | |
| 1360 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1361 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1362 | |
| 1363 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1364 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1365 | } |
| 1366 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1367 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1368 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1369 | rm -f context_srv.txt |
| 1370 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1371 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1372 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1373 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1374 | 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] | 1375 | exit 1 |
| 1376 | } |
| 1377 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1378 | # |
| 1379 | # MAIN |
| 1380 | # |
| 1381 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1382 | get_options "$@" |
| 1383 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1384 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1385 | # patterns rather than regular expressions, use a case statement instead |
| 1386 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1387 | # detects simple cases: plain substring, everything, nothing. |
| 1388 | # |
| 1389 | # As an exception, the character '.' is treated as an ordinary character |
| 1390 | # if it is the only special character in the string. This is because it's |
| 1391 | # rare to need "any one character", but needing a literal '.' is common |
| 1392 | # (e.g. '-f "DTLS 1.2"'). |
| 1393 | need_grep= |
| 1394 | case "$FILTER" in |
| 1395 | '^$') simple_filter=;; |
| 1396 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1397 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1398 | need_grep=1;; |
| 1399 | *) # No regexp or shell-pattern special character |
| 1400 | simple_filter="*$FILTER*";; |
| 1401 | esac |
| 1402 | case "$EXCLUDE" in |
| 1403 | '^$') simple_exclude=;; |
| 1404 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1405 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1406 | need_grep=1;; |
| 1407 | *) # No regexp or shell-pattern special character |
| 1408 | simple_exclude="*$EXCLUDE*";; |
| 1409 | esac |
| 1410 | if [ -n "$need_grep" ]; then |
| 1411 | is_excluded () { |
| 1412 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1413 | } |
| 1414 | else |
| 1415 | is_excluded () { |
| 1416 | case "$1" in |
| 1417 | $simple_exclude) true;; |
| 1418 | $simple_filter) false;; |
| 1419 | *) true;; |
| 1420 | esac |
| 1421 | } |
| 1422 | fi |
| 1423 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1424 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1425 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1426 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1427 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1428 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1429 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1430 | exit 1 |
| 1431 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1432 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1433 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1434 | exit 1 |
| 1435 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1436 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1437 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1438 | exit 1 |
| 1439 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1440 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1441 | if which valgrind >/dev/null 2>&1; then :; else |
| 1442 | echo "Memcheck not possible. Valgrind not found" |
| 1443 | exit 1 |
| 1444 | fi |
| 1445 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1446 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1447 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1448 | exit 1 |
| 1449 | fi |
| 1450 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1451 | # used by watchdog |
| 1452 | MAIN_PID="$$" |
| 1453 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1454 | # We use somewhat arbitrary delays for tests: |
| 1455 | # - how long do we wait for the server to start (when lsof not available)? |
| 1456 | # - how long do we allow for the client to finish? |
| 1457 | # (not to check performance, just to avoid waiting indefinitely) |
| 1458 | # Things are slower with valgrind, so give extra time here. |
| 1459 | # |
| 1460 | # Note: without lsof, there is a trade-off between the running time of this |
| 1461 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1462 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1463 | # 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] | 1464 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1465 | START_DELAY=6 |
| 1466 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1467 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1468 | START_DELAY=2 |
| 1469 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1470 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1471 | |
| 1472 | # some particular tests need more time: |
| 1473 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1474 | # - for the server, we sleep for a number of seconds after the client exits |
| 1475 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1476 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1477 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1478 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1479 | # 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] | 1480 | # +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] | 1481 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1482 | # 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] | 1483 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1484 | 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] | 1485 | 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] | 1486 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1487 | 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] | 1488 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1489 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1490 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1491 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1492 | 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] | 1493 | 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] | 1494 | fi |
| 1495 | |
Paul Elliott | 633a74e | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 1496 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1497 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Paul Elliott | ccba129 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1498 | 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] | 1499 | fi |
| 1500 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1501 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1502 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1503 | fi |
| 1504 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1505 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1506 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1507 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1508 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1509 | # Allow SHA-1, because many of our test certificates use it |
| 1510 | P_SRV="$P_SRV allow_sha1=1" |
| 1511 | P_CLI="$P_CLI allow_sha1=1" |
| 1512 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1513 | # Also pick a unique name for intermediate files |
| 1514 | SRV_OUT="srv_out.$$" |
| 1515 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1516 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1517 | SESSION="session.$$" |
| 1518 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1519 | SKIP_NEXT="NO" |
| 1520 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1521 | trap cleanup INT TERM HUP |
| 1522 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1523 | # Basic test |
| 1524 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1525 | # Checks that: |
| 1526 | # - things work with all ciphersuites active (used with config-full in all.sh) |
Gilles Peskine | de4cb35 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1527 | # - the expected parameters are selected |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | dff48c1 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1529 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Gilles Peskine | de4cb35 | 2022-04-05 22:00:32 +0200 | [diff] [blame] | 1530 | requires_config_enabled MBEDTLS_SHA512_C # "signature_algorithm ext: 6" |
| 1531 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1532 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1533 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1534 | "$P_CLI" \ |
| 1535 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1536 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1537 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1538 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1539 | -s "ECDHE curve: secp521r1" \ |
| 1540 | -S "error" \ |
| 1541 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1542 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 1543 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Gilles Peskine | dff48c1 | 2022-02-25 19:50:38 +0100 | [diff] [blame] | 1544 | requires_ciphersuite_enabled TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256 |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1545 | run_test "Default, DTLS" \ |
| 1546 | "$P_SRV dtls=1" \ |
| 1547 | "$P_CLI dtls=1" \ |
| 1548 | 0 \ |
| 1549 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1550 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1551 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1552 | run_test "TLS client auth: required" \ |
| 1553 | "$P_SRV auth_mode=required" \ |
| 1554 | "$P_CLI" \ |
| 1555 | 0 \ |
| 1556 | -s "Verifying peer X.509 certificate... ok" |
| 1557 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1558 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1559 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1560 | requires_config_enabled MBEDTLS_SHA256_C |
| 1561 | run_test "TLS: password protected client key" \ |
| 1562 | "$P_SRV auth_mode=required" \ |
| 1563 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1564 | 0 |
| 1565 | |
| 1566 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1567 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1568 | requires_config_enabled MBEDTLS_SHA256_C |
| 1569 | run_test "TLS: password protected server key" \ |
| 1570 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1571 | "$P_CLI" \ |
| 1572 | 0 |
| 1573 | |
| 1574 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1575 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1576 | requires_config_enabled MBEDTLS_RSA_C |
| 1577 | requires_config_enabled MBEDTLS_SHA256_C |
| 1578 | run_test "TLS: password protected server key, two certificates" \ |
| 1579 | "$P_SRV \ |
| 1580 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1581 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1582 | "$P_CLI" \ |
| 1583 | 0 |
| 1584 | |
Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1585 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1586 | run_test "Default (compression enabled)" \ |
| 1587 | "$P_SRV debug_level=3" \ |
| 1588 | "$P_CLI debug_level=3" \ |
| 1589 | 0 \ |
| 1590 | -s "Allocating compression buffer" \ |
| 1591 | -c "Allocating compression buffer" \ |
| 1592 | -s "Record expansion is unknown (compression)" \ |
| 1593 | -c "Record expansion is unknown (compression)" \ |
| 1594 | -S "error" \ |
| 1595 | -C "error" |
| 1596 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1597 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1598 | run_test "CA callback on client" \ |
| 1599 | "$P_SRV debug_level=3" \ |
| 1600 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1601 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1602 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1603 | -S "error" \ |
| 1604 | -C "error" |
| 1605 | |
| 1606 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1607 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1608 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1609 | requires_config_enabled MBEDTLS_SHA256_C |
| 1610 | run_test "CA callback on server" \ |
| 1611 | "$P_SRV auth_mode=required" \ |
| 1612 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1613 | key_file=data_files/server5.key" \ |
| 1614 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1615 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1616 | -s "Verifying peer X.509 certificate... ok" \ |
| 1617 | -S "error" \ |
| 1618 | -C "error" |
| 1619 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1620 | # Test using an opaque private key for client authentication |
| 1621 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1622 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1623 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1624 | requires_config_enabled MBEDTLS_SHA256_C |
| 1625 | run_test "Opaque key for client authentication" \ |
| 1626 | "$P_SRV auth_mode=required" \ |
| 1627 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1628 | key_file=data_files/server5.key" \ |
| 1629 | 0 \ |
| 1630 | -c "key type: Opaque" \ |
| 1631 | -s "Verifying peer X.509 certificate... ok" \ |
| 1632 | -S "error" \ |
| 1633 | -C "error" |
| 1634 | |
Przemyslaw Stekiel | ab09c9e | 2021-10-04 11:13:22 +0200 | [diff] [blame^] | 1635 | # Test using an opaque private key for server authentication |
| 1636 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1637 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1638 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1639 | requires_config_enabled MBEDTLS_SHA256_C |
| 1640 | run_test "Opaque key for server authentication" \ |
| 1641 | "$P_SRV auth_mode=required key_opaque=1" \ |
| 1642 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1643 | key_file=data_files/server5.key" \ |
| 1644 | 0 \ |
| 1645 | -c "Verifying peer X.509 certificate... ok" \ |
| 1646 | -s "key type: Opaque" \ |
| 1647 | -S "error" \ |
| 1648 | -C "error" |
| 1649 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1650 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1651 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1652 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1653 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1654 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1655 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1656 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1657 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1658 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1659 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1660 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1661 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1662 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1663 | run_test_psa_force_curve "secp521r1" |
| 1664 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1665 | run_test_psa_force_curve "brainpoolP512r1" |
| 1666 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1667 | run_test_psa_force_curve "secp384r1" |
| 1668 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1669 | run_test_psa_force_curve "brainpoolP384r1" |
| 1670 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1671 | run_test_psa_force_curve "secp256r1" |
| 1672 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1673 | run_test_psa_force_curve "secp256k1" |
| 1674 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1675 | run_test_psa_force_curve "brainpoolP256r1" |
| 1676 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1677 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1678 | ## SECP224K1 is buggy via the PSA API |
Dave Rodgman | 52af769 | 2022-03-31 14:27:24 +0100 | [diff] [blame] | 1679 | ## (https://github.com/Mbed-TLS/mbedtls/issues/3541), |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1680 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1681 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1682 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1683 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1684 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1685 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1686 | run_test_psa_force_curve "secp192r1" |
| 1687 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1688 | run_test_psa_force_curve "secp192k1" |
| 1689 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1690 | # Test current time in ServerHello |
| 1691 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1692 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1693 | "$P_SRV debug_level=3" \ |
| 1694 | "$P_CLI debug_level=3" \ |
| 1695 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1696 | -f "check_server_hello_time" \ |
| 1697 | -F "check_server_hello_time" |
| 1698 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1699 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1700 | run_test "Unique IV in GCM" \ |
| 1701 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1702 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1703 | 0 \ |
| 1704 | -u "IV used" \ |
| 1705 | -U "IV used" |
| 1706 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1707 | # Tests for certificate verification callback |
| 1708 | run_test "Configuration-specific CRT verification callback" \ |
| 1709 | "$P_SRV debug_level=3" \ |
| 1710 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1711 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1712 | -S "error" \ |
| 1713 | -c "Verify requested for " \ |
| 1714 | -c "Use configuration-specific verification callback" \ |
| 1715 | -C "Use context-specific verification callback" \ |
| 1716 | -C "error" |
| 1717 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1718 | run_test "Context-specific CRT verification callback" \ |
| 1719 | "$P_SRV debug_level=3" \ |
| 1720 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1721 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1722 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1723 | -c "Verify requested for " \ |
| 1724 | -c "Use context-specific verification callback" \ |
| 1725 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1726 | -C "error" |
| 1727 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1728 | # Tests for rc4 option |
| 1729 | |
Gilles Peskine | 719a652 | 2022-04-15 20:03:33 +0200 | [diff] [blame] | 1730 | # Manual dependencies on the ciphersuite support are necessary |
| 1731 | # because the automatic requirements from force_ciphersuite=... detection |
| 1732 | # make an exception for these test cases since they expect a handshake |
| 1733 | # failure. |
| 1734 | requires_config_enabled MBEDTLS_ARC4_C |
| 1735 | requires_config_enabled MBEDTLS_SHA1_C |
| 1736 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1737 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1738 | run_test "RC4: server disabled, client enabled" \ |
| 1739 | "$P_SRV" \ |
| 1740 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1741 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1742 | -s "SSL - The server has no ciphersuites in common" |
| 1743 | |
Gilles Peskine | 719a652 | 2022-04-15 20:03:33 +0200 | [diff] [blame] | 1744 | requires_config_enabled MBEDTLS_ARC4_C |
| 1745 | requires_config_enabled MBEDTLS_SHA1_C |
| 1746 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1747 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1748 | run_test "RC4: server half, client enabled" \ |
| 1749 | "$P_SRV arc4=1" \ |
| 1750 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1751 | 1 \ |
| 1752 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1753 | |
Gilles Peskine | 719a652 | 2022-04-15 20:03:33 +0200 | [diff] [blame] | 1754 | requires_config_enabled MBEDTLS_ARC4_C |
| 1755 | requires_config_enabled MBEDTLS_SHA1_C |
| 1756 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
| 1757 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1758 | run_test "RC4: server enabled, client disabled" \ |
| 1759 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1760 | "$P_CLI" \ |
| 1761 | 1 \ |
| 1762 | -s "SSL - The server has no ciphersuites in common" |
| 1763 | |
Gilles Peskine | 719a652 | 2022-04-15 20:03:33 +0200 | [diff] [blame] | 1764 | # Run even if the ciphersuite is disabled by default, but only if the |
| 1765 | # requisite cryptographic mechanisms are present. |
| 1766 | # Having "force_ciphersuite=..." in the client or server arguments would |
| 1767 | # prevent that due to the automatic detection, so hide behind some |
| 1768 | # shell expansion to fool the automatic detection. |
| 1769 | with_rc4_ciphersuite() { |
| 1770 | exec "$@" force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA |
| 1771 | } |
| 1772 | requires_config_enabled MBEDTLS_ARC4_C |
| 1773 | requires_config_enabled MBEDTLS_SHA1_C |
| 1774 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1775 | run_test "RC4: both enabled" \ |
Gilles Peskine | 719a652 | 2022-04-15 20:03:33 +0200 | [diff] [blame] | 1776 | "with_rc4_ciphersuite $P_SRV" \ |
| 1777 | "with_rc4_ciphersuite $P_CLI" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1778 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1779 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1780 | -S "SSL - The server has no ciphersuites in common" |
| 1781 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1782 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1783 | |
| 1784 | requires_gnutls |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1785 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1786 | "$G_SRV"\ |
| 1787 | "$P_CLI force_version=tls1_1" \ |
| 1788 | 0 |
| 1789 | |
| 1790 | requires_gnutls |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1791 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1792 | "$G_SRV"\ |
| 1793 | "$P_CLI force_version=tls1" \ |
| 1794 | 0 |
| 1795 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1796 | # Tests for SHA-1 support |
| 1797 | |
| 1798 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1799 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1800 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1801 | 1 \ |
| 1802 | -c "The certificate is signed with an unacceptable hash" |
| 1803 | |
| 1804 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1805 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1806 | "$P_CLI allow_sha1=1" \ |
| 1807 | 0 |
| 1808 | |
| 1809 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1810 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1811 | "$P_CLI allow_sha1=0" \ |
| 1812 | 0 |
| 1813 | |
| 1814 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1815 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1816 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1817 | 1 \ |
| 1818 | -s "The certificate is signed with an unacceptable hash" |
| 1819 | |
| 1820 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1821 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1822 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1823 | 0 |
| 1824 | |
| 1825 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1826 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1827 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1828 | 0 |
| 1829 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1830 | # Tests for datagram packing |
| 1831 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1832 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1833 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1834 | 0 \ |
| 1835 | -c "next record in same datagram" \ |
| 1836 | -s "next record in same datagram" |
| 1837 | |
| 1838 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1839 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1840 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1841 | 0 \ |
| 1842 | -s "next record in same datagram" \ |
| 1843 | -C "next record in same datagram" |
| 1844 | |
| 1845 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1846 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1847 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1848 | 0 \ |
| 1849 | -S "next record in same datagram" \ |
| 1850 | -c "next record in same datagram" |
| 1851 | |
| 1852 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1853 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1854 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1855 | 0 \ |
| 1856 | -S "next record in same datagram" \ |
| 1857 | -C "next record in same datagram" |
| 1858 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1859 | # Tests for Truncated HMAC extension |
| 1860 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1861 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1862 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1863 | "$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] | 1864 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1865 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1866 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1867 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1868 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1869 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1870 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1871 | "$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] | 1872 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1873 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1874 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1875 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1876 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1877 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1878 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1879 | "$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] | 1880 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1881 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1882 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1883 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1884 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1885 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1886 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1887 | "$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] | 1888 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1889 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1890 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1891 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1892 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1893 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1894 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1895 | "$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] | 1896 | 0 \ |
| 1897 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1898 | -S "dumping 'expected mac' (10 bytes)" |
| 1899 | |
| 1900 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1901 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1902 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1903 | "$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] | 1904 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1905 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1906 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1907 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1908 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1909 | "$P_SRV dtls=1 debug_level=4" \ |
| 1910 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1911 | 0 \ |
| 1912 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1913 | -S "dumping 'expected mac' (10 bytes)" |
| 1914 | |
| 1915 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1916 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1917 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1918 | "$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] | 1919 | 0 \ |
| 1920 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1921 | -S "dumping 'expected mac' (10 bytes)" |
| 1922 | |
| 1923 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1924 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1925 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1926 | "$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] | 1927 | 0 \ |
| 1928 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1929 | -S "dumping 'expected mac' (10 bytes)" |
| 1930 | |
| 1931 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1932 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1933 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1934 | "$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] | 1935 | 0 \ |
| 1936 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1937 | -S "dumping 'expected mac' (10 bytes)" |
| 1938 | |
| 1939 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1940 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1941 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1942 | "$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] | 1943 | 0 \ |
| 1944 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1945 | -S "dumping 'expected mac' (10 bytes)" |
| 1946 | |
| 1947 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1948 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1949 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1950 | "$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] | 1951 | 0 \ |
| 1952 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1953 | -s "dumping 'expected mac' (10 bytes)" |
| 1954 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1955 | # Tests for Context serialization |
| 1956 | |
| 1957 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1958 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1959 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1960 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1961 | 0 \ |
| 1962 | -c "Deserializing connection..." \ |
| 1963 | -S "Deserializing connection..." |
| 1964 | |
| 1965 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1966 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1967 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1968 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1969 | 0 \ |
| 1970 | -c "Deserializing connection..." \ |
| 1971 | -S "Deserializing connection..." |
| 1972 | |
| 1973 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1974 | run_test "Context serialization, client serializes, GCM" \ |
| 1975 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1976 | "$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] | 1977 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1978 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1979 | -S "Deserializing connection..." |
| 1980 | |
| 1981 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1982 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1983 | run_test "Context serialization, client serializes, with CID" \ |
| 1984 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1985 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1986 | 0 \ |
| 1987 | -c "Deserializing connection..." \ |
| 1988 | -S "Deserializing connection..." |
| 1989 | |
| 1990 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1991 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1992 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1993 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1994 | 0 \ |
| 1995 | -C "Deserializing connection..." \ |
| 1996 | -s "Deserializing connection..." |
| 1997 | |
| 1998 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1999 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 2000 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2001 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2002 | 0 \ |
| 2003 | -C "Deserializing connection..." \ |
| 2004 | -s "Deserializing connection..." |
| 2005 | |
| 2006 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2007 | run_test "Context serialization, server serializes, GCM" \ |
| 2008 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2009 | "$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] | 2010 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2011 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2012 | -s "Deserializing connection..." |
| 2013 | |
| 2014 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2015 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2016 | run_test "Context serialization, server serializes, with CID" \ |
| 2017 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2018 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2019 | 0 \ |
| 2020 | -C "Deserializing connection..." \ |
| 2021 | -s "Deserializing connection..." |
| 2022 | |
| 2023 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2024 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2025 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2026 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2027 | 0 \ |
| 2028 | -c "Deserializing connection..." \ |
| 2029 | -s "Deserializing connection..." |
| 2030 | |
| 2031 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2032 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 2033 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2034 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2035 | 0 \ |
| 2036 | -c "Deserializing connection..." \ |
| 2037 | -s "Deserializing connection..." |
| 2038 | |
| 2039 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2040 | run_test "Context serialization, both serialize, GCM" \ |
| 2041 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 2042 | "$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] | 2043 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 2044 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 2045 | -s "Deserializing connection..." |
| 2046 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2047 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2048 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2049 | run_test "Context serialization, both serialize, with CID" \ |
| 2050 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 2051 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 2052 | 0 \ |
| 2053 | -c "Deserializing connection..." \ |
| 2054 | -s "Deserializing connection..." |
| 2055 | |
| 2056 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2057 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2058 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2059 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2060 | 0 \ |
| 2061 | -c "Deserializing connection..." \ |
| 2062 | -S "Deserializing connection..." |
| 2063 | |
| 2064 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2065 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 2066 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2067 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2068 | 0 \ |
| 2069 | -c "Deserializing connection..." \ |
| 2070 | -S "Deserializing connection..." |
| 2071 | |
| 2072 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2073 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 2074 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 2075 | "$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] | 2076 | 0 \ |
| 2077 | -c "Deserializing connection..." \ |
| 2078 | -S "Deserializing connection..." |
| 2079 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2080 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2081 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2082 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 2083 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 2084 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2085 | 0 \ |
| 2086 | -c "Deserializing connection..." \ |
| 2087 | -S "Deserializing connection..." |
| 2088 | |
| 2089 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2090 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2091 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2092 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2093 | 0 \ |
| 2094 | -C "Deserializing connection..." \ |
| 2095 | -s "Deserializing connection..." |
| 2096 | |
| 2097 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2098 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 2099 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2100 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2101 | 0 \ |
| 2102 | -C "Deserializing connection..." \ |
| 2103 | -s "Deserializing connection..." |
| 2104 | |
| 2105 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2106 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 2107 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2108 | "$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] | 2109 | 0 \ |
| 2110 | -C "Deserializing connection..." \ |
| 2111 | -s "Deserializing connection..." |
| 2112 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 2113 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2114 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2115 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 2116 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2117 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 2118 | 0 \ |
| 2119 | -C "Deserializing connection..." \ |
| 2120 | -s "Deserializing connection..." |
| 2121 | |
| 2122 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2123 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 2124 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 2125 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2126 | 0 \ |
| 2127 | -c "Deserializing connection..." \ |
| 2128 | -s "Deserializing connection..." |
| 2129 | |
| 2130 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2131 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 2132 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2133 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 2134 | 0 \ |
| 2135 | -c "Deserializing connection..." \ |
| 2136 | -s "Deserializing connection..." |
| 2137 | |
| 2138 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2139 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 2140 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 2141 | "$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] | 2142 | 0 \ |
| 2143 | -c "Deserializing connection..." \ |
| 2144 | -s "Deserializing connection..." |
| 2145 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 2146 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2147 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2148 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 2149 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 2150 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 2151 | 0 \ |
| 2152 | -c "Deserializing connection..." \ |
| 2153 | -s "Deserializing connection..." |
| 2154 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 2155 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 2156 | run_test "Saving the serialized context to a file" \ |
| 2157 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 2158 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 2159 | 0 \ |
| 2160 | -s "Save serialized context to a file... ok" \ |
| 2161 | -c "Save serialized context to a file... ok" |
| 2162 | rm -f context_srv.txt |
| 2163 | rm -f context_cli.txt |
| 2164 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2165 | # Tests for DTLS Connection ID extension |
| 2166 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2167 | # So far, the CID API isn't implemented, so we can't |
| 2168 | # grep for output witnessing its use. This needs to be |
| 2169 | # changed once the CID extension is implemented. |
| 2170 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2171 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2172 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2173 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 2174 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2175 | 0 \ |
| 2176 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2177 | -s "found CID extension" \ |
| 2178 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2179 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2180 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2181 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2182 | -C "found CID extension" \ |
| 2183 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2184 | -C "Copy CIDs into SSL transform" \ |
| 2185 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2186 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2187 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2188 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2189 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2190 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 2191 | 0 \ |
| 2192 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2193 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2194 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2195 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2196 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2197 | -C "found CID extension" \ |
| 2198 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2199 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 2200 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2201 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2202 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2203 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2204 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2205 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 2206 | 0 \ |
| 2207 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2208 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2209 | -c "client hello, adding CID extension" \ |
| 2210 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2211 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2212 | -s "server hello, adding CID extension" \ |
| 2213 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2214 | -c "Use of CID extension negotiated" \ |
| 2215 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2216 | -c "Copy CIDs into SSL transform" \ |
| 2217 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2218 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2219 | -s "Use of Connection ID has been negotiated" \ |
| 2220 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2221 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2222 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2223 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2224 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2225 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 2226 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 2227 | 0 \ |
| 2228 | -c "Enable use of CID extension." \ |
| 2229 | -s "Enable use of CID extension." \ |
| 2230 | -c "client hello, adding CID extension" \ |
| 2231 | -s "found CID extension" \ |
| 2232 | -s "Use of CID extension negotiated" \ |
| 2233 | -s "server hello, adding CID extension" \ |
| 2234 | -c "found CID extension" \ |
| 2235 | -c "Use of CID extension negotiated" \ |
| 2236 | -s "Copy CIDs into SSL transform" \ |
| 2237 | -c "Copy CIDs into SSL transform" \ |
| 2238 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2239 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2240 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2241 | -c "Use of Connection ID has been negotiated" \ |
| 2242 | -c "ignoring unexpected CID" \ |
| 2243 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2244 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2245 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2246 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 2247 | -p "$P_PXY mtu=800" \ |
| 2248 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2249 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2250 | 0 \ |
| 2251 | -c "Enable use of CID extension." \ |
| 2252 | -s "Enable use of CID extension." \ |
| 2253 | -c "client hello, adding CID extension" \ |
| 2254 | -s "found CID extension" \ |
| 2255 | -s "Use of CID extension negotiated" \ |
| 2256 | -s "server hello, adding CID extension" \ |
| 2257 | -c "found CID extension" \ |
| 2258 | -c "Use of CID extension negotiated" \ |
| 2259 | -s "Copy CIDs into SSL transform" \ |
| 2260 | -c "Copy CIDs into SSL transform" \ |
| 2261 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2262 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2263 | -s "Use of Connection ID has been negotiated" \ |
| 2264 | -c "Use of Connection ID has been negotiated" |
| 2265 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2266 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2267 | 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] | 2268 | -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] | 2269 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 2270 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 2271 | 0 \ |
| 2272 | -c "Enable use of CID extension." \ |
| 2273 | -s "Enable use of CID extension." \ |
| 2274 | -c "client hello, adding CID extension" \ |
| 2275 | -s "found CID extension" \ |
| 2276 | -s "Use of CID extension negotiated" \ |
| 2277 | -s "server hello, adding CID extension" \ |
| 2278 | -c "found CID extension" \ |
| 2279 | -c "Use of CID extension negotiated" \ |
| 2280 | -s "Copy CIDs into SSL transform" \ |
| 2281 | -c "Copy CIDs into SSL transform" \ |
| 2282 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2283 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2284 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2285 | -c "Use of Connection ID has been negotiated" \ |
| 2286 | -c "ignoring unexpected CID" \ |
| 2287 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2288 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2289 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2290 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2291 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2292 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2293 | 0 \ |
| 2294 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2295 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2296 | -c "client hello, adding CID extension" \ |
| 2297 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2298 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2299 | -s "server hello, adding CID extension" \ |
| 2300 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2301 | -c "Use of CID extension negotiated" \ |
| 2302 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2303 | -c "Copy CIDs into SSL transform" \ |
| 2304 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2305 | -s "Peer CID (length 0 Bytes):" \ |
| 2306 | -s "Use of Connection ID has been negotiated" \ |
| 2307 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2308 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2309 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2310 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2311 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2312 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2313 | 0 \ |
| 2314 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2315 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2316 | -c "client hello, adding CID extension" \ |
| 2317 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2318 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2319 | -s "server hello, adding CID extension" \ |
| 2320 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2321 | -c "Use of CID extension negotiated" \ |
| 2322 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2323 | -c "Copy CIDs into SSL transform" \ |
| 2324 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2325 | -c "Peer CID (length 0 Bytes):" \ |
| 2326 | -s "Use of Connection ID has been negotiated" \ |
| 2327 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2328 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2329 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2330 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2331 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2332 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2333 | 0 \ |
| 2334 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2335 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2336 | -c "client hello, adding CID extension" \ |
| 2337 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2338 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2339 | -s "server hello, adding CID extension" \ |
| 2340 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2341 | -c "Use of CID extension negotiated" \ |
| 2342 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2343 | -c "Copy CIDs into SSL transform" \ |
| 2344 | -S "Use of Connection ID has been negotiated" \ |
| 2345 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2346 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2347 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2348 | 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] | 2349 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2350 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2351 | 0 \ |
| 2352 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2353 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2354 | -c "client hello, adding CID extension" \ |
| 2355 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2356 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2357 | -s "server hello, adding CID extension" \ |
| 2358 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2359 | -c "Use of CID extension negotiated" \ |
| 2360 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2361 | -c "Copy CIDs into SSL transform" \ |
| 2362 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2363 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2364 | -s "Use of Connection ID has been negotiated" \ |
| 2365 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2366 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2367 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2368 | 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] | 2369 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2370 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2371 | 0 \ |
| 2372 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2373 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2374 | -c "client hello, adding CID extension" \ |
| 2375 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2376 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2377 | -s "server hello, adding CID extension" \ |
| 2378 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2379 | -c "Use of CID extension negotiated" \ |
| 2380 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2381 | -c "Copy CIDs into SSL transform" \ |
| 2382 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2383 | -s "Peer CID (length 0 Bytes):" \ |
| 2384 | -s "Use of Connection ID has been negotiated" \ |
| 2385 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2386 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2387 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2388 | 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] | 2389 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2390 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2391 | 0 \ |
| 2392 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2393 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2394 | -c "client hello, adding CID extension" \ |
| 2395 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2396 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2397 | -s "server hello, adding CID extension" \ |
| 2398 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2399 | -c "Use of CID extension negotiated" \ |
| 2400 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2401 | -c "Copy CIDs into SSL transform" \ |
| 2402 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2403 | -c "Peer CID (length 0 Bytes):" \ |
| 2404 | -s "Use of Connection ID has been negotiated" \ |
| 2405 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2406 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2407 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2408 | 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] | 2409 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2410 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2411 | 0 \ |
| 2412 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2413 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2414 | -c "client hello, adding CID extension" \ |
| 2415 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2416 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2417 | -s "server hello, adding CID extension" \ |
| 2418 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2419 | -c "Use of CID extension negotiated" \ |
| 2420 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2421 | -c "Copy CIDs into SSL transform" \ |
| 2422 | -S "Use of Connection ID has been negotiated" \ |
| 2423 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2424 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2425 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2426 | 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] | 2427 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2428 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2429 | 0 \ |
| 2430 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2431 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2432 | -c "client hello, adding CID extension" \ |
| 2433 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2434 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2435 | -s "server hello, adding CID extension" \ |
| 2436 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2437 | -c "Use of CID extension negotiated" \ |
| 2438 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2439 | -c "Copy CIDs into SSL transform" \ |
| 2440 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2441 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2442 | -s "Use of Connection ID has been negotiated" \ |
| 2443 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2444 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2445 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2446 | 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] | 2447 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2448 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2449 | 0 \ |
| 2450 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2451 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2452 | -c "client hello, adding CID extension" \ |
| 2453 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2454 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2455 | -s "server hello, adding CID extension" \ |
| 2456 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2457 | -c "Use of CID extension negotiated" \ |
| 2458 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2459 | -c "Copy CIDs into SSL transform" \ |
| 2460 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2461 | -s "Peer CID (length 0 Bytes):" \ |
| 2462 | -s "Use of Connection ID has been negotiated" \ |
| 2463 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2464 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2465 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2466 | 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] | 2467 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2468 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2469 | 0 \ |
| 2470 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2471 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2472 | -c "client hello, adding CID extension" \ |
| 2473 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2474 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2475 | -s "server hello, adding CID extension" \ |
| 2476 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2477 | -c "Use of CID extension negotiated" \ |
| 2478 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2479 | -c "Copy CIDs into SSL transform" \ |
| 2480 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2481 | -c "Peer CID (length 0 Bytes):" \ |
| 2482 | -s "Use of Connection ID has been negotiated" \ |
| 2483 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2484 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2485 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2486 | 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] | 2487 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2488 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2489 | 0 \ |
| 2490 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2491 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2492 | -c "client hello, adding CID extension" \ |
| 2493 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2494 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2495 | -s "server hello, adding CID extension" \ |
| 2496 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2497 | -c "Use of CID extension negotiated" \ |
| 2498 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2499 | -c "Copy CIDs into SSL transform" \ |
| 2500 | -S "Use of Connection ID has been negotiated" \ |
| 2501 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2502 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2503 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2504 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2505 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2506 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2507 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2508 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2509 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2510 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2511 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2512 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2513 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2514 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2515 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2516 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2517 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2518 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2519 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2520 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2521 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2522 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2523 | 0 \ |
| 2524 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2525 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2526 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2527 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2528 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2529 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2530 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2531 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2532 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2533 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2534 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2535 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2536 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2537 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2538 | 0 \ |
| 2539 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2540 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2541 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2542 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2543 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2544 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2545 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2546 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2547 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2548 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2549 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2550 | 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] | 2551 | -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] | 2552 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2553 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 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 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2560 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2561 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2562 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2563 | -c "ignoring unexpected CID" \ |
| 2564 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2565 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2566 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2567 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2568 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2569 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2570 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2571 | 0 \ |
| 2572 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2573 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2574 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2575 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2576 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2577 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2578 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2579 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2580 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2581 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2582 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2583 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2584 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2585 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2586 | 0 \ |
| 2587 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2588 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2589 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2590 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2591 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2592 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2593 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2594 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2595 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2596 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2597 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2598 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2599 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2600 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2601 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2602 | 0 \ |
| 2603 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2604 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2605 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2606 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2607 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2608 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2609 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2610 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2611 | -c "ignoring unexpected CID" \ |
| 2612 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2613 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2614 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2615 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2616 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2617 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2618 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2619 | 0 \ |
| 2620 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2621 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2622 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2623 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2624 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2625 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2626 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2627 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2628 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2629 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2630 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2631 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2632 | 0 \ |
| 2633 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2634 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2635 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2636 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2637 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2638 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2639 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2640 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2641 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2642 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2643 | -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] | 2644 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2645 | "$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" \ |
| 2646 | 0 \ |
| 2647 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2648 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2649 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2650 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2651 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2652 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2653 | -c "ignoring unexpected CID" \ |
| 2654 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2655 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2656 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2657 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2658 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2659 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2660 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2661 | 0 \ |
| 2662 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2663 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2664 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2665 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2666 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2667 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2668 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2669 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2670 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2671 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2672 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2673 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2674 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2675 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2676 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2677 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2678 | 0 \ |
| 2679 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2680 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2681 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2682 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2683 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2684 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2685 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2686 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2687 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2688 | -c "ignoring unexpected CID" \ |
| 2689 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2690 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2691 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2692 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2693 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2694 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2695 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2696 | 0 \ |
| 2697 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2698 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2699 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2700 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2701 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2702 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2703 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2704 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2705 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2706 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2707 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2708 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2709 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2710 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2711 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2712 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2713 | 0 \ |
| 2714 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2715 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2716 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2717 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2718 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2719 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2720 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2721 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2722 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2723 | -c "ignoring unexpected CID" \ |
| 2724 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2725 | |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2726 | # This and the test below it require MAX_CONTENT_LEN to be at least MFL+1, because the |
| 2727 | # tests check that the buffer contents are reallocated when the message is |
| 2728 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2729 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2730 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2731 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2732 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2733 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2734 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2735 | 0 \ |
| 2736 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2737 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2738 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2739 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2740 | -s "Reallocating in_buf" \ |
| 2741 | -s "Reallocating out_buf" |
| 2742 | |
| 2743 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2744 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 7187953 | 2021-07-09 11:32:38 +0100 | [diff] [blame] | 2745 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2746 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2747 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2748 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2749 | 0 \ |
| 2750 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2751 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2752 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2753 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2754 | -s "Reallocating in_buf" \ |
| 2755 | -s "Reallocating out_buf" |
| 2756 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2757 | # Tests for Encrypt-then-MAC extension |
| 2758 | |
| 2759 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2760 | "$P_SRV debug_level=3 \ |
| 2761 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2762 | "$P_CLI debug_level=3" \ |
| 2763 | 0 \ |
| 2764 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2765 | -s "found encrypt then mac extension" \ |
| 2766 | -s "server hello, adding encrypt then mac extension" \ |
| 2767 | -c "found encrypt_then_mac extension" \ |
| 2768 | -c "using encrypt then mac" \ |
| 2769 | -s "using encrypt then mac" |
| 2770 | |
| 2771 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2772 | "$P_SRV debug_level=3 etm=0 \ |
| 2773 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2774 | "$P_CLI debug_level=3 etm=1" \ |
| 2775 | 0 \ |
| 2776 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2777 | -s "found encrypt then mac extension" \ |
| 2778 | -S "server hello, adding encrypt then mac extension" \ |
| 2779 | -C "found encrypt_then_mac extension" \ |
| 2780 | -C "using encrypt then mac" \ |
| 2781 | -S "using encrypt then mac" |
| 2782 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2783 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2784 | "$P_SRV debug_level=3 etm=1 \ |
| 2785 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2786 | "$P_CLI debug_level=3 etm=1" \ |
| 2787 | 0 \ |
| 2788 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2789 | -s "found encrypt then mac extension" \ |
| 2790 | -S "server hello, adding encrypt then mac extension" \ |
| 2791 | -C "found encrypt_then_mac extension" \ |
| 2792 | -C "using encrypt then mac" \ |
| 2793 | -S "using encrypt then mac" |
| 2794 | |
| 2795 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 2796 | "$P_SRV debug_level=3 etm=1 \ |
| 2797 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2798 | "$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] | 2799 | 0 \ |
| 2800 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2801 | -s "found encrypt then mac extension" \ |
| 2802 | -S "server hello, adding encrypt then mac extension" \ |
| 2803 | -C "found encrypt_then_mac extension" \ |
| 2804 | -C "using encrypt then mac" \ |
| 2805 | -S "using encrypt then mac" |
| 2806 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2807 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2808 | "$P_SRV debug_level=3 etm=1 \ |
| 2809 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2810 | "$P_CLI debug_level=3 etm=0" \ |
| 2811 | 0 \ |
| 2812 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2813 | -S "found encrypt then mac extension" \ |
| 2814 | -S "server hello, adding encrypt then mac extension" \ |
| 2815 | -C "found encrypt_then_mac extension" \ |
| 2816 | -C "using encrypt then mac" \ |
| 2817 | -S "using encrypt then mac" |
| 2818 | |
| 2819 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2820 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2821 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2822 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2823 | 0 \ |
| 2824 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2825 | -S "found encrypt then mac extension" \ |
| 2826 | -S "server hello, adding encrypt then mac extension" \ |
| 2827 | -C "found encrypt_then_mac extension" \ |
| 2828 | -C "using encrypt then mac" \ |
| 2829 | -S "using encrypt then mac" |
| 2830 | |
| 2831 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2832 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 2833 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2834 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2835 | 0 \ |
| 2836 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2837 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2838 | -S "server hello, adding encrypt then mac extension" \ |
| 2839 | -C "found encrypt_then_mac extension" \ |
| 2840 | -C "using encrypt then mac" \ |
| 2841 | -S "using encrypt then mac" |
| 2842 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2843 | # Tests for Extended Master Secret extension |
| 2844 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2845 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2846 | run_test "Extended Master Secret: default" \ |
| 2847 | "$P_SRV debug_level=3" \ |
| 2848 | "$P_CLI debug_level=3" \ |
| 2849 | 0 \ |
| 2850 | -c "client hello, adding extended_master_secret extension" \ |
| 2851 | -s "found extended master secret extension" \ |
| 2852 | -s "server hello, adding extended master secret extension" \ |
| 2853 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2854 | -c "session hash for extended master secret" \ |
| 2855 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2856 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2857 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2858 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2859 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2860 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2861 | 0 \ |
| 2862 | -c "client hello, adding extended_master_secret extension" \ |
| 2863 | -s "found extended master secret extension" \ |
| 2864 | -S "server hello, adding extended master secret extension" \ |
| 2865 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2866 | -C "session hash for extended master secret" \ |
| 2867 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2868 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 2869 | requires_config_enabled MBEDTLS_SSL_EXTENDED_MASTER_SECRET |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2870 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2871 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2872 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2873 | 0 \ |
| 2874 | -C "client hello, adding extended_master_secret extension" \ |
| 2875 | -S "found extended master secret extension" \ |
| 2876 | -S "server hello, adding extended master secret extension" \ |
| 2877 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2878 | -C "session hash for extended master secret" \ |
| 2879 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2880 | |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2881 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2882 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2883 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 2884 | 0 \ |
| 2885 | -C "client hello, adding extended_master_secret extension" \ |
| 2886 | -S "found extended master secret extension" \ |
| 2887 | -S "server hello, adding extended master secret extension" \ |
| 2888 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2889 | -C "session hash for extended master secret" \ |
| 2890 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2891 | |
| 2892 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 2893 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2894 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2895 | 0 \ |
| 2896 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2897 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2898 | -S "server hello, adding extended master secret extension" \ |
| 2899 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2900 | -C "session hash for extended master secret" \ |
| 2901 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2902 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2903 | # Tests for FALLBACK_SCSV |
| 2904 | |
| 2905 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2906 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2907 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 2908 | 0 \ |
| 2909 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2910 | -S "received FALLBACK_SCSV" \ |
| 2911 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2912 | -C "is a fatal alert message (msg 86)" |
| 2913 | |
| 2914 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2915 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2916 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2917 | 0 \ |
| 2918 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2919 | -S "received FALLBACK_SCSV" \ |
| 2920 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2921 | -C "is a fatal alert message (msg 86)" |
| 2922 | |
| 2923 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2924 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2925 | "$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] | 2926 | 1 \ |
| 2927 | -c "adding FALLBACK_SCSV" \ |
| 2928 | -s "received FALLBACK_SCSV" \ |
| 2929 | -s "inapropriate fallback" \ |
| 2930 | -c "is a fatal alert message (msg 86)" |
| 2931 | |
| 2932 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2933 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2934 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2935 | 0 \ |
| 2936 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2937 | -s "received FALLBACK_SCSV" \ |
| 2938 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2939 | -C "is a fatal alert message (msg 86)" |
| 2940 | |
| 2941 | requires_openssl_with_fallback_scsv |
| 2942 | run_test "Fallback SCSV: default, openssl server" \ |
| 2943 | "$O_SRV" \ |
| 2944 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 2945 | 0 \ |
| 2946 | -C "adding FALLBACK_SCSV" \ |
| 2947 | -C "is a fatal alert message (msg 86)" |
| 2948 | |
| 2949 | requires_openssl_with_fallback_scsv |
| 2950 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 2951 | "$O_SRV" \ |
| 2952 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 2953 | 1 \ |
| 2954 | -c "adding FALLBACK_SCSV" \ |
| 2955 | -c "is a fatal alert message (msg 86)" |
| 2956 | |
Gilles Peskine | add21ad | 2022-04-15 15:14:58 +0200 | [diff] [blame] | 2957 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2958 | requires_openssl_with_fallback_scsv |
| 2959 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2960 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2961 | "$O_CLI -tls1_1" \ |
| 2962 | 0 \ |
| 2963 | -S "received FALLBACK_SCSV" \ |
| 2964 | -S "inapropriate fallback" |
| 2965 | |
Gilles Peskine | add21ad | 2022-04-15 15:14:58 +0200 | [diff] [blame] | 2966 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2967 | requires_openssl_with_fallback_scsv |
| 2968 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2969 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2970 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 2971 | 1 \ |
| 2972 | -s "received FALLBACK_SCSV" \ |
| 2973 | -s "inapropriate fallback" |
| 2974 | |
| 2975 | requires_openssl_with_fallback_scsv |
| 2976 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2977 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2978 | "$O_CLI -fallback_scsv" \ |
| 2979 | 0 \ |
| 2980 | -s "received FALLBACK_SCSV" \ |
| 2981 | -S "inapropriate fallback" |
| 2982 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2983 | # Test sending and receiving empty application data records |
| 2984 | |
| 2985 | run_test "Encrypt then MAC: empty application data record" \ |
| 2986 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2987 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2988 | 0 \ |
| 2989 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2990 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2991 | -c "0 bytes written in 1 fragments" |
| 2992 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2993 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2994 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2995 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2996 | 0 \ |
| 2997 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2998 | -c "0 bytes written in 1 fragments" |
| 2999 | |
| 3000 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 3001 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 3002 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 3003 | 0 \ |
| 3004 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 3005 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3006 | -c "0 bytes written in 1 fragments" |
| 3007 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 3008 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 3009 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 3010 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 3011 | 0 \ |
| 3012 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 3013 | -c "0 bytes written in 1 fragments" |
| 3014 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 3015 | ## ClientHello generated with |
| 3016 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 3017 | ## then manually twiddling the ciphersuite list. |
| 3018 | ## The ClientHello content is spelled out below as a hex string as |
| 3019 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 3020 | ## The expected response is an inappropriate_fallback alert. |
Gilles Peskine | bba3b4c | 2022-04-09 00:08:47 +0200 | [diff] [blame] | 3021 | requires_config_enabled MBEDTLS_SSL_FALLBACK_SCSV |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 3022 | run_test "Fallback SCSV: beginning of list" \ |
| 3023 | "$P_SRV debug_level=2" \ |
| 3024 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 3025 | 0 \ |
| 3026 | -s "received FALLBACK_SCSV" \ |
| 3027 | -s "inapropriate fallback" |
| 3028 | |
Gilles Peskine | bba3b4c | 2022-04-09 00:08:47 +0200 | [diff] [blame] | 3029 | requires_config_enabled MBEDTLS_SSL_FALLBACK_SCSV |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 3030 | run_test "Fallback SCSV: end of list" \ |
| 3031 | "$P_SRV debug_level=2" \ |
| 3032 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 3033 | 0 \ |
| 3034 | -s "received FALLBACK_SCSV" \ |
| 3035 | -s "inapropriate fallback" |
| 3036 | |
| 3037 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
Gilles Peskine | bba3b4c | 2022-04-09 00:08:47 +0200 | [diff] [blame] | 3038 | requires_config_enabled MBEDTLS_SSL_FALLBACK_SCSV |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 3039 | run_test "Fallback SCSV: not in list" \ |
| 3040 | "$P_SRV debug_level=2" \ |
| 3041 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 3042 | 0 \ |
| 3043 | -S "received FALLBACK_SCSV" \ |
| 3044 | -S "inapropriate fallback" |
| 3045 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3046 | # Tests for CBC 1/n-1 record splitting |
| 3047 | |
| 3048 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 3049 | "$P_SRV" \ |
| 3050 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 3051 | request_size=123 force_version=tls12" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3052 | 0 \ |
| 3053 | -s "Read from client: 123 bytes read" \ |
| 3054 | -S "Read from client: 1 bytes read" \ |
| 3055 | -S "122 bytes read" |
| 3056 | |
| 3057 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 3058 | "$P_SRV" \ |
| 3059 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 3060 | request_size=123 force_version=tls1_1" \ |
| 3061 | 0 \ |
| 3062 | -s "Read from client: 123 bytes read" \ |
| 3063 | -S "Read from client: 1 bytes read" \ |
| 3064 | -S "122 bytes read" |
| 3065 | |
| 3066 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 3067 | "$P_SRV" \ |
| 3068 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 3069 | request_size=123 force_version=tls1" \ |
| 3070 | 0 \ |
| 3071 | -S "Read from client: 123 bytes read" \ |
| 3072 | -s "Read from client: 1 bytes read" \ |
| 3073 | -s "122 bytes read" |
| 3074 | |
| 3075 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 3076 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 3077 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 3078 | request_size=123 force_version=ssl3" \ |
| 3079 | 0 \ |
| 3080 | -S "Read from client: 123 bytes read" \ |
| 3081 | -s "Read from client: 1 bytes read" \ |
| 3082 | -s "122 bytes read" |
| 3083 | |
| 3084 | 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] | 3085 | "$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] | 3086 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 3087 | request_size=123 force_version=tls1" \ |
| 3088 | 0 \ |
| 3089 | -s "Read from client: 123 bytes read" \ |
| 3090 | -S "Read from client: 1 bytes read" \ |
| 3091 | -S "122 bytes read" |
| 3092 | |
| 3093 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 3094 | "$P_SRV" \ |
| 3095 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 3096 | request_size=123 force_version=tls1 recsplit=0" \ |
| 3097 | 0 \ |
| 3098 | -s "Read from client: 123 bytes read" \ |
| 3099 | -S "Read from client: 1 bytes read" \ |
| 3100 | -S "122 bytes read" |
| 3101 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 3102 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 3103 | "$P_SRV nbio=2" \ |
| 3104 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 3105 | request_size=123 force_version=tls1" \ |
| 3106 | 0 \ |
| 3107 | -S "Read from client: 123 bytes read" \ |
| 3108 | -s "Read from client: 1 bytes read" \ |
| 3109 | -s "122 bytes read" |
| 3110 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3111 | # Tests for Session Tickets |
| 3112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3113 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3114 | "$P_SRV debug_level=3 tickets=1" \ |
| 3115 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3116 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3117 | -c "client hello, adding session ticket extension" \ |
| 3118 | -s "found session ticket extension" \ |
| 3119 | -s "server hello, adding session ticket extension" \ |
| 3120 | -c "found session_ticket extension" \ |
| 3121 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3122 | -S "session successfully restored from cache" \ |
| 3123 | -s "session successfully restored from ticket" \ |
| 3124 | -s "a session has been resumed" \ |
| 3125 | -c "a session has been resumed" |
| 3126 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3127 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3128 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3129 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 3130 | 0 \ |
| 3131 | -c "client hello, adding session ticket extension" \ |
| 3132 | -s "found session ticket extension" \ |
| 3133 | -s "server hello, adding session ticket extension" \ |
| 3134 | -c "found session_ticket extension" \ |
| 3135 | -c "parse new session ticket" \ |
| 3136 | -S "session successfully restored from cache" \ |
| 3137 | -s "session successfully restored from ticket" \ |
| 3138 | -s "a session has been resumed" \ |
| 3139 | -c "a session has been resumed" |
| 3140 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3141 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3142 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 3143 | "$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] | 3144 | 0 \ |
| 3145 | -c "client hello, adding session ticket extension" \ |
| 3146 | -s "found session ticket extension" \ |
| 3147 | -s "server hello, adding session ticket extension" \ |
| 3148 | -c "found session_ticket extension" \ |
| 3149 | -c "parse new session ticket" \ |
| 3150 | -S "session successfully restored from cache" \ |
| 3151 | -S "session successfully restored from ticket" \ |
| 3152 | -S "a session has been resumed" \ |
| 3153 | -C "a session has been resumed" |
| 3154 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3155 | run_test "Session resume using tickets: session copy" \ |
| 3156 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 3157 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 3158 | 0 \ |
| 3159 | -c "client hello, adding session ticket extension" \ |
| 3160 | -s "found session ticket extension" \ |
| 3161 | -s "server hello, adding session ticket extension" \ |
| 3162 | -c "found session_ticket extension" \ |
| 3163 | -c "parse new session ticket" \ |
| 3164 | -S "session successfully restored from cache" \ |
| 3165 | -s "session successfully restored from ticket" \ |
| 3166 | -s "a session has been resumed" \ |
| 3167 | -c "a session has been resumed" |
| 3168 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3169 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3170 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3171 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3172 | 0 \ |
| 3173 | -c "client hello, adding session ticket extension" \ |
| 3174 | -c "found session_ticket extension" \ |
| 3175 | -c "parse new session ticket" \ |
| 3176 | -c "a session has been resumed" |
| 3177 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3178 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3179 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3180 | "( $O_CLI -sess_out $SESSION; \ |
| 3181 | $O_CLI -sess_in $SESSION; \ |
| 3182 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 3183 | 0 \ |
| 3184 | -s "found session ticket extension" \ |
| 3185 | -s "server hello, adding session ticket extension" \ |
| 3186 | -S "session successfully restored from cache" \ |
| 3187 | -s "session successfully restored from ticket" \ |
| 3188 | -s "a session has been resumed" |
| 3189 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3190 | # Tests for Session Tickets with DTLS |
| 3191 | |
| 3192 | run_test "Session resume using tickets, DTLS: basic" \ |
| 3193 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3194 | "$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] | 3195 | 0 \ |
| 3196 | -c "client hello, adding session ticket extension" \ |
| 3197 | -s "found session ticket extension" \ |
| 3198 | -s "server hello, adding session ticket extension" \ |
| 3199 | -c "found session_ticket extension" \ |
| 3200 | -c "parse new session ticket" \ |
| 3201 | -S "session successfully restored from cache" \ |
| 3202 | -s "session successfully restored from ticket" \ |
| 3203 | -s "a session has been resumed" \ |
| 3204 | -c "a session has been resumed" |
| 3205 | |
| 3206 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 3207 | "$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] | 3208 | "$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] | 3209 | 0 \ |
| 3210 | -c "client hello, adding session ticket extension" \ |
| 3211 | -s "found session ticket extension" \ |
| 3212 | -s "server hello, adding session ticket extension" \ |
| 3213 | -c "found session_ticket extension" \ |
| 3214 | -c "parse new session ticket" \ |
| 3215 | -S "session successfully restored from cache" \ |
| 3216 | -s "session successfully restored from ticket" \ |
| 3217 | -s "a session has been resumed" \ |
| 3218 | -c "a session has been resumed" |
| 3219 | |
| 3220 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 3221 | "$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] | 3222 | "$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] | 3223 | 0 \ |
| 3224 | -c "client hello, adding session ticket extension" \ |
| 3225 | -s "found session ticket extension" \ |
| 3226 | -s "server hello, adding session ticket extension" \ |
| 3227 | -c "found session_ticket extension" \ |
| 3228 | -c "parse new session ticket" \ |
| 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 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3234 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 3235 | "$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] | 3236 | "$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] | 3237 | 0 \ |
| 3238 | -c "client hello, adding session ticket extension" \ |
| 3239 | -s "found session ticket extension" \ |
| 3240 | -s "server hello, adding session ticket extension" \ |
| 3241 | -c "found session_ticket extension" \ |
| 3242 | -c "parse new session ticket" \ |
| 3243 | -S "session successfully restored from cache" \ |
| 3244 | -s "session successfully restored from ticket" \ |
| 3245 | -s "a session has been resumed" \ |
| 3246 | -c "a session has been resumed" |
| 3247 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3248 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 3249 | "$O_SRV -dtls1" \ |
| 3250 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 3251 | 0 \ |
| 3252 | -c "client hello, adding session ticket extension" \ |
| 3253 | -c "found session_ticket extension" \ |
| 3254 | -c "parse new session ticket" \ |
| 3255 | -c "a session has been resumed" |
| 3256 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3257 | # 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] | 3258 | # 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] | 3259 | requires_openssl_next |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3260 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 3261 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3262 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3263 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3264 | rm -f $SESSION )" \ |
| 3265 | 0 \ |
| 3266 | -s "found session ticket extension" \ |
| 3267 | -s "server hello, adding session ticket extension" \ |
| 3268 | -S "session successfully restored from cache" \ |
| 3269 | -s "session successfully restored from ticket" \ |
| 3270 | -s "a session has been resumed" |
| 3271 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3272 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3273 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3274 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3275 | "$P_SRV debug_level=3 tickets=0" \ |
| 3276 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3277 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3278 | -c "client hello, adding session ticket extension" \ |
| 3279 | -s "found session ticket extension" \ |
| 3280 | -S "server hello, adding session ticket extension" \ |
| 3281 | -C "found session_ticket extension" \ |
| 3282 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3283 | -s "session successfully restored from cache" \ |
| 3284 | -S "session successfully restored from ticket" \ |
| 3285 | -s "a session has been resumed" \ |
| 3286 | -c "a session has been resumed" |
| 3287 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3288 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3289 | "$P_SRV debug_level=3 tickets=1" \ |
| 3290 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3291 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3292 | -C "client hello, adding session ticket extension" \ |
| 3293 | -S "found session ticket extension" \ |
| 3294 | -S "server hello, adding session ticket extension" \ |
| 3295 | -C "found session_ticket extension" \ |
| 3296 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 3297 | -s "session successfully restored from cache" \ |
| 3298 | -S "session successfully restored from ticket" \ |
| 3299 | -s "a session has been resumed" \ |
| 3300 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3301 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3302 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3303 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 3304 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3305 | 0 \ |
| 3306 | -S "session successfully restored from cache" \ |
| 3307 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3308 | -S "a session has been resumed" \ |
| 3309 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 3310 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3311 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3312 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3313 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 3314 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 3315 | 0 \ |
| 3316 | -s "session successfully restored from cache" \ |
| 3317 | -S "session successfully restored from ticket" \ |
| 3318 | -s "a session has been resumed" \ |
| 3319 | -c "a session has been resumed" |
| 3320 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3321 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 3322 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3323 | "$P_SRV debug_level=3 tickets=0" \ |
| 3324 | "$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] | 3325 | 0 \ |
| 3326 | -s "session successfully restored from cache" \ |
| 3327 | -S "session successfully restored from ticket" \ |
| 3328 | -s "a session has been resumed" \ |
| 3329 | -c "a session has been resumed" |
| 3330 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3331 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3332 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3333 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 3334 | "$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] | 3335 | 0 \ |
| 3336 | -S "session successfully restored from cache" \ |
| 3337 | -S "session successfully restored from ticket" \ |
| 3338 | -S "a session has been resumed" \ |
| 3339 | -C "a session has been resumed" |
| 3340 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3341 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3342 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3343 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 3344 | "$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] | 3345 | 0 \ |
| 3346 | -s "session successfully restored from cache" \ |
| 3347 | -S "session successfully restored from ticket" \ |
| 3348 | -s "a session has been resumed" \ |
| 3349 | -c "a session has been resumed" |
| 3350 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3351 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3352 | run_test "Session resume using cache: session copy" \ |
| 3353 | "$P_SRV debug_level=3 tickets=0" \ |
| 3354 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 3355 | 0 \ |
| 3356 | -s "session successfully restored from cache" \ |
| 3357 | -S "session successfully restored from ticket" \ |
| 3358 | -s "a session has been resumed" \ |
| 3359 | -c "a session has been resumed" |
| 3360 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3361 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3362 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3363 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 3364 | "( $O_CLI -sess_out $SESSION; \ |
| 3365 | $O_CLI -sess_in $SESSION; \ |
| 3366 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3367 | 0 \ |
| 3368 | -s "found session ticket extension" \ |
| 3369 | -S "server hello, adding session ticket extension" \ |
| 3370 | -s "session successfully restored from cache" \ |
| 3371 | -S "session successfully restored from ticket" \ |
| 3372 | -s "a session has been resumed" |
| 3373 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3374 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3375 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 3376 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3377 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 3378 | 0 \ |
| 3379 | -C "found session_ticket extension" \ |
| 3380 | -C "parse new session ticket" \ |
| 3381 | -c "a session has been resumed" |
| 3382 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3383 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 3384 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3385 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3386 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 3387 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3388 | "$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] | 3389 | 0 \ |
| 3390 | -c "client hello, adding session ticket extension" \ |
| 3391 | -s "found session ticket extension" \ |
| 3392 | -S "server hello, adding session ticket extension" \ |
| 3393 | -C "found session_ticket extension" \ |
| 3394 | -C "parse new session ticket" \ |
| 3395 | -s "session successfully restored from cache" \ |
| 3396 | -S "session successfully restored from ticket" \ |
| 3397 | -s "a session has been resumed" \ |
| 3398 | -c "a session has been resumed" |
| 3399 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3400 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3401 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 3402 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3403 | "$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] | 3404 | 0 \ |
| 3405 | -C "client hello, adding session ticket extension" \ |
| 3406 | -S "found session ticket extension" \ |
| 3407 | -S "server hello, adding session ticket extension" \ |
| 3408 | -C "found session_ticket extension" \ |
| 3409 | -C "parse new session ticket" \ |
| 3410 | -s "session successfully restored from cache" \ |
| 3411 | -S "session successfully restored from ticket" \ |
| 3412 | -s "a session has been resumed" \ |
| 3413 | -c "a session has been resumed" |
| 3414 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3415 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3416 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 3417 | "$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] | 3418 | "$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] | 3419 | 0 \ |
| 3420 | -S "session successfully restored from cache" \ |
| 3421 | -S "session successfully restored from ticket" \ |
| 3422 | -S "a session has been resumed" \ |
| 3423 | -C "a session has been resumed" |
| 3424 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3425 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3426 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 3427 | "$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] | 3428 | "$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] | 3429 | 0 \ |
| 3430 | -s "session successfully restored from cache" \ |
| 3431 | -S "session successfully restored from ticket" \ |
| 3432 | -s "a session has been resumed" \ |
| 3433 | -c "a session has been resumed" |
| 3434 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3435 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3436 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 3437 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3438 | "$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] | 3439 | 0 \ |
| 3440 | -s "session successfully restored from cache" \ |
| 3441 | -S "session successfully restored from ticket" \ |
| 3442 | -s "a session has been resumed" \ |
| 3443 | -c "a session has been resumed" |
| 3444 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3445 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3446 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 3447 | "$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] | 3448 | "$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] | 3449 | 0 \ |
| 3450 | -S "session successfully restored from cache" \ |
| 3451 | -S "session successfully restored from ticket" \ |
| 3452 | -S "a session has been resumed" \ |
| 3453 | -C "a session has been resumed" |
| 3454 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3455 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3456 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 3457 | "$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] | 3458 | "$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] | 3459 | 0 \ |
| 3460 | -s "session successfully restored from cache" \ |
| 3461 | -S "session successfully restored from ticket" \ |
| 3462 | -s "a session has been resumed" \ |
| 3463 | -c "a session has been resumed" |
| 3464 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3465 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3466 | run_test "Session resume using cache, DTLS: session copy" \ |
| 3467 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3468 | "$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] | 3469 | 0 \ |
| 3470 | -s "session successfully restored from cache" \ |
| 3471 | -S "session successfully restored from ticket" \ |
| 3472 | -s "a session has been resumed" \ |
| 3473 | -c "a session has been resumed" |
| 3474 | |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3475 | # 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] | 3476 | # 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] | 3477 | requires_openssl_next |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3478 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3479 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 3480 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d76c47d | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 3481 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 3482 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3483 | rm -f $SESSION )" \ |
| 3484 | 0 \ |
| 3485 | -s "found session ticket extension" \ |
| 3486 | -S "server hello, adding session ticket extension" \ |
| 3487 | -s "session successfully restored from cache" \ |
| 3488 | -S "session successfully restored from ticket" \ |
| 3489 | -s "a session has been resumed" |
| 3490 | |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 3491 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3492 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 3493 | "$O_SRV -dtls1" \ |
| 3494 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 3495 | 0 \ |
| 3496 | -C "found session_ticket extension" \ |
| 3497 | -C "parse new session ticket" \ |
| 3498 | -c "a session has been resumed" |
| 3499 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3500 | # Tests for Max Fragment Length extension |
| 3501 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3502 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3503 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3504 | "$P_SRV debug_level=3" \ |
| 3505 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3506 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3507 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3508 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3509 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3510 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3511 | -C "client hello, adding max_fragment_length extension" \ |
| 3512 | -S "found max fragment length extension" \ |
| 3513 | -S "server hello, max_fragment_length extension" \ |
| 3514 | -C "found max_fragment_length extension" |
| 3515 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3516 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3517 | run_test "Max fragment length: enabled, default, larger message" \ |
| 3518 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3519 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3520 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3521 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3522 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3523 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3524 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3525 | -C "client hello, adding max_fragment_length extension" \ |
| 3526 | -S "found max fragment length extension" \ |
| 3527 | -S "server hello, max_fragment_length extension" \ |
| 3528 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3529 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3530 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3531 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3532 | |
| 3533 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3534 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3535 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3536 | "$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] | 3537 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3538 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3539 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3540 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3541 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3542 | -C "client hello, adding max_fragment_length extension" \ |
| 3543 | -S "found max fragment length extension" \ |
| 3544 | -S "server hello, max_fragment_length extension" \ |
| 3545 | -C "found max_fragment_length extension" \ |
| 3546 | -c "fragment larger than.*maximum " |
| 3547 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3548 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3549 | # (session fragment length will be 16384 regardless of mbedtls |
| 3550 | # content length configuration.) |
| 3551 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3552 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3553 | run_test "Max fragment length: disabled, larger message" \ |
| 3554 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3555 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3556 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3557 | -C "Maximum input fragment length is 16384" \ |
| 3558 | -C "Maximum output fragment length is 16384" \ |
| 3559 | -S "Maximum input fragment length is 16384" \ |
| 3560 | -S "Maximum output fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3561 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3562 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3563 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3564 | |
| 3565 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 18ddccc | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3566 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3567 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3568 | "$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] | 3569 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3570 | -C "Maximum input fragment length is 16384" \ |
| 3571 | -C "Maximum output fragment length is 16384" \ |
| 3572 | -S "Maximum input fragment length is 16384" \ |
| 3573 | -S "Maximum output fragment length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3574 | -c "fragment larger than.*maximum " |
| 3575 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3576 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3577 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3578 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3579 | "$P_SRV debug_level=3" \ |
| 3580 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3581 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3582 | -c "Maximum input fragment length is 4096" \ |
| 3583 | -c "Maximum output fragment length is 4096" \ |
| 3584 | -s "Maximum input fragment length is 4096" \ |
| 3585 | -s "Maximum output fragment length is 4096" \ |
| 3586 | -c "client hello, adding max_fragment_length extension" \ |
| 3587 | -s "found max fragment length extension" \ |
| 3588 | -s "server hello, max_fragment_length extension" \ |
| 3589 | -c "found max_fragment_length extension" |
| 3590 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3591 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3592 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3593 | run_test "Max fragment length: client 512, server 1024" \ |
| 3594 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3595 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3596 | 0 \ |
| 3597 | -c "Maximum input fragment length is 512" \ |
| 3598 | -c "Maximum output fragment length is 512" \ |
| 3599 | -s "Maximum input fragment length is 512" \ |
| 3600 | -s "Maximum output fragment length is 512" \ |
| 3601 | -c "client hello, adding max_fragment_length extension" \ |
| 3602 | -s "found max fragment length extension" \ |
| 3603 | -s "server hello, max_fragment_length extension" \ |
| 3604 | -c "found max_fragment_length extension" |
| 3605 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3606 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3607 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3608 | run_test "Max fragment length: client 512, server 2048" \ |
| 3609 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3610 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3611 | 0 \ |
| 3612 | -c "Maximum input fragment length is 512" \ |
| 3613 | -c "Maximum output fragment length is 512" \ |
| 3614 | -s "Maximum input fragment length is 512" \ |
| 3615 | -s "Maximum output fragment length is 512" \ |
| 3616 | -c "client hello, adding max_fragment_length extension" \ |
| 3617 | -s "found max fragment length extension" \ |
| 3618 | -s "server hello, max_fragment_length extension" \ |
| 3619 | -c "found max_fragment_length extension" |
| 3620 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3621 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3622 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3623 | run_test "Max fragment length: client 512, server 4096" \ |
| 3624 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3625 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3626 | 0 \ |
| 3627 | -c "Maximum input fragment length is 512" \ |
| 3628 | -c "Maximum output fragment length is 512" \ |
| 3629 | -s "Maximum input fragment length is 512" \ |
| 3630 | -s "Maximum output fragment length is 512" \ |
| 3631 | -c "client hello, adding max_fragment_length extension" \ |
| 3632 | -s "found max fragment length extension" \ |
| 3633 | -s "server hello, max_fragment_length extension" \ |
| 3634 | -c "found max_fragment_length extension" |
| 3635 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3636 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3637 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3638 | run_test "Max fragment length: client 1024, server 512" \ |
| 3639 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3640 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3641 | 0 \ |
| 3642 | -c "Maximum input fragment length is 1024" \ |
| 3643 | -c "Maximum output fragment length is 1024" \ |
| 3644 | -s "Maximum input fragment length is 1024" \ |
| 3645 | -s "Maximum output fragment length is 512" \ |
| 3646 | -c "client hello, adding max_fragment_length extension" \ |
| 3647 | -s "found max fragment length extension" \ |
| 3648 | -s "server hello, max_fragment_length extension" \ |
| 3649 | -c "found max_fragment_length extension" |
| 3650 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3651 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3652 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3653 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3654 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3655 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3656 | 0 \ |
| 3657 | -c "Maximum input fragment length is 1024" \ |
| 3658 | -c "Maximum output fragment length is 1024" \ |
| 3659 | -s "Maximum input fragment length is 1024" \ |
| 3660 | -s "Maximum output fragment length is 1024" \ |
| 3661 | -c "client hello, adding max_fragment_length extension" \ |
| 3662 | -s "found max fragment length extension" \ |
| 3663 | -s "server hello, max_fragment_length extension" \ |
| 3664 | -c "found max_fragment_length extension" |
| 3665 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3666 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3667 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3668 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3669 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3670 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3671 | 0 \ |
| 3672 | -c "Maximum input fragment length is 1024" \ |
| 3673 | -c "Maximum output fragment length is 1024" \ |
| 3674 | -s "Maximum input fragment length is 1024" \ |
| 3675 | -s "Maximum output fragment length is 1024" \ |
| 3676 | -c "client hello, adding max_fragment_length extension" \ |
| 3677 | -s "found max fragment length extension" \ |
| 3678 | -s "server hello, max_fragment_length extension" \ |
| 3679 | -c "found max_fragment_length extension" |
| 3680 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3681 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3682 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3683 | run_test "Max fragment length: client 2048, server 512" \ |
| 3684 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3685 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3686 | 0 \ |
| 3687 | -c "Maximum input fragment length is 2048" \ |
| 3688 | -c "Maximum output fragment length is 2048" \ |
| 3689 | -s "Maximum input fragment length is 2048" \ |
| 3690 | -s "Maximum output fragment length is 512" \ |
| 3691 | -c "client hello, adding max_fragment_length extension" \ |
| 3692 | -s "found max fragment length extension" \ |
| 3693 | -s "server hello, max_fragment_length extension" \ |
| 3694 | -c "found max_fragment_length extension" |
| 3695 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3696 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3697 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3698 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3699 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3700 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3701 | 0 \ |
| 3702 | -c "Maximum input fragment length is 2048" \ |
| 3703 | -c "Maximum output fragment length is 2048" \ |
| 3704 | -s "Maximum input fragment length is 2048" \ |
| 3705 | -s "Maximum output fragment length is 1024" \ |
| 3706 | -c "client hello, adding max_fragment_length extension" \ |
| 3707 | -s "found max fragment length extension" \ |
| 3708 | -s "server hello, max_fragment_length extension" \ |
| 3709 | -c "found max_fragment_length extension" |
| 3710 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3711 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3712 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3713 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3714 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3715 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3716 | 0 \ |
| 3717 | -c "Maximum input fragment length is 2048" \ |
| 3718 | -c "Maximum output fragment length is 2048" \ |
| 3719 | -s "Maximum input fragment length is 2048" \ |
| 3720 | -s "Maximum output fragment length is 2048" \ |
| 3721 | -c "client hello, adding max_fragment_length extension" \ |
| 3722 | -s "found max fragment length extension" \ |
| 3723 | -s "server hello, max_fragment_length extension" \ |
| 3724 | -c "found max_fragment_length extension" |
| 3725 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3726 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3727 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3728 | run_test "Max fragment length: client 4096, server 512" \ |
| 3729 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3730 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3731 | 0 \ |
| 3732 | -c "Maximum input fragment length is 4096" \ |
| 3733 | -c "Maximum output fragment length is 4096" \ |
| 3734 | -s "Maximum input fragment length is 4096" \ |
| 3735 | -s "Maximum output fragment length is 512" \ |
| 3736 | -c "client hello, adding max_fragment_length extension" \ |
| 3737 | -s "found max fragment length extension" \ |
| 3738 | -s "server hello, max_fragment_length extension" \ |
| 3739 | -c "found max_fragment_length extension" |
| 3740 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3741 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3742 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3743 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3744 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3745 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3746 | 0 \ |
| 3747 | -c "Maximum input fragment length is 4096" \ |
| 3748 | -c "Maximum output fragment length is 4096" \ |
| 3749 | -s "Maximum input fragment length is 4096" \ |
| 3750 | -s "Maximum output fragment length is 1024" \ |
| 3751 | -c "client hello, adding max_fragment_length extension" \ |
| 3752 | -s "found max fragment length extension" \ |
| 3753 | -s "server hello, max_fragment_length extension" \ |
| 3754 | -c "found max_fragment_length extension" |
| 3755 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3756 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3757 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3758 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3759 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3760 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3761 | 0 \ |
| 3762 | -c "Maximum input fragment length is 4096" \ |
| 3763 | -c "Maximum output fragment length is 4096" \ |
| 3764 | -s "Maximum input fragment length is 4096" \ |
| 3765 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3766 | -c "client hello, adding max_fragment_length extension" \ |
| 3767 | -s "found max fragment length extension" \ |
| 3768 | -s "server hello, max_fragment_length extension" \ |
| 3769 | -c "found max_fragment_length extension" |
| 3770 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3771 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3772 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3773 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3774 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3775 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3776 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3777 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3778 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ |
| 3779 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ |
| 3780 | -s "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3781 | -C "client hello, adding max_fragment_length extension" \ |
| 3782 | -S "found max fragment length extension" \ |
| 3783 | -S "server hello, max_fragment_length extension" \ |
| 3784 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3785 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3786 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3787 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3788 | requires_gnutls |
| 3789 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3790 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3791 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3792 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3793 | -c "Maximum input fragment length is 4096" \ |
| 3794 | -c "Maximum output fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3795 | -c "client hello, adding max_fragment_length extension" \ |
| 3796 | -c "found max_fragment_length extension" |
| 3797 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3798 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3799 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3800 | run_test "Max fragment length: client, message just fits" \ |
| 3801 | "$P_SRV debug_level=3" \ |
| 3802 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3803 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3804 | -c "Maximum input fragment length is 2048" \ |
| 3805 | -c "Maximum output fragment length is 2048" \ |
| 3806 | -s "Maximum input fragment length is 2048" \ |
| 3807 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3808 | -c "client hello, adding max_fragment_length extension" \ |
| 3809 | -s "found max fragment length extension" \ |
| 3810 | -s "server hello, max_fragment_length extension" \ |
| 3811 | -c "found max_fragment_length extension" \ |
| 3812 | -c "2048 bytes written in 1 fragments" \ |
| 3813 | -s "2048 bytes read" |
| 3814 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3815 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3816 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3817 | run_test "Max fragment length: client, larger message" \ |
| 3818 | "$P_SRV debug_level=3" \ |
| 3819 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3820 | 0 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3821 | -c "Maximum input fragment length is 2048" \ |
| 3822 | -c "Maximum output fragment length is 2048" \ |
| 3823 | -s "Maximum input fragment length is 2048" \ |
| 3824 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3825 | -c "client hello, adding max_fragment_length extension" \ |
| 3826 | -s "found max fragment length extension" \ |
| 3827 | -s "server hello, max_fragment_length extension" \ |
| 3828 | -c "found max_fragment_length extension" \ |
| 3829 | -c "2345 bytes written in 2 fragments" \ |
| 3830 | -s "2048 bytes read" \ |
| 3831 | -s "297 bytes read" |
| 3832 | |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3833 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3834 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3835 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3836 | "$P_SRV debug_level=3 dtls=1" \ |
| 3837 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3838 | 1 \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3839 | -c "Maximum input fragment length is 2048" \ |
| 3840 | -c "Maximum output fragment length is 2048" \ |
| 3841 | -s "Maximum input fragment length is 2048" \ |
| 3842 | -s "Maximum output fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3843 | -c "client hello, adding max_fragment_length extension" \ |
| 3844 | -s "found max fragment length extension" \ |
| 3845 | -s "server hello, max_fragment_length extension" \ |
| 3846 | -c "found max_fragment_length extension" \ |
| 3847 | -c "fragment larger than.*maximum" |
| 3848 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3849 | # Tests for renegotiation |
| 3850 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3851 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3852 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3853 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3854 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3855 | 0 \ |
| 3856 | -C "client hello, adding renegotiation extension" \ |
| 3857 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3858 | -S "found renegotiation extension" \ |
| 3859 | -s "server hello, secure renegotiation extension" \ |
| 3860 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3861 | -C "=> renegotiate" \ |
| 3862 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3863 | -S "write hello request" |
| 3864 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3865 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3866 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3867 | "$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] | 3868 | "$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] | 3869 | 0 \ |
| 3870 | -c "client hello, adding renegotiation extension" \ |
| 3871 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3872 | -s "found renegotiation extension" \ |
| 3873 | -s "server hello, secure renegotiation extension" \ |
| 3874 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3875 | -c "=> renegotiate" \ |
| 3876 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3877 | -S "write hello request" |
| 3878 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3879 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3880 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3881 | "$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] | 3882 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3883 | 0 \ |
| 3884 | -c "client hello, adding renegotiation extension" \ |
| 3885 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3886 | -s "found renegotiation extension" \ |
| 3887 | -s "server hello, secure renegotiation extension" \ |
| 3888 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3889 | -c "=> renegotiate" \ |
| 3890 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3891 | -s "write hello request" |
| 3892 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3893 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3894 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3895 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3896 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3897 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3898 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3899 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3900 | 0 \ |
| 3901 | -c "client hello, adding renegotiation extension" \ |
| 3902 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3903 | -s "found renegotiation extension" \ |
| 3904 | -s "server hello, secure renegotiation extension" \ |
| 3905 | -c "found renegotiation extension" \ |
| 3906 | -c "=> renegotiate" \ |
| 3907 | -s "=> renegotiate" \ |
| 3908 | -S "write hello request" \ |
| 3909 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3910 | |
| 3911 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3912 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3913 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3914 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3915 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3916 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3917 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3918 | 0 \ |
| 3919 | -c "client hello, adding renegotiation extension" \ |
| 3920 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3921 | -s "found renegotiation extension" \ |
| 3922 | -s "server hello, secure renegotiation extension" \ |
| 3923 | -c "found renegotiation extension" \ |
| 3924 | -c "=> renegotiate" \ |
| 3925 | -s "=> renegotiate" \ |
| 3926 | -s "write hello request" \ |
| 3927 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3928 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3929 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3930 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3931 | "$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] | 3932 | "$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] | 3933 | 0 \ |
| 3934 | -c "client hello, adding renegotiation extension" \ |
| 3935 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3936 | -s "found renegotiation extension" \ |
| 3937 | -s "server hello, secure renegotiation extension" \ |
| 3938 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3939 | -c "=> renegotiate" \ |
| 3940 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3941 | -s "write hello request" |
| 3942 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3943 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3944 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bec7cf7 | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3945 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3946 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3947 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3948 | "$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" \ |
| 3949 | 0 \ |
| 3950 | -c "Maximum input fragment length is 2048" \ |
| 3951 | -c "Maximum output fragment length is 2048" \ |
| 3952 | -s "Maximum input fragment length is 2048" \ |
| 3953 | -s "Maximum output fragment length is 512" \ |
| 3954 | -c "client hello, adding max_fragment_length extension" \ |
| 3955 | -s "found max fragment length extension" \ |
| 3956 | -s "server hello, max_fragment_length extension" \ |
| 3957 | -c "found max_fragment_length extension" \ |
| 3958 | -c "client hello, adding renegotiation extension" \ |
| 3959 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3960 | -s "found renegotiation extension" \ |
| 3961 | -s "server hello, secure renegotiation extension" \ |
| 3962 | -c "found renegotiation extension" \ |
| 3963 | -c "=> renegotiate" \ |
| 3964 | -s "=> renegotiate" \ |
| 3965 | -s "write hello request" |
| 3966 | |
| 3967 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3968 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3969 | "$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] | 3970 | "$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] | 3971 | 1 \ |
| 3972 | -c "client hello, adding renegotiation extension" \ |
| 3973 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3974 | -S "found renegotiation extension" \ |
| 3975 | -s "server hello, secure renegotiation extension" \ |
| 3976 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3977 | -c "=> renegotiate" \ |
| 3978 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3979 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3980 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3981 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3982 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3983 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3984 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3985 | "$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] | 3986 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3987 | 0 \ |
| 3988 | -C "client hello, adding renegotiation extension" \ |
| 3989 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3990 | -S "found renegotiation extension" \ |
| 3991 | -s "server hello, secure renegotiation extension" \ |
| 3992 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3993 | -C "=> renegotiate" \ |
| 3994 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3995 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3996 | -S "SSL - An unexpected message was received from our peer" \ |
| 3997 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3998 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3999 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4000 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4001 | "$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] | 4002 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4003 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4004 | 0 \ |
| 4005 | -C "client hello, adding renegotiation extension" \ |
| 4006 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4007 | -S "found renegotiation extension" \ |
| 4008 | -s "server hello, secure renegotiation extension" \ |
| 4009 | -c "found renegotiation extension" \ |
| 4010 | -C "=> renegotiate" \ |
| 4011 | -S "=> renegotiate" \ |
| 4012 | -s "write hello request" \ |
| 4013 | -S "SSL - An unexpected message was received from our peer" \ |
| 4014 | -S "failed" |
| 4015 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4016 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4017 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4018 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4019 | "$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] | 4020 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4021 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4022 | 0 \ |
| 4023 | -C "client hello, adding renegotiation extension" \ |
| 4024 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4025 | -S "found renegotiation extension" \ |
| 4026 | -s "server hello, secure renegotiation extension" \ |
| 4027 | -c "found renegotiation extension" \ |
| 4028 | -C "=> renegotiate" \ |
| 4029 | -S "=> renegotiate" \ |
| 4030 | -s "write hello request" \ |
| 4031 | -S "SSL - An unexpected message was received from our peer" \ |
| 4032 | -S "failed" |
| 4033 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4034 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4035 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4036 | "$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] | 4037 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4038 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4039 | 0 \ |
| 4040 | -C "client hello, adding renegotiation extension" \ |
| 4041 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4042 | -S "found renegotiation extension" \ |
| 4043 | -s "server hello, secure renegotiation extension" \ |
| 4044 | -c "found renegotiation extension" \ |
| 4045 | -C "=> renegotiate" \ |
| 4046 | -S "=> renegotiate" \ |
| 4047 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 4048 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4049 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4050 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4051 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4052 | "$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] | 4053 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4054 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 4055 | 0 \ |
| 4056 | -c "client hello, adding renegotiation extension" \ |
| 4057 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4058 | -s "found renegotiation extension" \ |
| 4059 | -s "server hello, secure renegotiation extension" \ |
| 4060 | -c "found renegotiation extension" \ |
| 4061 | -c "=> renegotiate" \ |
| 4062 | -s "=> renegotiate" \ |
| 4063 | -s "write hello request" \ |
| 4064 | -S "SSL - An unexpected message was received from our peer" \ |
| 4065 | -S "failed" |
| 4066 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4067 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4068 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4069 | "$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] | 4070 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 4071 | 0 \ |
| 4072 | -C "client hello, adding renegotiation extension" \ |
| 4073 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4074 | -S "found renegotiation extension" \ |
| 4075 | -s "server hello, secure renegotiation extension" \ |
| 4076 | -c "found renegotiation extension" \ |
| 4077 | -S "record counter limit reached: renegotiate" \ |
| 4078 | -C "=> renegotiate" \ |
| 4079 | -S "=> renegotiate" \ |
| 4080 | -S "write hello request" \ |
| 4081 | -S "SSL - An unexpected message was received from our peer" \ |
| 4082 | -S "failed" |
| 4083 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 4084 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4085 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4086 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4087 | "$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] | 4088 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4089 | 0 \ |
| 4090 | -c "client hello, adding renegotiation extension" \ |
| 4091 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4092 | -s "found renegotiation extension" \ |
| 4093 | -s "server hello, secure renegotiation extension" \ |
| 4094 | -c "found renegotiation extension" \ |
| 4095 | -s "record counter limit reached: renegotiate" \ |
| 4096 | -c "=> renegotiate" \ |
| 4097 | -s "=> renegotiate" \ |
| 4098 | -s "write hello request" \ |
| 4099 | -S "SSL - An unexpected message was received from our peer" \ |
| 4100 | -S "failed" |
| 4101 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4102 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4103 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4104 | "$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] | 4105 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4106 | 0 \ |
| 4107 | -c "client hello, adding renegotiation extension" \ |
| 4108 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4109 | -s "found renegotiation extension" \ |
| 4110 | -s "server hello, secure renegotiation extension" \ |
| 4111 | -c "found renegotiation extension" \ |
| 4112 | -s "record counter limit reached: renegotiate" \ |
| 4113 | -c "=> renegotiate" \ |
| 4114 | -s "=> renegotiate" \ |
| 4115 | -s "write hello request" \ |
| 4116 | -S "SSL - An unexpected message was received from our peer" \ |
| 4117 | -S "failed" |
| 4118 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4119 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 4120 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4121 | "$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] | 4122 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 4123 | 0 \ |
| 4124 | -C "client hello, adding renegotiation extension" \ |
| 4125 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4126 | -S "found renegotiation extension" \ |
| 4127 | -s "server hello, secure renegotiation extension" \ |
| 4128 | -c "found renegotiation extension" \ |
| 4129 | -S "record counter limit reached: renegotiate" \ |
| 4130 | -C "=> renegotiate" \ |
| 4131 | -S "=> renegotiate" \ |
| 4132 | -S "write hello request" \ |
| 4133 | -S "SSL - An unexpected message was received from our peer" \ |
| 4134 | -S "failed" |
| 4135 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4136 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4137 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4138 | "$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] | 4139 | "$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] | 4140 | 0 \ |
| 4141 | -c "client hello, adding renegotiation extension" \ |
| 4142 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4143 | -s "found renegotiation extension" \ |
| 4144 | -s "server hello, secure renegotiation extension" \ |
| 4145 | -c "found renegotiation extension" \ |
| 4146 | -c "=> renegotiate" \ |
| 4147 | -s "=> renegotiate" \ |
| 4148 | -S "write hello request" |
| 4149 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4150 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4151 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 4152 | "$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] | 4153 | "$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] | 4154 | 0 \ |
| 4155 | -c "client hello, adding renegotiation extension" \ |
| 4156 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4157 | -s "found renegotiation extension" \ |
| 4158 | -s "server hello, secure renegotiation extension" \ |
| 4159 | -c "found renegotiation extension" \ |
| 4160 | -c "=> renegotiate" \ |
| 4161 | -s "=> renegotiate" \ |
| 4162 | -s "write hello request" |
| 4163 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4164 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4165 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 4166 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4167 | "$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] | 4168 | 0 \ |
| 4169 | -c "client hello, adding renegotiation extension" \ |
| 4170 | -c "found renegotiation extension" \ |
| 4171 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4172 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4173 | -C "error" \ |
| 4174 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4175 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4176 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4177 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4178 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 4179 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4180 | "$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] | 4181 | 0 \ |
| 4182 | -c "client hello, adding renegotiation extension" \ |
| 4183 | -c "found renegotiation extension" \ |
| 4184 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4185 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 4186 | -C "error" \ |
| 4187 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4188 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4189 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4190 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4191 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 4192 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4193 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4194 | 1 \ |
| 4195 | -c "client hello, adding renegotiation extension" \ |
| 4196 | -C "found renegotiation extension" \ |
| 4197 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4198 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4199 | -c "error" \ |
| 4200 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4201 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4202 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4203 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4204 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 4205 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4206 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4207 | allow_legacy=0" \ |
| 4208 | 1 \ |
| 4209 | -c "client hello, adding renegotiation extension" \ |
| 4210 | -C "found renegotiation extension" \ |
| 4211 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4212 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4213 | -c "error" \ |
| 4214 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4215 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4216 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4217 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4218 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 4219 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4220 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 4221 | allow_legacy=1" \ |
| 4222 | 0 \ |
| 4223 | -c "client hello, adding renegotiation extension" \ |
| 4224 | -C "found renegotiation extension" \ |
| 4225 | -c "=> renegotiate" \ |
| 4226 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4227 | -C "error" \ |
| 4228 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4229 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4230 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 4231 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 4232 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 4233 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 4234 | 0 \ |
| 4235 | -c "client hello, adding renegotiation extension" \ |
| 4236 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4237 | -s "found renegotiation extension" \ |
| 4238 | -s "server hello, secure renegotiation extension" \ |
| 4239 | -c "found renegotiation extension" \ |
| 4240 | -c "=> renegotiate" \ |
| 4241 | -s "=> renegotiate" \ |
| 4242 | -S "write hello request" |
| 4243 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4244 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4245 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 4246 | "$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] | 4247 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 4248 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 4249 | 0 \ |
| 4250 | -c "client hello, adding renegotiation extension" \ |
| 4251 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4252 | -s "found renegotiation extension" \ |
| 4253 | -s "server hello, secure renegotiation extension" \ |
| 4254 | -c "found renegotiation extension" \ |
| 4255 | -c "=> renegotiate" \ |
| 4256 | -s "=> renegotiate" \ |
| 4257 | -s "write hello request" |
| 4258 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4259 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4260 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 4261 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 4262 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 4263 | 0 \ |
| 4264 | -c "client hello, adding renegotiation extension" \ |
| 4265 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 4266 | -s "found renegotiation extension" \ |
| 4267 | -s "server hello, secure renegotiation extension" \ |
| 4268 | -s "record counter limit reached: renegotiate" \ |
| 4269 | -c "=> renegotiate" \ |
| 4270 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4271 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 4272 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 4273 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 4274 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4275 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 4276 | "$G_SRV -u --mtu 4096" \ |
| 4277 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 4278 | 0 \ |
| 4279 | -c "client hello, adding renegotiation extension" \ |
| 4280 | -c "found renegotiation extension" \ |
| 4281 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4282 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 4283 | -C "error" \ |
| 4284 | -s "Extra-header:" |
| 4285 | |
Shaun Case | 0e7791f | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 4286 | # Test for the "secure renegotiation" extension only (no actual renegotiation) |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4287 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4288 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4289 | run_test "Renego ext: gnutls server strict, client default" \ |
| 4290 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 4291 | "$P_CLI debug_level=3" \ |
| 4292 | 0 \ |
| 4293 | -c "found renegotiation extension" \ |
| 4294 | -C "error" \ |
| 4295 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4296 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4297 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4298 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 4299 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4300 | "$P_CLI debug_level=3" \ |
| 4301 | 0 \ |
| 4302 | -C "found renegotiation extension" \ |
| 4303 | -C "error" \ |
| 4304 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 4305 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4306 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4307 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 4308 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 4309 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 4310 | 1 \ |
| 4311 | -C "found renegotiation extension" \ |
| 4312 | -c "error" \ |
| 4313 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 4314 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4315 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4316 | run_test "Renego ext: gnutls client strict, server default" \ |
| 4317 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4318 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4319 | 0 \ |
| 4320 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4321 | -s "server hello, secure renegotiation extension" |
| 4322 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4323 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4324 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 4325 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4326 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4327 | 0 \ |
| 4328 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4329 | -S "server hello, secure renegotiation extension" |
| 4330 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 4331 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4332 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 4333 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4334 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 4335 | 1 \ |
| 4336 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 4337 | -S "server hello, secure renegotiation extension" |
| 4338 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4339 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 4340 | |
| 4341 | requires_gnutls |
| 4342 | run_test "DER format: no trailing bytes" \ |
| 4343 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 4344 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4345 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4346 | 0 \ |
| 4347 | -c "Handshake was completed" \ |
| 4348 | |
| 4349 | requires_gnutls |
| 4350 | run_test "DER format: with a trailing zero byte" \ |
| 4351 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 4352 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4353 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4354 | 0 \ |
| 4355 | -c "Handshake was completed" \ |
| 4356 | |
| 4357 | requires_gnutls |
| 4358 | run_test "DER format: with a trailing random byte" \ |
| 4359 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 4360 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4361 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4362 | 0 \ |
| 4363 | -c "Handshake was completed" \ |
| 4364 | |
| 4365 | requires_gnutls |
| 4366 | run_test "DER format: with 2 trailing random bytes" \ |
| 4367 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 4368 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4369 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4370 | 0 \ |
| 4371 | -c "Handshake was completed" \ |
| 4372 | |
| 4373 | requires_gnutls |
| 4374 | run_test "DER format: with 4 trailing random bytes" \ |
| 4375 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 4376 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4377 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4378 | 0 \ |
| 4379 | -c "Handshake was completed" \ |
| 4380 | |
| 4381 | requires_gnutls |
| 4382 | run_test "DER format: with 8 trailing random bytes" \ |
| 4383 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 4384 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4385 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4386 | 0 \ |
| 4387 | -c "Handshake was completed" \ |
| 4388 | |
| 4389 | requires_gnutls |
| 4390 | run_test "DER format: with 9 trailing random bytes" \ |
| 4391 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 4392 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4393 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 4394 | 0 \ |
| 4395 | -c "Handshake was completed" \ |
| 4396 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4397 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 4398 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4399 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4400 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4401 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4402 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4403 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4404 | 1 \ |
| 4405 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4406 | -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] | 4407 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4408 | -c "X509 - Certificate verification failed" |
| 4409 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4410 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4411 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4412 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4413 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4414 | 0 \ |
| 4415 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4416 | -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] | 4417 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4418 | -C "X509 - Certificate verification failed" |
| 4419 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 4420 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 4421 | "$P_SRV" \ |
| 4422 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 4423 | 0 \ |
| 4424 | -c "x509_verify_cert() returned" \ |
| 4425 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4426 | -c "! Certificate verification flags"\ |
| 4427 | -C "! mbedtls_ssl_handshake returned" \ |
| 4428 | -C "X509 - Certificate verification failed" \ |
| 4429 | -C "SSL - No CA Chain is set, but required to operate" |
| 4430 | |
| 4431 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 4432 | "$P_SRV" \ |
| 4433 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 4434 | 1 \ |
| 4435 | -c "x509_verify_cert() returned" \ |
| 4436 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4437 | -c "! Certificate verification flags"\ |
| 4438 | -c "! mbedtls_ssl_handshake returned" \ |
| 4439 | -c "SSL - No CA Chain is set, but required to operate" |
| 4440 | |
| 4441 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4442 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4443 | # the client informs the server about the supported curves - it does, though, in the |
| 4444 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4445 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4446 | # different means to have the server ignoring the client's supported curve list. |
| 4447 | |
| 4448 | requires_config_enabled MBEDTLS_ECP_C |
| 4449 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4450 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4451 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4452 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4453 | 1 \ |
| 4454 | -c "bad certificate (EC key curve)"\ |
| 4455 | -c "! Certificate verification flags"\ |
| 4456 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4457 | |
| 4458 | requires_config_enabled MBEDTLS_ECP_C |
| 4459 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4460 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4461 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4462 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4463 | 1 \ |
| 4464 | -c "bad certificate (EC key curve)"\ |
| 4465 | -c "! Certificate verification flags"\ |
| 4466 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4467 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4468 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4469 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4470 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4471 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4472 | 0 \ |
| 4473 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4474 | -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] | 4475 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4476 | -C "X509 - Certificate verification failed" |
| 4477 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4478 | run_test "Authentication: client SHA256, server required" \ |
| 4479 | "$P_SRV auth_mode=required" \ |
| 4480 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4481 | key_file=data_files/server6.key \ |
| 4482 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4483 | 0 \ |
| 4484 | -c "Supported Signature Algorithm found: 4," \ |
| 4485 | -c "Supported Signature Algorithm found: 5," |
| 4486 | |
| 4487 | run_test "Authentication: client SHA384, server required" \ |
| 4488 | "$P_SRV auth_mode=required" \ |
| 4489 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4490 | key_file=data_files/server6.key \ |
| 4491 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4492 | 0 \ |
| 4493 | -c "Supported Signature Algorithm found: 4," \ |
| 4494 | -c "Supported Signature Algorithm found: 5," |
| 4495 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4496 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 4497 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 4498 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 4499 | key_file=data_files/server5.key" \ |
| 4500 | 1 \ |
| 4501 | -S "skip write certificate request" \ |
| 4502 | -C "skip parse certificate request" \ |
| 4503 | -c "got a certificate request" \ |
| 4504 | -c "got no certificate to send" \ |
| 4505 | -S "x509_verify_cert() returned" \ |
| 4506 | -s "client has no certificate" \ |
| 4507 | -s "! mbedtls_ssl_handshake returned" \ |
| 4508 | -c "! mbedtls_ssl_handshake returned" \ |
| 4509 | -s "No client certification received from the client, but required by the authentication mode" |
| 4510 | |
| 4511 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 4512 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4513 | "$P_CLI debug_level=3 crt_file=none \ |
| 4514 | key_file=data_files/server5.key" \ |
| 4515 | 1 \ |
| 4516 | -S "skip write certificate request" \ |
| 4517 | -C "skip parse certificate request" \ |
| 4518 | -c "got a certificate request" \ |
| 4519 | -c "= write certificate$" \ |
| 4520 | -C "skip write certificate$" \ |
| 4521 | -S "x509_verify_cert() returned" \ |
| 4522 | -s "client has no certificate" \ |
| 4523 | -s "! mbedtls_ssl_handshake returned" \ |
| 4524 | -c "! mbedtls_ssl_handshake returned" \ |
| 4525 | -s "No client certification received from the client, but required by the authentication mode" |
| 4526 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4527 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4528 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4529 | "$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] | 4530 | key_file=data_files/server5.key" \ |
| 4531 | 1 \ |
| 4532 | -S "skip write certificate request" \ |
| 4533 | -C "skip parse certificate request" \ |
| 4534 | -c "got a certificate request" \ |
| 4535 | -C "skip write certificate" \ |
| 4536 | -C "skip write certificate verify" \ |
| 4537 | -S "skip parse certificate verify" \ |
| 4538 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4539 | -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] | 4540 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4541 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4542 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4543 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4544 | # We don't check that the client receives the alert because it might |
| 4545 | # detect that its write end of the connection is closed and abort |
| 4546 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4547 | |
Gilles Peskine | 8c681b7 | 2022-01-07 23:10:56 +0100 | [diff] [blame] | 4548 | run_test "Authentication: client cert self-signed and trusted, server required" \ |
| 4549 | "$P_SRV debug_level=3 auth_mode=required ca_file=data_files/server5-selfsigned.crt" \ |
| 4550 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4551 | key_file=data_files/server5.key" \ |
| 4552 | 0 \ |
| 4553 | -S "skip write certificate request" \ |
| 4554 | -C "skip parse certificate request" \ |
| 4555 | -c "got a certificate request" \ |
| 4556 | -C "skip write certificate" \ |
| 4557 | -C "skip write certificate verify" \ |
| 4558 | -S "skip parse certificate verify" \ |
| 4559 | -S "x509_verify_cert() returned" \ |
| 4560 | -S "! The certificate is not correctly signed" \ |
| 4561 | -S "X509 - Certificate verification failed" |
| 4562 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4563 | run_test "Authentication: client cert not trusted, server required" \ |
| 4564 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4565 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4566 | key_file=data_files/server5.key" \ |
| 4567 | 1 \ |
| 4568 | -S "skip write certificate request" \ |
| 4569 | -C "skip parse certificate request" \ |
| 4570 | -c "got a certificate request" \ |
| 4571 | -C "skip write certificate" \ |
| 4572 | -C "skip write certificate verify" \ |
| 4573 | -S "skip parse certificate verify" \ |
| 4574 | -s "x509_verify_cert() returned" \ |
| 4575 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4576 | -s "! mbedtls_ssl_handshake returned" \ |
| 4577 | -c "! mbedtls_ssl_handshake returned" \ |
| 4578 | -s "X509 - Certificate verification failed" |
| 4579 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4580 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4581 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4582 | "$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] | 4583 | key_file=data_files/server5.key" \ |
| 4584 | 0 \ |
| 4585 | -S "skip write certificate request" \ |
| 4586 | -C "skip parse certificate request" \ |
| 4587 | -c "got a certificate request" \ |
| 4588 | -C "skip write certificate" \ |
| 4589 | -C "skip write certificate verify" \ |
| 4590 | -S "skip parse certificate verify" \ |
| 4591 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4592 | -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] | 4593 | -S "! mbedtls_ssl_handshake returned" \ |
| 4594 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4595 | -S "X509 - Certificate verification failed" |
| 4596 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4597 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4598 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4599 | "$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] | 4600 | key_file=data_files/server5.key" \ |
| 4601 | 0 \ |
| 4602 | -s "skip write certificate request" \ |
| 4603 | -C "skip parse certificate request" \ |
| 4604 | -c "got no certificate request" \ |
| 4605 | -c "skip write certificate" \ |
| 4606 | -c "skip write certificate verify" \ |
| 4607 | -s "skip parse certificate verify" \ |
| 4608 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4609 | -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] | 4610 | -S "! mbedtls_ssl_handshake returned" \ |
| 4611 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4612 | -S "X509 - Certificate verification failed" |
| 4613 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4614 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4615 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4616 | "$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] | 4617 | 0 \ |
| 4618 | -S "skip write certificate request" \ |
| 4619 | -C "skip parse certificate request" \ |
| 4620 | -c "got a certificate request" \ |
| 4621 | -C "skip write certificate$" \ |
| 4622 | -C "got no certificate to send" \ |
| 4623 | -S "SSLv3 client has no certificate" \ |
| 4624 | -c "skip write certificate verify" \ |
| 4625 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4626 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4627 | -S "! mbedtls_ssl_handshake returned" \ |
| 4628 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4629 | -S "X509 - Certificate verification failed" |
| 4630 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4631 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4632 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4633 | "$O_CLI" \ |
| 4634 | 0 \ |
| 4635 | -S "skip write certificate request" \ |
| 4636 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4637 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4638 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4639 | -S "X509 - Certificate verification failed" |
| 4640 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4641 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4642 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4643 | "$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] | 4644 | 0 \ |
| 4645 | -C "skip parse certificate request" \ |
| 4646 | -c "got a certificate request" \ |
| 4647 | -C "skip write certificate$" \ |
| 4648 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4649 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4650 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4651 | run_test "Authentication: client no cert, openssl server required" \ |
| 4652 | "$O_SRV -Verify 10" \ |
| 4653 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4654 | 1 \ |
| 4655 | -C "skip parse certificate request" \ |
| 4656 | -c "got a certificate request" \ |
| 4657 | -C "skip write certificate$" \ |
| 4658 | -c "skip write certificate verify" \ |
| 4659 | -c "! mbedtls_ssl_handshake returned" |
| 4660 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4661 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4662 | "$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] | 4663 | "$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] | 4664 | 0 \ |
| 4665 | -S "skip write certificate request" \ |
| 4666 | -C "skip parse certificate request" \ |
| 4667 | -c "got a certificate request" \ |
| 4668 | -C "skip write certificate$" \ |
| 4669 | -c "skip write certificate verify" \ |
| 4670 | -c "got no certificate to send" \ |
| 4671 | -s "SSLv3 client has no certificate" \ |
| 4672 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4673 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4674 | -S "! mbedtls_ssl_handshake returned" \ |
| 4675 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4676 | -S "X509 - Certificate verification failed" |
| 4677 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4678 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4679 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4680 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4681 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4682 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4683 | |
Yuto Takano | ccdd25c | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4684 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4685 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4686 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4687 | # 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] | 4688 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4689 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4690 | run_test "Authentication: server max_int chain, client default" \ |
| 4691 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4692 | key_file=data_files/dir-maxpath/09.key" \ |
| 4693 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4694 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4695 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4696 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4697 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4698 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4699 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4700 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4701 | key_file=data_files/dir-maxpath/10.key" \ |
| 4702 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4703 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4704 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4705 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4706 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4707 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4708 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4709 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4710 | key_file=data_files/dir-maxpath/10.key" \ |
| 4711 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4712 | auth_mode=optional" \ |
| 4713 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4714 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4715 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4716 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4717 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4718 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4719 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4720 | key_file=data_files/dir-maxpath/10.key" \ |
| 4721 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4722 | auth_mode=none" \ |
| 4723 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4724 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4725 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4726 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4727 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4728 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4729 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4730 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4731 | key_file=data_files/dir-maxpath/10.key" \ |
| 4732 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4733 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 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 |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4736 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4737 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4738 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4739 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4740 | key_file=data_files/dir-maxpath/10.key" \ |
| 4741 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4742 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4743 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4744 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4745 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4746 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4747 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4748 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4749 | key_file=data_files/dir-maxpath/10.key" \ |
| 4750 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4751 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4752 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4753 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4754 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4755 | run_test "Authentication: client max_int chain, server required" \ |
| 4756 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4757 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4758 | key_file=data_files/dir-maxpath/09.key" \ |
| 4759 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4760 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4761 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4762 | # Tests for CA list in CertificateRequest messages |
| 4763 | |
| 4764 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4765 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4766 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4767 | key_file=data_files/server6.key" \ |
| 4768 | 0 \ |
| 4769 | -s "requested DN" |
| 4770 | |
| 4771 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4772 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4773 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4774 | key_file=data_files/server6.key" \ |
| 4775 | 0 \ |
| 4776 | -S "requested DN" |
| 4777 | |
| 4778 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4779 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4780 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4781 | key_file=data_files/server5.key" \ |
| 4782 | 1 \ |
| 4783 | -S "requested DN" \ |
| 4784 | -s "x509_verify_cert() returned" \ |
| 4785 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4786 | -s "! mbedtls_ssl_handshake returned" \ |
| 4787 | -c "! mbedtls_ssl_handshake returned" \ |
| 4788 | -s "X509 - Certificate verification failed" |
| 4789 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4790 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4791 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4792 | |
| 4793 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4794 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4795 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4796 | key_file=data_files/server5.key" \ |
| 4797 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4798 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4799 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4800 | -c "x509_verify_cert() returned" \ |
| 4801 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4802 | -c "! mbedtls_ssl_handshake returned" \ |
| 4803 | -c "X509 - Certificate verification failed" |
| 4804 | |
| 4805 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4806 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4807 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4808 | key_file=data_files/server5.key" \ |
| 4809 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4810 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4811 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4812 | -c "x509_verify_cert() returned" \ |
| 4813 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4814 | -C "! mbedtls_ssl_handshake returned" \ |
| 4815 | -C "X509 - Certificate verification failed" |
| 4816 | |
| 4817 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4818 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4819 | # the client informs the server about the supported curves - it does, though, in the |
| 4820 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4821 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4822 | # different means to have the server ignoring the client's supported curve list. |
| 4823 | |
| 4824 | requires_config_enabled MBEDTLS_ECP_C |
| 4825 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4826 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4827 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4828 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4829 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4830 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4831 | -c "use CA callback for X.509 CRT verification" \ |
| 4832 | -c "bad certificate (EC key curve)" \ |
| 4833 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4834 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4835 | |
| 4836 | requires_config_enabled MBEDTLS_ECP_C |
| 4837 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4838 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4839 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4840 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4841 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4842 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4843 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4844 | -c "bad certificate (EC key curve)"\ |
| 4845 | -c "! Certificate verification flags"\ |
| 4846 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4847 | |
| 4848 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4849 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4850 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4851 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4852 | key_file=data_files/server6.key \ |
| 4853 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4854 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4855 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4856 | -c "Supported Signature Algorithm found: 4," \ |
| 4857 | -c "Supported Signature Algorithm found: 5," |
| 4858 | |
| 4859 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4860 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4861 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4862 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4863 | key_file=data_files/server6.key \ |
| 4864 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4865 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4866 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4867 | -c "Supported Signature Algorithm found: 4," \ |
| 4868 | -c "Supported Signature Algorithm found: 5," |
| 4869 | |
| 4870 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4871 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4872 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4873 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4874 | key_file=data_files/server5.key" \ |
| 4875 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4876 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4877 | -S "skip write certificate request" \ |
| 4878 | -C "skip parse certificate request" \ |
| 4879 | -c "got a certificate request" \ |
| 4880 | -C "skip write certificate" \ |
| 4881 | -C "skip write certificate verify" \ |
| 4882 | -S "skip parse certificate verify" \ |
| 4883 | -s "x509_verify_cert() returned" \ |
| 4884 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4885 | -s "! mbedtls_ssl_handshake returned" \ |
| 4886 | -s "send alert level=2 message=48" \ |
| 4887 | -c "! mbedtls_ssl_handshake returned" \ |
| 4888 | -s "X509 - Certificate verification failed" |
| 4889 | # We don't check that the client receives the alert because it might |
| 4890 | # detect that its write end of the connection is closed and abort |
| 4891 | # before reading the alert message. |
| 4892 | |
| 4893 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4894 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4895 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4896 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4897 | key_file=data_files/server5.key" \ |
| 4898 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4899 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4900 | -S "skip write certificate request" \ |
| 4901 | -C "skip parse certificate request" \ |
| 4902 | -c "got a certificate request" \ |
| 4903 | -C "skip write certificate" \ |
| 4904 | -C "skip write certificate verify" \ |
| 4905 | -S "skip parse certificate verify" \ |
| 4906 | -s "x509_verify_cert() returned" \ |
| 4907 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4908 | -s "! mbedtls_ssl_handshake returned" \ |
| 4909 | -c "! mbedtls_ssl_handshake returned" \ |
| 4910 | -s "X509 - Certificate verification failed" |
| 4911 | |
| 4912 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4913 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4914 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4915 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4916 | key_file=data_files/server5.key" \ |
| 4917 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4918 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4919 | -S "skip write certificate request" \ |
| 4920 | -C "skip parse certificate request" \ |
| 4921 | -c "got a certificate request" \ |
| 4922 | -C "skip write certificate" \ |
| 4923 | -C "skip write certificate verify" \ |
| 4924 | -S "skip parse certificate verify" \ |
| 4925 | -s "x509_verify_cert() returned" \ |
| 4926 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4927 | -S "! mbedtls_ssl_handshake returned" \ |
| 4928 | -C "! mbedtls_ssl_handshake returned" \ |
| 4929 | -S "X509 - Certificate verification failed" |
| 4930 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4931 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4932 | requires_full_size_output_buffer |
| 4933 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4934 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4935 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4936 | key_file=data_files/dir-maxpath/09.key" \ |
| 4937 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4938 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4939 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4940 | -C "X509 - A fatal error occurred" |
| 4941 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4942 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4943 | requires_full_size_output_buffer |
| 4944 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4945 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4946 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4947 | key_file=data_files/dir-maxpath/10.key" \ |
| 4948 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4949 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4950 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4951 | -c "X509 - A fatal error occurred" |
| 4952 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4953 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4954 | requires_full_size_output_buffer |
| 4955 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4956 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4957 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4958 | key_file=data_files/dir-maxpath/10.key" \ |
| 4959 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4960 | debug_level=3 auth_mode=optional" \ |
| 4961 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4962 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4963 | -c "X509 - A fatal error occurred" |
| 4964 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4965 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4966 | requires_full_size_output_buffer |
| 4967 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4968 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4969 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4970 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4971 | key_file=data_files/dir-maxpath/10.key" \ |
| 4972 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4973 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4974 | -s "X509 - A fatal error occurred" |
| 4975 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4976 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4977 | requires_full_size_output_buffer |
| 4978 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4979 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4980 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4981 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4982 | key_file=data_files/dir-maxpath/10.key" \ |
| 4983 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4984 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4985 | -s "X509 - A fatal error occurred" |
| 4986 | |
Yuto Takano | 8a693ef | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4987 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4988 | requires_full_size_output_buffer |
| 4989 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4990 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4991 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4992 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4993 | key_file=data_files/dir-maxpath/09.key" \ |
| 4994 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4995 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4996 | -S "X509 - A fatal error occurred" |
| 4997 | |
Shaun Case | 0e7791f | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 4998 | # Tests for certificate selection based on SHA version |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4999 | |
| 5000 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 5001 | "$P_SRV crt_file=data_files/server5.crt \ |
| 5002 | key_file=data_files/server5.key \ |
| 5003 | crt_file2=data_files/server5-sha1.crt \ |
| 5004 | key_file2=data_files/server5.key" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5005 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 5006 | 0 \ |
| 5007 | -c "signed using.*ECDSA with SHA256" \ |
| 5008 | -C "signed using.*ECDSA with SHA1" |
| 5009 | |
| 5010 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 5011 | "$P_SRV crt_file=data_files/server5.crt \ |
| 5012 | key_file=data_files/server5.key \ |
| 5013 | crt_file2=data_files/server5-sha1.crt \ |
| 5014 | key_file2=data_files/server5.key" \ |
| 5015 | "$P_CLI force_version=tls1_1" \ |
| 5016 | 0 \ |
| 5017 | -C "signed using.*ECDSA with SHA256" \ |
| 5018 | -c "signed using.*ECDSA with SHA1" |
| 5019 | |
| 5020 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 5021 | "$P_SRV crt_file=data_files/server5.crt \ |
| 5022 | key_file=data_files/server5.key \ |
| 5023 | crt_file2=data_files/server5-sha1.crt \ |
| 5024 | key_file2=data_files/server5.key" \ |
| 5025 | "$P_CLI force_version=tls1" \ |
| 5026 | 0 \ |
| 5027 | -C "signed using.*ECDSA with SHA256" \ |
| 5028 | -c "signed using.*ECDSA with SHA1" |
| 5029 | |
| 5030 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 5031 | "$P_SRV crt_file=data_files/server5.crt \ |
| 5032 | key_file=data_files/server5.key \ |
| 5033 | crt_file2=data_files/server6.crt \ |
| 5034 | key_file2=data_files/server6.key" \ |
| 5035 | "$P_CLI force_version=tls1_1" \ |
| 5036 | 0 \ |
| 5037 | -c "serial number.*09" \ |
| 5038 | -c "signed using.*ECDSA with SHA256" \ |
| 5039 | -C "signed using.*ECDSA with SHA1" |
| 5040 | |
| 5041 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 5042 | "$P_SRV crt_file=data_files/server6.crt \ |
| 5043 | key_file=data_files/server6.key \ |
| 5044 | crt_file2=data_files/server5.crt \ |
| 5045 | key_file2=data_files/server5.key" \ |
| 5046 | "$P_CLI force_version=tls1_1" \ |
| 5047 | 0 \ |
| 5048 | -c "serial number.*0A" \ |
| 5049 | -c "signed using.*ECDSA with SHA256" \ |
| 5050 | -C "signed using.*ECDSA with SHA1" |
| 5051 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5052 | # tests for SNI |
| 5053 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5054 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5055 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5056 | 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] | 5057 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5058 | 0 \ |
| 5059 | -S "parse ServerName extension" \ |
| 5060 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5061 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5062 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5063 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5064 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5065 | 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] | 5066 | 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] | 5067 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5068 | 0 \ |
| 5069 | -s "parse ServerName extension" \ |
| 5070 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5071 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5072 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5073 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5074 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5075 | 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] | 5076 | 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] | 5077 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5078 | 0 \ |
| 5079 | -s "parse ServerName extension" \ |
| 5080 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5081 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5082 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5083 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5084 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 5085 | 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] | 5086 | 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] | 5087 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5088 | 1 \ |
| 5089 | -s "parse ServerName extension" \ |
| 5090 | -s "ssl_sni_wrapper() returned" \ |
| 5091 | -s "mbedtls_ssl_handshake returned" \ |
| 5092 | -c "mbedtls_ssl_handshake returned" \ |
| 5093 | -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] | 5094 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5095 | run_test "SNI: client auth no override: optional" \ |
| 5096 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5097 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5098 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5099 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5100 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5101 | -S "skip write certificate request" \ |
| 5102 | -C "skip parse certificate request" \ |
| 5103 | -c "got a certificate request" \ |
| 5104 | -C "skip write certificate" \ |
| 5105 | -C "skip write certificate verify" \ |
| 5106 | -S "skip parse certificate verify" |
| 5107 | |
| 5108 | run_test "SNI: client auth override: none -> optional" \ |
| 5109 | "$P_SRV debug_level=3 auth_mode=none \ |
| 5110 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5111 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5112 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5113 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5114 | -S "skip write certificate request" \ |
| 5115 | -C "skip parse certificate request" \ |
| 5116 | -c "got a certificate request" \ |
| 5117 | -C "skip write certificate" \ |
| 5118 | -C "skip write certificate verify" \ |
| 5119 | -S "skip parse certificate verify" |
| 5120 | |
| 5121 | run_test "SNI: client auth override: optional -> none" \ |
| 5122 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5123 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5124 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5125 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5126 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 5127 | -s "skip write certificate request" \ |
| 5128 | -C "skip parse certificate request" \ |
| 5129 | -c "got no certificate request" \ |
| 5130 | -c "skip write certificate" \ |
| 5131 | -c "skip write certificate verify" \ |
| 5132 | -s "skip parse certificate verify" |
| 5133 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 5134 | run_test "SNI: CA no override" \ |
| 5135 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5136 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5137 | ca_file=data_files/test-ca.crt \ |
| 5138 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5139 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5140 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5141 | 1 \ |
| 5142 | -S "skip write certificate request" \ |
| 5143 | -C "skip parse certificate request" \ |
| 5144 | -c "got a certificate request" \ |
| 5145 | -C "skip write certificate" \ |
| 5146 | -C "skip write certificate verify" \ |
| 5147 | -S "skip parse certificate verify" \ |
| 5148 | -s "x509_verify_cert() returned" \ |
| 5149 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5150 | -S "The certificate has been revoked (is on a CRL)" |
| 5151 | |
| 5152 | run_test "SNI: CA override" \ |
| 5153 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5154 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5155 | ca_file=data_files/test-ca.crt \ |
| 5156 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5157 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5158 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5159 | 0 \ |
| 5160 | -S "skip write certificate request" \ |
| 5161 | -C "skip parse certificate request" \ |
| 5162 | -c "got a certificate request" \ |
| 5163 | -C "skip write certificate" \ |
| 5164 | -C "skip write certificate verify" \ |
| 5165 | -S "skip parse certificate verify" \ |
| 5166 | -S "x509_verify_cert() returned" \ |
| 5167 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5168 | -S "The certificate has been revoked (is on a CRL)" |
| 5169 | |
| 5170 | run_test "SNI: CA override with CRL" \ |
| 5171 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5172 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5173 | ca_file=data_files/test-ca.crt \ |
| 5174 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5175 | "$P_CLI debug_level=3 server_name=localhost \ |
| 5176 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5177 | 1 \ |
| 5178 | -S "skip write certificate request" \ |
| 5179 | -C "skip parse certificate request" \ |
| 5180 | -c "got a certificate request" \ |
| 5181 | -C "skip write certificate" \ |
| 5182 | -C "skip write certificate verify" \ |
| 5183 | -S "skip parse certificate verify" \ |
| 5184 | -s "x509_verify_cert() returned" \ |
| 5185 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5186 | -s "The certificate has been revoked (is on a CRL)" |
| 5187 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5188 | # Tests for SNI and DTLS |
| 5189 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5190 | run_test "SNI: DTLS, no SNI callback" \ |
| 5191 | "$P_SRV debug_level=3 dtls=1 \ |
| 5192 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 5193 | "$P_CLI server_name=localhost dtls=1" \ |
| 5194 | 0 \ |
| 5195 | -S "parse ServerName extension" \ |
| 5196 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 5197 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5198 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5199 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5200 | "$P_SRV debug_level=3 dtls=1 \ |
| 5201 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5202 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5203 | "$P_CLI server_name=localhost dtls=1" \ |
| 5204 | 0 \ |
| 5205 | -s "parse ServerName extension" \ |
| 5206 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5207 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 5208 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 5209 | run_test "SNI: DTLS, matching cert 2" \ |
| 5210 | "$P_SRV debug_level=3 dtls=1 \ |
| 5211 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5212 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5213 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 5214 | 0 \ |
| 5215 | -s "parse ServerName extension" \ |
| 5216 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5217 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5218 | |
| 5219 | run_test "SNI: DTLS, no matching cert" \ |
| 5220 | "$P_SRV debug_level=3 dtls=1 \ |
| 5221 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5222 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5223 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 5224 | 1 \ |
| 5225 | -s "parse ServerName extension" \ |
| 5226 | -s "ssl_sni_wrapper() returned" \ |
| 5227 | -s "mbedtls_ssl_handshake returned" \ |
| 5228 | -c "mbedtls_ssl_handshake returned" \ |
| 5229 | -c "SSL - A fatal alert message was received from our peer" |
| 5230 | |
| 5231 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 5232 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5233 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5234 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 5235 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5236 | 0 \ |
| 5237 | -S "skip write certificate request" \ |
| 5238 | -C "skip parse certificate request" \ |
| 5239 | -c "got a certificate request" \ |
| 5240 | -C "skip write certificate" \ |
| 5241 | -C "skip write certificate verify" \ |
| 5242 | -S "skip parse certificate verify" |
| 5243 | |
| 5244 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 5245 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 5246 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5247 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 5248 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5249 | 0 \ |
| 5250 | -S "skip write certificate request" \ |
| 5251 | -C "skip parse certificate request" \ |
| 5252 | -c "got a certificate request" \ |
| 5253 | -C "skip write certificate" \ |
| 5254 | -C "skip write certificate verify" \ |
| 5255 | -S "skip parse certificate verify" |
| 5256 | |
| 5257 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 5258 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5259 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5260 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 5261 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 5262 | 0 \ |
| 5263 | -s "skip write certificate request" \ |
| 5264 | -C "skip parse certificate request" \ |
| 5265 | -c "got no certificate request" \ |
| 5266 | -c "skip write certificate" \ |
| 5267 | -c "skip write certificate verify" \ |
| 5268 | -s "skip parse certificate verify" |
| 5269 | |
| 5270 | run_test "SNI: DTLS, CA no override" \ |
| 5271 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5272 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5273 | ca_file=data_files/test-ca.crt \ |
| 5274 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 5275 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5276 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5277 | 1 \ |
| 5278 | -S "skip write certificate request" \ |
| 5279 | -C "skip parse certificate request" \ |
| 5280 | -c "got a certificate request" \ |
| 5281 | -C "skip write certificate" \ |
| 5282 | -C "skip write certificate verify" \ |
| 5283 | -S "skip parse certificate verify" \ |
| 5284 | -s "x509_verify_cert() returned" \ |
| 5285 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 5286 | -S "The certificate has been revoked (is on a CRL)" |
| 5287 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5288 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5289 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 5290 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5291 | ca_file=data_files/test-ca.crt \ |
| 5292 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 5293 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5294 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5295 | 0 \ |
| 5296 | -S "skip write certificate request" \ |
| 5297 | -C "skip parse certificate request" \ |
| 5298 | -c "got a certificate request" \ |
| 5299 | -C "skip write certificate" \ |
| 5300 | -C "skip write certificate verify" \ |
| 5301 | -S "skip parse certificate verify" \ |
| 5302 | -S "x509_verify_cert() returned" \ |
| 5303 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5304 | -S "The certificate has been revoked (is on a CRL)" |
| 5305 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 5306 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 5307 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 5308 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 5309 | ca_file=data_files/test-ca.crt \ |
| 5310 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 5311 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 5312 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 5313 | 1 \ |
| 5314 | -S "skip write certificate request" \ |
| 5315 | -C "skip parse certificate request" \ |
| 5316 | -c "got a certificate request" \ |
| 5317 | -C "skip write certificate" \ |
| 5318 | -C "skip write certificate verify" \ |
| 5319 | -S "skip parse certificate verify" \ |
| 5320 | -s "x509_verify_cert() returned" \ |
| 5321 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 5322 | -s "The certificate has been revoked (is on a CRL)" |
| 5323 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5324 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 5325 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5326 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5327 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5328 | "$P_CLI nbio=2 tickets=0" \ |
| 5329 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5330 | -S "mbedtls_ssl_handshake returned" \ |
| 5331 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5332 | -c "Read from server: .* bytes read" |
| 5333 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5334 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5335 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 5336 | "$P_CLI nbio=2 tickets=0" \ |
| 5337 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5338 | -S "mbedtls_ssl_handshake returned" \ |
| 5339 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5340 | -c "Read from server: .* bytes read" |
| 5341 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5342 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5343 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5344 | "$P_CLI nbio=2 tickets=1" \ |
| 5345 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5346 | -S "mbedtls_ssl_handshake returned" \ |
| 5347 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5348 | -c "Read from server: .* bytes read" |
| 5349 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5350 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5351 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5352 | "$P_CLI nbio=2 tickets=1" \ |
| 5353 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5354 | -S "mbedtls_ssl_handshake returned" \ |
| 5355 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5356 | -c "Read from server: .* bytes read" |
| 5357 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5358 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5359 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 5360 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5361 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5362 | -S "mbedtls_ssl_handshake returned" \ |
| 5363 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5364 | -c "Read from server: .* bytes read" |
| 5365 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5366 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5367 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 5368 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 5369 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5370 | -S "mbedtls_ssl_handshake returned" \ |
| 5371 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5372 | -c "Read from server: .* bytes read" |
| 5373 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5374 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5375 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 5376 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 5377 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5378 | -S "mbedtls_ssl_handshake returned" \ |
| 5379 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 5380 | -c "Read from server: .* bytes read" |
| 5381 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 5382 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 5383 | |
| 5384 | run_test "Event-driven I/O: basic handshake" \ |
| 5385 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5386 | "$P_CLI event=1 tickets=0" \ |
| 5387 | 0 \ |
| 5388 | -S "mbedtls_ssl_handshake returned" \ |
| 5389 | -C "mbedtls_ssl_handshake returned" \ |
| 5390 | -c "Read from server: .* bytes read" |
| 5391 | |
| 5392 | run_test "Event-driven I/O: client auth" \ |
| 5393 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 5394 | "$P_CLI event=1 tickets=0" \ |
| 5395 | 0 \ |
| 5396 | -S "mbedtls_ssl_handshake returned" \ |
| 5397 | -C "mbedtls_ssl_handshake returned" \ |
| 5398 | -c "Read from server: .* bytes read" |
| 5399 | |
| 5400 | run_test "Event-driven I/O: ticket" \ |
| 5401 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5402 | "$P_CLI event=1 tickets=1" \ |
| 5403 | 0 \ |
| 5404 | -S "mbedtls_ssl_handshake returned" \ |
| 5405 | -C "mbedtls_ssl_handshake returned" \ |
| 5406 | -c "Read from server: .* bytes read" |
| 5407 | |
| 5408 | run_test "Event-driven I/O: ticket + client auth" \ |
| 5409 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5410 | "$P_CLI event=1 tickets=1" \ |
| 5411 | 0 \ |
| 5412 | -S "mbedtls_ssl_handshake returned" \ |
| 5413 | -C "mbedtls_ssl_handshake returned" \ |
| 5414 | -c "Read from server: .* bytes read" |
| 5415 | |
| 5416 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 5417 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 5418 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5419 | 0 \ |
| 5420 | -S "mbedtls_ssl_handshake returned" \ |
| 5421 | -C "mbedtls_ssl_handshake returned" \ |
| 5422 | -c "Read from server: .* bytes read" |
| 5423 | |
| 5424 | run_test "Event-driven I/O: ticket + resume" \ |
| 5425 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 5426 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 5427 | 0 \ |
| 5428 | -S "mbedtls_ssl_handshake returned" \ |
| 5429 | -C "mbedtls_ssl_handshake returned" \ |
| 5430 | -c "Read from server: .* bytes read" |
| 5431 | |
| 5432 | run_test "Event-driven I/O: session-id resume" \ |
| 5433 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 5434 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 5435 | 0 \ |
| 5436 | -S "mbedtls_ssl_handshake returned" \ |
| 5437 | -C "mbedtls_ssl_handshake returned" \ |
| 5438 | -c "Read from server: .* bytes read" |
| 5439 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5440 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 5441 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 5442 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5443 | 0 \ |
| 5444 | -c "Read from server: .* bytes read" |
| 5445 | |
| 5446 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 5447 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 5448 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 5449 | 0 \ |
| 5450 | -c "Read from server: .* bytes read" |
| 5451 | |
| 5452 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 5453 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 5454 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5455 | 0 \ |
| 5456 | -c "Read from server: .* bytes read" |
| 5457 | |
| 5458 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 5459 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 5460 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 5461 | 0 \ |
| 5462 | -c "Read from server: .* bytes read" |
| 5463 | |
| 5464 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 5465 | "$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] | 5466 | "$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] | 5467 | 0 \ |
| 5468 | -c "Read from server: .* bytes read" |
| 5469 | |
| 5470 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 5471 | "$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] | 5472 | "$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] | 5473 | 0 \ |
| 5474 | -c "Read from server: .* bytes read" |
| 5475 | |
| 5476 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 5477 | "$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] | 5478 | "$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] | 5479 | 0 \ |
| 5480 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5481 | |
| 5482 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 5483 | # During session resumption, the client will send its ApplicationData record |
| 5484 | # within the same datagram as the Finished messages. In this situation, the |
| 5485 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 5486 | # because the ApplicationData request has already been queued internally. |
| 5487 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5488 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5489 | "$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] | 5490 | "$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] | 5491 | 0 \ |
| 5492 | -c "Read from server: .* bytes read" |
| 5493 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5494 | # Tests for version negotiation |
| 5495 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5496 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5497 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5498 | "$P_SRV" \ |
| 5499 | "$P_CLI" \ |
| 5500 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5501 | -S "mbedtls_ssl_handshake returned" \ |
| 5502 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5503 | -s "Protocol is TLSv1.2" \ |
| 5504 | -c "Protocol is TLSv1.2" |
| 5505 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5506 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5507 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5508 | "$P_SRV" \ |
| 5509 | "$P_CLI max_version=tls1_1" \ |
| 5510 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5511 | -S "mbedtls_ssl_handshake returned" \ |
| 5512 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5513 | -s "Protocol is TLSv1.1" \ |
| 5514 | -c "Protocol is TLSv1.1" |
| 5515 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5516 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5517 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5518 | "$P_SRV max_version=tls1_1" \ |
| 5519 | "$P_CLI" \ |
| 5520 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5521 | -S "mbedtls_ssl_handshake returned" \ |
| 5522 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5523 | -s "Protocol is TLSv1.1" \ |
| 5524 | -c "Protocol is TLSv1.1" |
| 5525 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5526 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5527 | 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] | 5528 | "$P_SRV max_version=tls1_1" \ |
| 5529 | "$P_CLI max_version=tls1_1" \ |
| 5530 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5531 | -S "mbedtls_ssl_handshake returned" \ |
| 5532 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5533 | -s "Protocol is TLSv1.1" \ |
| 5534 | -c "Protocol is TLSv1.1" |
| 5535 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5536 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5537 | 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] | 5538 | "$P_SRV min_version=tls1_1" \ |
| 5539 | "$P_CLI max_version=tls1_1" \ |
| 5540 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5541 | -S "mbedtls_ssl_handshake returned" \ |
| 5542 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5543 | -s "Protocol is TLSv1.1" \ |
| 5544 | -c "Protocol is TLSv1.1" |
| 5545 | |
Gilles Peskine | df4ad90 | 2022-04-08 15:14:38 +0200 | [diff] [blame] | 5546 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5547 | 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] | 5548 | "$P_SRV max_version=tls1_1" \ |
| 5549 | "$P_CLI min_version=tls1_1" \ |
| 5550 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5551 | -S "mbedtls_ssl_handshake returned" \ |
| 5552 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5553 | -s "Protocol is TLSv1.1" \ |
| 5554 | -c "Protocol is TLSv1.1" |
| 5555 | |
Gilles Peskine | bcb2ab0 | 2022-04-09 00:11:16 +0200 | [diff] [blame] | 5556 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5558 | 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] | 5559 | "$P_SRV max_version=tls1_1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 5560 | "$P_CLI min_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5561 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5562 | -s "mbedtls_ssl_handshake returned" \ |
| 5563 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5564 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 5565 | |
Gilles Peskine | bcb2ab0 | 2022-04-09 00:11:16 +0200 | [diff] [blame] | 5566 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5568 | 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] | 5569 | "$P_SRV min_version=tls12" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5570 | "$P_CLI max_version=tls1_1" \ |
| 5571 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5572 | -s "mbedtls_ssl_handshake returned" \ |
| 5573 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5574 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 5575 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5576 | # Tests for ALPN extension |
| 5577 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5578 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5579 | "$P_SRV debug_level=3" \ |
| 5580 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5581 | 0 \ |
| 5582 | -C "client hello, adding alpn extension" \ |
| 5583 | -S "found alpn extension" \ |
| 5584 | -C "got an alert message, type: \\[2:120]" \ |
| 5585 | -S "server hello, adding alpn extension" \ |
| 5586 | -C "found alpn extension " \ |
| 5587 | -C "Application Layer Protocol is" \ |
| 5588 | -S "Application Layer Protocol is" |
| 5589 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5590 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5591 | "$P_SRV debug_level=3" \ |
| 5592 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5593 | 0 \ |
| 5594 | -c "client hello, adding alpn extension" \ |
| 5595 | -s "found alpn extension" \ |
| 5596 | -C "got an alert message, type: \\[2:120]" \ |
| 5597 | -S "server hello, adding alpn extension" \ |
| 5598 | -C "found alpn extension " \ |
| 5599 | -c "Application Layer Protocol is (none)" \ |
| 5600 | -S "Application Layer Protocol is" |
| 5601 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5602 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5603 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5604 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5605 | 0 \ |
| 5606 | -C "client hello, adding alpn extension" \ |
| 5607 | -S "found alpn extension" \ |
| 5608 | -C "got an alert message, type: \\[2:120]" \ |
| 5609 | -S "server hello, adding alpn extension" \ |
| 5610 | -C "found alpn extension " \ |
| 5611 | -C "Application Layer Protocol is" \ |
| 5612 | -s "Application Layer Protocol is (none)" |
| 5613 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5614 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5615 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5616 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5617 | 0 \ |
| 5618 | -c "client hello, adding alpn extension" \ |
| 5619 | -s "found alpn extension" \ |
| 5620 | -C "got an alert message, type: \\[2:120]" \ |
| 5621 | -s "server hello, adding alpn extension" \ |
| 5622 | -c "found alpn extension" \ |
| 5623 | -c "Application Layer Protocol is abc" \ |
| 5624 | -s "Application Layer Protocol is abc" |
| 5625 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5626 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5627 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5628 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5629 | 0 \ |
| 5630 | -c "client hello, adding alpn extension" \ |
| 5631 | -s "found alpn extension" \ |
| 5632 | -C "got an alert message, type: \\[2:120]" \ |
| 5633 | -s "server hello, adding alpn extension" \ |
| 5634 | -c "found alpn extension" \ |
| 5635 | -c "Application Layer Protocol is abc" \ |
| 5636 | -s "Application Layer Protocol is abc" |
| 5637 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5638 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5639 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 5640 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5641 | 0 \ |
| 5642 | -c "client hello, adding alpn extension" \ |
| 5643 | -s "found alpn extension" \ |
| 5644 | -C "got an alert message, type: \\[2:120]" \ |
| 5645 | -s "server hello, adding alpn extension" \ |
| 5646 | -c "found alpn extension" \ |
| 5647 | -c "Application Layer Protocol is 1234" \ |
| 5648 | -s "Application Layer Protocol is 1234" |
| 5649 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5650 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5651 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5652 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5653 | 1 \ |
| 5654 | -c "client hello, adding alpn extension" \ |
| 5655 | -s "found alpn extension" \ |
| 5656 | -c "got an alert message, type: \\[2:120]" \ |
| 5657 | -S "server hello, adding alpn extension" \ |
| 5658 | -C "found alpn extension" \ |
| 5659 | -C "Application Layer Protocol is 1234" \ |
| 5660 | -S "Application Layer Protocol is 1234" |
| 5661 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5662 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5663 | # Tests for keyUsage in leaf certificates, part 1: |
| 5664 | # server-side certificate/suite selection |
| 5665 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5666 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5667 | "$P_SRV key_file=data_files/server2.key \ |
| 5668 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5669 | "$P_CLI" \ |
| 5670 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5671 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5672 | |
| 5673 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5674 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5675 | "$P_SRV key_file=data_files/server2.key \ |
| 5676 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5677 | "$P_CLI" \ |
| 5678 | 0 \ |
| 5679 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5680 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5681 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5682 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5683 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5684 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5685 | 1 \ |
| 5686 | -C "Ciphersuite is " |
| 5687 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5688 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5689 | "$P_SRV key_file=data_files/server5.key \ |
| 5690 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5691 | "$P_CLI" \ |
| 5692 | 0 \ |
| 5693 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5694 | |
| 5695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5696 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5697 | "$P_SRV key_file=data_files/server5.key \ |
| 5698 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5699 | "$P_CLI" \ |
| 5700 | 0 \ |
| 5701 | -c "Ciphersuite is TLS-ECDH-" |
| 5702 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5703 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5704 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5705 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5706 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5707 | 1 \ |
| 5708 | -C "Ciphersuite is " |
| 5709 | |
| 5710 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5711 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5712 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5713 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5714 | "$O_SRV -key data_files/server2.key \ |
| 5715 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5716 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5717 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5718 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5719 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5720 | -C "Processing of the Certificate handshake message failed" \ |
| 5721 | -c "Ciphersuite is TLS-" |
| 5722 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5723 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5724 | "$O_SRV -key data_files/server2.key \ |
| 5725 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5726 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5727 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5728 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5729 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5730 | -C "Processing of the Certificate handshake message failed" \ |
| 5731 | -c "Ciphersuite is TLS-" |
| 5732 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5733 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5734 | "$O_SRV -key data_files/server2.key \ |
| 5735 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5736 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5737 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5738 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5739 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5740 | -C "Processing of the Certificate handshake message failed" \ |
| 5741 | -c "Ciphersuite is TLS-" |
| 5742 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5743 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5744 | "$O_SRV -key data_files/server2.key \ |
| 5745 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5746 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5747 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5748 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5749 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5750 | -c "Processing of the Certificate handshake message failed" \ |
| 5751 | -C "Ciphersuite is TLS-" |
| 5752 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5753 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5754 | "$O_SRV -key data_files/server2.key \ |
| 5755 | -cert data_files/server2.ku-ke.crt" \ |
| 5756 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5757 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5758 | 0 \ |
| 5759 | -c "bad certificate (usage extensions)" \ |
| 5760 | -C "Processing of the Certificate handshake message failed" \ |
| 5761 | -c "Ciphersuite is TLS-" \ |
| 5762 | -c "! Usage does not match the keyUsage extension" |
| 5763 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5764 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5765 | "$O_SRV -key data_files/server2.key \ |
| 5766 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5767 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5768 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5769 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5770 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5771 | -C "Processing of the Certificate handshake message failed" \ |
| 5772 | -c "Ciphersuite is TLS-" |
| 5773 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5774 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5775 | "$O_SRV -key data_files/server2.key \ |
| 5776 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5777 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5778 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5779 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5780 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5781 | -c "Processing of the Certificate handshake message failed" \ |
| 5782 | -C "Ciphersuite is TLS-" |
| 5783 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5784 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5785 | "$O_SRV -key data_files/server2.key \ |
| 5786 | -cert data_files/server2.ku-ds.crt" \ |
| 5787 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5788 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5789 | 0 \ |
| 5790 | -c "bad certificate (usage extensions)" \ |
| 5791 | -C "Processing of the Certificate handshake message failed" \ |
| 5792 | -c "Ciphersuite is TLS-" \ |
| 5793 | -c "! Usage does not match the keyUsage extension" |
| 5794 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5795 | # Tests for keyUsage in leaf certificates, part 3: |
| 5796 | # server-side checking of client cert |
| 5797 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5798 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5799 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5800 | "$O_CLI -key data_files/server2.key \ |
| 5801 | -cert data_files/server2.ku-ds.crt" \ |
| 5802 | 0 \ |
| 5803 | -S "bad certificate (usage extensions)" \ |
| 5804 | -S "Processing of the Certificate handshake message failed" |
| 5805 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5806 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5807 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5808 | "$O_CLI -key data_files/server2.key \ |
| 5809 | -cert data_files/server2.ku-ke.crt" \ |
| 5810 | 0 \ |
| 5811 | -s "bad certificate (usage extensions)" \ |
| 5812 | -S "Processing of the Certificate handshake message failed" |
| 5813 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5814 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5815 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5816 | "$O_CLI -key data_files/server2.key \ |
| 5817 | -cert data_files/server2.ku-ke.crt" \ |
| 5818 | 1 \ |
| 5819 | -s "bad certificate (usage extensions)" \ |
| 5820 | -s "Processing of the Certificate handshake message failed" |
| 5821 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5822 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5823 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5824 | "$O_CLI -key data_files/server5.key \ |
| 5825 | -cert data_files/server5.ku-ds.crt" \ |
| 5826 | 0 \ |
| 5827 | -S "bad certificate (usage extensions)" \ |
| 5828 | -S "Processing of the Certificate handshake message failed" |
| 5829 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5830 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5831 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5832 | "$O_CLI -key data_files/server5.key \ |
| 5833 | -cert data_files/server5.ku-ka.crt" \ |
| 5834 | 0 \ |
| 5835 | -s "bad certificate (usage extensions)" \ |
| 5836 | -S "Processing of the Certificate handshake message failed" |
| 5837 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5838 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5839 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5840 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5841 | "$P_SRV key_file=data_files/server5.key \ |
| 5842 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5843 | "$P_CLI" \ |
| 5844 | 0 |
| 5845 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5846 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5847 | "$P_SRV key_file=data_files/server5.key \ |
| 5848 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5849 | "$P_CLI" \ |
| 5850 | 0 |
| 5851 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5852 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5853 | "$P_SRV key_file=data_files/server5.key \ |
| 5854 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5855 | "$P_CLI" \ |
| 5856 | 0 |
| 5857 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5858 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5859 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5860 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5861 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5862 | 1 |
| 5863 | |
| 5864 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5865 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5866 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5867 | "$O_SRV -key data_files/server5.key \ |
| 5868 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5869 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5870 | 0 \ |
| 5871 | -C "bad certificate (usage extensions)" \ |
| 5872 | -C "Processing of the Certificate handshake message failed" \ |
| 5873 | -c "Ciphersuite is TLS-" |
| 5874 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5875 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5876 | "$O_SRV -key data_files/server5.key \ |
| 5877 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5878 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5879 | 0 \ |
| 5880 | -C "bad certificate (usage extensions)" \ |
| 5881 | -C "Processing of the Certificate handshake message failed" \ |
| 5882 | -c "Ciphersuite is TLS-" |
| 5883 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5884 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5885 | "$O_SRV -key data_files/server5.key \ |
| 5886 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5887 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5888 | 0 \ |
| 5889 | -C "bad certificate (usage extensions)" \ |
| 5890 | -C "Processing of the Certificate handshake message failed" \ |
| 5891 | -c "Ciphersuite is TLS-" |
| 5892 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5893 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5894 | "$O_SRV -key data_files/server5.key \ |
| 5895 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5896 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5897 | 1 \ |
| 5898 | -c "bad certificate (usage extensions)" \ |
| 5899 | -c "Processing of the Certificate handshake message failed" \ |
| 5900 | -C "Ciphersuite is TLS-" |
| 5901 | |
| 5902 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5903 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5904 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5905 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5906 | "$O_CLI -key data_files/server5.key \ |
| 5907 | -cert data_files/server5.eku-cli.crt" \ |
| 5908 | 0 \ |
| 5909 | -S "bad certificate (usage extensions)" \ |
| 5910 | -S "Processing of the Certificate handshake message failed" |
| 5911 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5912 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5913 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5914 | "$O_CLI -key data_files/server5.key \ |
| 5915 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5916 | 0 \ |
| 5917 | -S "bad certificate (usage extensions)" \ |
| 5918 | -S "Processing of the Certificate handshake message failed" |
| 5919 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5920 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5921 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5922 | "$O_CLI -key data_files/server5.key \ |
| 5923 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5924 | 0 \ |
| 5925 | -S "bad certificate (usage extensions)" \ |
| 5926 | -S "Processing of the Certificate handshake message failed" |
| 5927 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5928 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5929 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5930 | "$O_CLI -key data_files/server5.key \ |
| 5931 | -cert data_files/server5.eku-cs.crt" \ |
| 5932 | 0 \ |
| 5933 | -s "bad certificate (usage extensions)" \ |
| 5934 | -S "Processing of the Certificate handshake message failed" |
| 5935 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5936 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5937 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5938 | "$O_CLI -key data_files/server5.key \ |
| 5939 | -cert data_files/server5.eku-cs.crt" \ |
| 5940 | 1 \ |
| 5941 | -s "bad certificate (usage extensions)" \ |
| 5942 | -s "Processing of the Certificate handshake message failed" |
| 5943 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5944 | # Tests for DHM parameters loading |
| 5945 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5946 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5947 | "$P_SRV" \ |
| 5948 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5949 | debug_level=3" \ |
| 5950 | 0 \ |
| 5951 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5952 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5953 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5954 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5955 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5956 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5957 | debug_level=3" \ |
| 5958 | 0 \ |
| 5959 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5960 | -c "value of 'DHM: G ' (2 bits)" |
| 5961 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5962 | # Tests for DHM client-side size checking |
| 5963 | |
| 5964 | run_test "DHM size: server default, client default, OK" \ |
| 5965 | "$P_SRV" \ |
| 5966 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5967 | debug_level=1" \ |
| 5968 | 0 \ |
| 5969 | -C "DHM prime too short:" |
| 5970 | |
| 5971 | run_test "DHM size: server default, client 2048, OK" \ |
| 5972 | "$P_SRV" \ |
| 5973 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5974 | debug_level=1 dhmlen=2048" \ |
| 5975 | 0 \ |
| 5976 | -C "DHM prime too short:" |
| 5977 | |
| 5978 | run_test "DHM size: server 1024, client default, OK" \ |
| 5979 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5980 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5981 | debug_level=1" \ |
| 5982 | 0 \ |
| 5983 | -C "DHM prime too short:" |
| 5984 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5985 | run_test "DHM size: server 999, client 999, OK" \ |
| 5986 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5987 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5988 | debug_level=1 dhmlen=999" \ |
| 5989 | 0 \ |
| 5990 | -C "DHM prime too short:" |
| 5991 | |
| 5992 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5993 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5994 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5995 | debug_level=1 dhmlen=1000" \ |
| 5996 | 0 \ |
| 5997 | -C "DHM prime too short:" |
| 5998 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5999 | run_test "DHM size: server 1000, client default, rejected" \ |
| 6000 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6001 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6002 | debug_level=1" \ |
| 6003 | 1 \ |
| 6004 | -c "DHM prime too short:" |
| 6005 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 6006 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 6007 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 6008 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6009 | debug_level=1 dhmlen=1001" \ |
| 6010 | 1 \ |
| 6011 | -c "DHM prime too short:" |
| 6012 | |
| 6013 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 6014 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 6015 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6016 | debug_level=1 dhmlen=1000" \ |
| 6017 | 1 \ |
| 6018 | -c "DHM prime too short:" |
| 6019 | |
| 6020 | run_test "DHM size: server 998, client 999, rejected" \ |
| 6021 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 6022 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6023 | debug_level=1 dhmlen=999" \ |
| 6024 | 1 \ |
| 6025 | -c "DHM prime too short:" |
| 6026 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 6027 | run_test "DHM size: server default, client 2049, rejected" \ |
| 6028 | "$P_SRV" \ |
| 6029 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 6030 | debug_level=1 dhmlen=2049" \ |
| 6031 | 1 \ |
| 6032 | -c "DHM prime too short:" |
| 6033 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6034 | # Tests for PSK callback |
| 6035 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6036 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6037 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 6038 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6039 | psk_identity=foo psk=abc123" \ |
| 6040 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6041 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6042 | -S "SSL - Unknown identity received" \ |
| 6043 | -S "SSL - Verification of the message MAC failed" |
| 6044 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6045 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6046 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 6047 | "$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] | 6048 | "$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] | 6049 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6050 | 0 \ |
| 6051 | -c "skip PMS generation for opaque PSK"\ |
| 6052 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6053 | -C "session hash for extended master secret"\ |
| 6054 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6055 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6056 | -S "SSL - Unknown identity received" \ |
| 6057 | -S "SSL - Verification of the message MAC failed" |
| 6058 | |
| 6059 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6060 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 6061 | "$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] | 6062 | "$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] | 6063 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6064 | 0 \ |
| 6065 | -c "skip PMS generation for opaque PSK"\ |
| 6066 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6067 | -C "session hash for extended master secret"\ |
| 6068 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6069 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6070 | -S "SSL - Unknown identity received" \ |
| 6071 | -S "SSL - Verification of the message MAC failed" |
| 6072 | |
| 6073 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6074 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 6075 | "$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] | 6076 | "$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] | 6077 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6078 | 0 \ |
| 6079 | -c "skip PMS generation for opaque PSK"\ |
| 6080 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6081 | -c "session hash for extended master secret"\ |
| 6082 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6083 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6084 | -S "SSL - Unknown identity received" \ |
| 6085 | -S "SSL - Verification of the message MAC failed" |
| 6086 | |
| 6087 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6088 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 6089 | "$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] | 6090 | "$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] | 6091 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6092 | 0 \ |
| 6093 | -c "skip PMS generation for opaque PSK"\ |
| 6094 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6095 | -c "session hash for extended master secret"\ |
| 6096 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 6097 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6098 | -S "SSL - Unknown identity received" \ |
| 6099 | -S "SSL - Verification of the message MAC failed" |
| 6100 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6101 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6102 | 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] | 6103 | "$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" \ |
| 6104 | "$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] | 6105 | psk_identity=foo psk=abc123" \ |
| 6106 | 0 \ |
| 6107 | -C "skip PMS generation for opaque PSK"\ |
| 6108 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6109 | -C "session hash for extended master secret"\ |
| 6110 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6111 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6112 | -S "SSL - Unknown identity received" \ |
| 6113 | -S "SSL - Verification of the message MAC failed" |
| 6114 | |
| 6115 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6116 | 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] | 6117 | "$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" \ |
| 6118 | "$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] | 6119 | psk_identity=foo psk=abc123" \ |
| 6120 | 0 \ |
| 6121 | -C "skip PMS generation for opaque PSK"\ |
| 6122 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6123 | -C "session hash for extended master secret"\ |
| 6124 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6125 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6126 | -S "SSL - Unknown identity received" \ |
| 6127 | -S "SSL - Verification of the message MAC failed" |
| 6128 | |
| 6129 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6130 | 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] | 6131 | "$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] | 6132 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6133 | "$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] | 6134 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6135 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6136 | -c "session hash for extended master secret"\ |
| 6137 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6138 | -C "skip PMS generation for opaque PSK"\ |
| 6139 | -s "skip PMS generation for opaque PSK"\ |
| 6140 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6141 | -S "SSL - Unknown identity received" \ |
| 6142 | -S "SSL - Verification of the message MAC failed" |
| 6143 | |
| 6144 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6145 | run_test "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6146 | "$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] | 6147 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6148 | "$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] | 6149 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 6150 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6151 | -c "session hash for extended master secret"\ |
| 6152 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6153 | -C "skip PMS generation for opaque PSK"\ |
| 6154 | -s "skip PMS generation for opaque PSK"\ |
| 6155 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6156 | -S "SSL - Unknown identity received" \ |
| 6157 | -S "SSL - Verification of the message MAC failed" |
| 6158 | |
| 6159 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6160 | 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] | 6161 | "$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" \ |
| 6162 | "$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] | 6163 | psk_identity=def psk=beef" \ |
| 6164 | 0 \ |
| 6165 | -C "skip PMS generation for opaque PSK"\ |
| 6166 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6167 | -C "session hash for extended master secret"\ |
| 6168 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6169 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6170 | -S "SSL - Unknown identity received" \ |
| 6171 | -S "SSL - Verification of the message MAC failed" |
| 6172 | |
| 6173 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6174 | 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] | 6175 | "$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" \ |
| 6176 | "$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] | 6177 | psk_identity=def psk=beef" \ |
| 6178 | 0 \ |
| 6179 | -C "skip PMS generation for opaque PSK"\ |
| 6180 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6181 | -C "session hash for extended master secret"\ |
| 6182 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6183 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6184 | -S "SSL - Unknown identity received" \ |
| 6185 | -S "SSL - Verification of the message MAC failed" |
| 6186 | |
| 6187 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6188 | 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] | 6189 | "$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] | 6190 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6191 | "$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] | 6192 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6193 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6194 | -c "session hash for extended master secret"\ |
| 6195 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6196 | -C "skip PMS generation for opaque PSK"\ |
| 6197 | -s "skip PMS generation for opaque PSK"\ |
| 6198 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6199 | -S "SSL - Unknown identity received" \ |
| 6200 | -S "SSL - Verification of the message MAC failed" |
| 6201 | |
| 6202 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6203 | 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] | 6204 | "$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] | 6205 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6206 | "$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] | 6207 | psk_identity=abc psk=dead extended_ms=1" \ |
| 6208 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6209 | -c "session hash for extended master secret"\ |
| 6210 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6211 | -C "skip PMS generation for opaque PSK"\ |
| 6212 | -s "skip PMS generation for opaque PSK"\ |
| 6213 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6214 | -S "SSL - Unknown identity received" \ |
| 6215 | -S "SSL - Verification of the message MAC failed" |
| 6216 | |
| 6217 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6218 | 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] | 6219 | "$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" \ |
| 6220 | "$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] | 6221 | psk_identity=def psk=beef" \ |
| 6222 | 0 \ |
| 6223 | -C "skip PMS generation for opaque PSK"\ |
| 6224 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6225 | -C "session hash for extended master secret"\ |
| 6226 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6227 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6228 | -S "SSL - Unknown identity received" \ |
| 6229 | -S "SSL - Verification of the message MAC failed" |
| 6230 | |
| 6231 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6232 | 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] | 6233 | "$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" \ |
| 6234 | "$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] | 6235 | psk_identity=def psk=beef" \ |
| 6236 | 0 \ |
| 6237 | -C "skip PMS generation for opaque PSK"\ |
| 6238 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6239 | -C "session hash for extended master secret"\ |
| 6240 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6241 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6242 | -S "SSL - Unknown identity received" \ |
| 6243 | -S "SSL - Verification of the message MAC failed" |
| 6244 | |
| 6245 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6246 | 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] | 6247 | "$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" \ |
| 6248 | "$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] | 6249 | psk_identity=def psk=beef" \ |
| 6250 | 0 \ |
| 6251 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6252 | -C "session hash for extended master secret"\ |
| 6253 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6254 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6255 | -S "SSL - Unknown identity received" \ |
| 6256 | -S "SSL - Verification of the message MAC failed" |
| 6257 | |
| 6258 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6259 | 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] | 6260 | "$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" \ |
| 6261 | "$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] | 6262 | psk_identity=def psk=beef" \ |
| 6263 | 0 \ |
| 6264 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 6265 | -C "session hash for extended master secret"\ |
| 6266 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 6267 | -S "SSL - None of the common ciphersuites is usable" \ |
| 6268 | -S "SSL - Unknown identity received" \ |
| 6269 | -S "SSL - Verification of the message MAC failed" |
| 6270 | |
| 6271 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 6272 | 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] | 6273 | "$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" \ |
| 6274 | "$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] | 6275 | psk_identity=def psk=beef" \ |
| 6276 | 1 \ |
| 6277 | -s "SSL - Verification of the message MAC failed" |
| 6278 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6279 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 6280 | "$P_SRV" \ |
| 6281 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6282 | psk_identity=foo psk=abc123" \ |
| 6283 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6284 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6285 | -S "SSL - Unknown identity received" \ |
| 6286 | -S "SSL - Verification of the message MAC failed" |
| 6287 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6288 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6289 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 6290 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6291 | psk_identity=foo psk=abc123" \ |
| 6292 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6293 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6294 | -s "SSL - Unknown identity received" \ |
| 6295 | -S "SSL - Verification of the message MAC failed" |
| 6296 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6297 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6298 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6299 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6300 | psk_identity=abc psk=dead" \ |
| 6301 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6302 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6303 | -S "SSL - Unknown identity received" \ |
| 6304 | -S "SSL - Verification of the message MAC failed" |
| 6305 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6306 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6307 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6308 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6309 | psk_identity=def psk=beef" \ |
| 6310 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6311 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6312 | -S "SSL - Unknown identity received" \ |
| 6313 | -S "SSL - Verification of the message MAC failed" |
| 6314 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6315 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6316 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6317 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6318 | psk_identity=ghi psk=beef" \ |
| 6319 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6320 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6321 | -s "SSL - Unknown identity received" \ |
| 6322 | -S "SSL - Verification of the message MAC failed" |
| 6323 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6324 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6325 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 6326 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 6327 | psk_identity=abc psk=beef" \ |
| 6328 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 6329 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 6330 | -S "SSL - Unknown identity received" \ |
| 6331 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 6332 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6333 | # Tests for EC J-PAKE |
| 6334 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6335 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6336 | run_test "ECJPAKE: client not configured" \ |
| 6337 | "$P_SRV debug_level=3" \ |
| 6338 | "$P_CLI debug_level=3" \ |
| 6339 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6340 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6341 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6342 | -S "found ecjpake kkpp extension" \ |
| 6343 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6344 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6345 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6346 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6347 | -S "None of the common ciphersuites is usable" |
| 6348 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6349 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6350 | run_test "ECJPAKE: server not configured" \ |
| 6351 | "$P_SRV debug_level=3" \ |
| 6352 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6353 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6354 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6355 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6356 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6357 | -s "found ecjpake kkpp extension" \ |
| 6358 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6359 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6360 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6361 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 6362 | -s "None of the common ciphersuites is usable" |
| 6363 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 6364 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6365 | run_test "ECJPAKE: working, TLS" \ |
| 6366 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6367 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 6368 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 6369 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 6370 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6371 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6372 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6373 | -s "found ecjpake kkpp extension" \ |
| 6374 | -S "skip ecjpake kkpp extension" \ |
| 6375 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 6376 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 6377 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6378 | -S "None of the common ciphersuites is usable" \ |
| 6379 | -S "SSL - Verification of the message MAC failed" |
| 6380 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6381 | server_needs_more_time 1 |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6382 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6383 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 6384 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 6385 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 6386 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6387 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6388 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6389 | -s "SSL - Verification of the message MAC failed" |
| 6390 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6391 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6392 | run_test "ECJPAKE: working, DTLS" \ |
| 6393 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6394 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6395 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6396 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6397 | -c "re-using cached ecjpake parameters" \ |
| 6398 | -S "SSL - Verification of the message MAC failed" |
| 6399 | |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6400 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6401 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 6402 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 6403 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 6404 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6405 | 0 \ |
| 6406 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6407 | -S "SSL - Verification of the message MAC failed" |
| 6408 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 6409 | server_needs_more_time 1 |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6410 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6411 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 6412 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 6413 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 6414 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6415 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 6416 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 6417 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 6418 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6419 | # for tests with configs/config-thread.h |
Dave Rodgman | 7ed75e2 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 6420 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 6421 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 6422 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 6423 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 6424 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 6425 | 0 |
| 6426 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6427 | # Tests for ciphersuites per version |
| 6428 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6429 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6430 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6431 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6432 | "$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] | 6433 | "$P_CLI force_version=ssl3" \ |
| 6434 | 0 \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6435 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6436 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6437 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6438 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6439 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6440 | "$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] | 6441 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6442 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6443 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6444 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6445 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6446 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6447 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6448 | "$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] | 6449 | "$P_CLI force_version=tls1_1" \ |
| 6450 | 0 \ |
| 6451 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 6452 | |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6453 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 6454 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 6455 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 6456 | "$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] | 6457 | "$P_CLI force_version=tls12" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6458 | 0 \ |
| 6459 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 6460 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 6461 | # Test for ClientHello without extensions |
| 6462 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 6463 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 6464 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 6465 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6466 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 6467 | 0 \ |
| 6468 | -s "dumping 'client hello extensions' (0 bytes)" |
| 6469 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6470 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6471 | |
Gilles Peskine | 5a1b3bd | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6472 | # The server first reads buffer_size-1 bytes, then reads the remainder. |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6473 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Gilles Peskine | 5a1b3bd | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6474 | "$P_SRV buffer_size=100" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6475 | "$P_CLI request_size=100" \ |
| 6476 | 0 \ |
| 6477 | -s "Read from client: 100 bytes read$" |
| 6478 | |
Gilles Peskine | 5a1b3bd | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6479 | run_test "mbedtls_ssl_get_bytes_avail: extra data (+1)" \ |
| 6480 | "$P_SRV buffer_size=100" \ |
| 6481 | "$P_CLI request_size=101" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 6482 | 0 \ |
Gilles Peskine | 5a1b3bd | 2022-04-06 23:35:56 +0200 | [diff] [blame] | 6483 | -s "Read from client: 101 bytes read (100 + 1)" |
| 6484 | |
| 6485 | requires_max_content_len 200 |
| 6486 | run_test "mbedtls_ssl_get_bytes_avail: extra data (*2)" \ |
| 6487 | "$P_SRV buffer_size=100" \ |
| 6488 | "$P_CLI request_size=200" \ |
| 6489 | 0 \ |
| 6490 | -s "Read from client: 200 bytes read (100 + 100)" |
| 6491 | |
| 6492 | run_test "mbedtls_ssl_get_bytes_avail: extra data (max)" \ |
| 6493 | "$P_SRV buffer_size=100" \ |
| 6494 | "$P_CLI request_size=$MAX_CONTENT_LEN" \ |
| 6495 | 0 \ |
| 6496 | -s "Read from client: $MAX_CONTENT_LEN bytes read (100 + $((MAX_CONTENT_LEN - 100)))" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6497 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6498 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6499 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6500 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6501 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6502 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6503 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6504 | 0 \ |
| 6505 | -s "Read from client: 1 bytes read" |
| 6506 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6507 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6508 | "$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] | 6509 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 6510 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6511 | 0 \ |
| 6512 | -s "Read from client: 1 bytes read" |
| 6513 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6514 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6515 | "$P_SRV" \ |
| 6516 | "$P_CLI request_size=1 force_version=tls1 \ |
| 6517 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6518 | 0 \ |
| 6519 | -s "Read from client: 1 bytes read" |
| 6520 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6521 | 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] | 6522 | "$P_SRV" \ |
| 6523 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 6524 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6525 | 0 \ |
| 6526 | -s "Read from client: 1 bytes read" |
| 6527 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6528 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6529 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6530 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6531 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6532 | 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] | 6533 | 0 \ |
| 6534 | -s "Read from client: 1 bytes read" |
| 6535 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6536 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6537 | 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] | 6538 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6539 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6540 | 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] | 6541 | 0 \ |
| 6542 | -s "Read from client: 1 bytes read" |
| 6543 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6544 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6545 | "$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] | 6546 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6547 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6548 | 0 \ |
| 6549 | -s "Read from client: 1 bytes read" |
| 6550 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6551 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6552 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6553 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6554 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6555 | 0 \ |
| 6556 | -s "Read from client: 1 bytes read" |
| 6557 | |
| 6558 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6559 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6560 | "$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] | 6561 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6562 | 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] | 6563 | 0 \ |
| 6564 | -s "Read from client: 1 bytes read" |
| 6565 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6566 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6567 | 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] | 6568 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6569 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6570 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6571 | 0 \ |
| 6572 | -s "Read from client: 1 bytes read" |
| 6573 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6574 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6575 | "$P_SRV" \ |
| 6576 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6577 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6578 | 0 \ |
| 6579 | -s "Read from client: 1 bytes read" |
| 6580 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6581 | 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] | 6582 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6583 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6584 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6585 | 0 \ |
| 6586 | -s "Read from client: 1 bytes read" |
| 6587 | |
| 6588 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6589 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6590 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6591 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6592 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6593 | 0 \ |
| 6594 | -s "Read from client: 1 bytes read" |
| 6595 | |
| 6596 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6597 | 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] | 6598 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6599 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6600 | 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] | 6601 | 0 \ |
| 6602 | -s "Read from client: 1 bytes read" |
| 6603 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6604 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6605 | "$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] | 6606 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 6607 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6608 | 0 \ |
| 6609 | -s "Read from client: 1 bytes read" |
| 6610 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6611 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6612 | "$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] | 6613 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6614 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6615 | 0 \ |
| 6616 | -s "Read from client: 1 bytes read" |
| 6617 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6618 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6619 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6620 | "$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] | 6621 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6622 | 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] | 6623 | 0 \ |
| 6624 | -s "Read from client: 1 bytes read" |
| 6625 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6626 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6627 | 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] | 6628 | "$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] | 6629 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6630 | 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] | 6631 | 0 \ |
| 6632 | -s "Read from client: 1 bytes read" |
| 6633 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6634 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6635 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6636 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6637 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6638 | 0 \ |
| 6639 | -s "Read from client: 1 bytes read" |
| 6640 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6641 | 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] | 6642 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6643 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6644 | 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] | 6645 | 0 \ |
| 6646 | -s "Read from client: 1 bytes read" |
| 6647 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6648 | 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] | 6649 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6650 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6651 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6652 | 0 \ |
| 6653 | -s "Read from client: 1 bytes read" |
| 6654 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6655 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6656 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6657 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6658 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6659 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6660 | 0 \ |
| 6661 | -s "Read from client: 1 bytes read" |
| 6662 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6663 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6664 | 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] | 6665 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6666 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6667 | 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] | 6668 | 0 \ |
| 6669 | -s "Read from client: 1 bytes read" |
| 6670 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6671 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6672 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6673 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6674 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6675 | 0 \ |
| 6676 | -s "Read from client: 1 bytes read" |
| 6677 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6678 | 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] | 6679 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6680 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6681 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6682 | 0 \ |
| 6683 | -s "Read from client: 1 bytes read" |
| 6684 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6685 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6686 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6687 | "$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] | 6688 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6689 | 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] | 6690 | 0 \ |
| 6691 | -s "Read from client: 1 bytes read" |
| 6692 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6693 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6694 | 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] | 6695 | "$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] | 6696 | "$P_CLI request_size=1 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6697 | 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] | 6698 | 0 \ |
| 6699 | -s "Read from client: 1 bytes read" |
| 6700 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6701 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6702 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6703 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6704 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6705 | 0 \ |
| 6706 | -s "Read from client: 1 bytes read" |
| 6707 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6708 | 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] | 6709 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6710 | "$P_CLI request_size=1 force_version=tls12 \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6711 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6712 | 0 \ |
| 6713 | -s "Read from client: 1 bytes read" |
| 6714 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6715 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6716 | |
| 6717 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6718 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6719 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 6720 | "$P_CLI dtls=1 request_size=1 \ |
| 6721 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6722 | 0 \ |
| 6723 | -s "Read from client: 1 bytes read" |
| 6724 | |
| 6725 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6726 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6727 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 6728 | "$P_CLI dtls=1 request_size=1 \ |
| 6729 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6730 | 0 \ |
| 6731 | -s "Read from client: 1 bytes read" |
| 6732 | |
| 6733 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6734 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6735 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6736 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 6737 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6738 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6739 | 0 \ |
| 6740 | -s "Read from client: 1 bytes read" |
| 6741 | |
| 6742 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6743 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6744 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6745 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6746 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6747 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6748 | 0 \ |
| 6749 | -s "Read from client: 1 bytes read" |
| 6750 | |
| 6751 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6752 | run_test "Small client packet DTLS 1.2" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6753 | "$P_SRV dtls=1 force_version=dtls12" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6754 | "$P_CLI dtls=1 request_size=1 \ |
| 6755 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6756 | 0 \ |
| 6757 | -s "Read from client: 1 bytes read" |
| 6758 | |
| 6759 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6760 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6761 | "$P_SRV dtls=1 force_version=dtls12 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6762 | "$P_CLI dtls=1 request_size=1 \ |
| 6763 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6764 | 0 \ |
| 6765 | -s "Read from client: 1 bytes read" |
| 6766 | |
| 6767 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6768 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6769 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6770 | "$P_SRV dtls=1 force_version=dtls12 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6771 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6772 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6773 | 0 \ |
| 6774 | -s "Read from client: 1 bytes read" |
| 6775 | |
| 6776 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6777 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6778 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6779 | "$P_SRV dtls=1 force_version=dtls12 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6780 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6781 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6782 | 0 \ |
| 6783 | -s "Read from client: 1 bytes read" |
| 6784 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6785 | # Tests for small server packets |
| 6786 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6787 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 6788 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 6789 | "$P_CLI force_version=ssl3 \ |
| 6790 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6791 | 0 \ |
| 6792 | -c "Read from server: 1 bytes read" |
| 6793 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6794 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 6795 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6796 | "$P_CLI force_version=ssl3 \ |
| 6797 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6798 | 0 \ |
| 6799 | -c "Read from server: 1 bytes read" |
| 6800 | |
| 6801 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 6802 | "$P_SRV response_size=1" \ |
| 6803 | "$P_CLI force_version=tls1 \ |
| 6804 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6805 | 0 \ |
| 6806 | -c "Read from server: 1 bytes read" |
| 6807 | |
| 6808 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 6809 | "$P_SRV response_size=1" \ |
| 6810 | "$P_CLI force_version=tls1 etm=0 \ |
| 6811 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6812 | 0 \ |
| 6813 | -c "Read from server: 1 bytes read" |
| 6814 | |
| 6815 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6816 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 6817 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6818 | "$P_CLI force_version=tls1 \ |
| 6819 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6820 | 0 \ |
| 6821 | -c "Read from server: 1 bytes read" |
| 6822 | |
| 6823 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6824 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 6825 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6826 | "$P_CLI force_version=tls1 \ |
| 6827 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6828 | 0 \ |
| 6829 | -c "Read from server: 1 bytes read" |
| 6830 | |
| 6831 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 6832 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6833 | "$P_CLI force_version=tls1 \ |
| 6834 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6835 | 0 \ |
| 6836 | -c "Read from server: 1 bytes read" |
| 6837 | |
| 6838 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 6839 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6840 | "$P_CLI force_version=tls1 \ |
| 6841 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6842 | 0 \ |
| 6843 | -c "Read from server: 1 bytes read" |
| 6844 | |
| 6845 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6846 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 6847 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6848 | "$P_CLI force_version=tls1 \ |
| 6849 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6850 | 0 \ |
| 6851 | -c "Read from server: 1 bytes read" |
| 6852 | |
| 6853 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6854 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 6855 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6856 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 6857 | trunc_hmac=1 etm=0" \ |
| 6858 | 0 \ |
| 6859 | -c "Read from server: 1 bytes read" |
| 6860 | |
| 6861 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 6862 | "$P_SRV response_size=1" \ |
| 6863 | "$P_CLI force_version=tls1_1 \ |
| 6864 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6865 | 0 \ |
| 6866 | -c "Read from server: 1 bytes read" |
| 6867 | |
| 6868 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 6869 | "$P_SRV response_size=1" \ |
| 6870 | "$P_CLI force_version=tls1_1 \ |
| 6871 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6872 | 0 \ |
| 6873 | -c "Read from server: 1 bytes read" |
| 6874 | |
| 6875 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6876 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 6877 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6878 | "$P_CLI force_version=tls1_1 \ |
| 6879 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6880 | 0 \ |
| 6881 | -c "Read from server: 1 bytes read" |
| 6882 | |
| 6883 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6884 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 6885 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 6886 | "$P_CLI force_version=tls1_1 \ |
| 6887 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6888 | 0 \ |
| 6889 | -c "Read from server: 1 bytes read" |
| 6890 | |
| 6891 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 6892 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6893 | "$P_CLI force_version=tls1_1 \ |
| 6894 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6895 | 0 \ |
| 6896 | -c "Read from server: 1 bytes read" |
| 6897 | |
| 6898 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 6899 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6900 | "$P_CLI force_version=tls1_1 \ |
| 6901 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6902 | 0 \ |
| 6903 | -c "Read from server: 1 bytes read" |
| 6904 | |
| 6905 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6906 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 6907 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6908 | "$P_CLI force_version=tls1_1 \ |
| 6909 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6910 | 0 \ |
| 6911 | -c "Read from server: 1 bytes read" |
| 6912 | |
| 6913 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6914 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 6915 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6916 | "$P_CLI force_version=tls1_1 \ |
| 6917 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6918 | 0 \ |
| 6919 | -c "Read from server: 1 bytes read" |
| 6920 | |
| 6921 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 6922 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6923 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6924 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 6925 | 0 \ |
| 6926 | -c "Read from server: 1 bytes read" |
| 6927 | |
| 6928 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 6929 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6930 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6931 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 6932 | 0 \ |
| 6933 | -c "Read from server: 1 bytes read" |
| 6934 | |
| 6935 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 6936 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6937 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6938 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 6939 | 0 \ |
| 6940 | -c "Read from server: 1 bytes read" |
| 6941 | |
| 6942 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6943 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 6944 | "$P_SRV response_size=1 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6945 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6946 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 6947 | 0 \ |
| 6948 | -c "Read from server: 1 bytes read" |
| 6949 | |
| 6950 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6951 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 6952 | "$P_SRV response_size=1 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6953 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6954 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 6955 | 0 \ |
| 6956 | -c "Read from server: 1 bytes read" |
| 6957 | |
| 6958 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 6959 | "$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] | 6960 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6961 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 6962 | 0 \ |
| 6963 | -c "Read from server: 1 bytes read" |
| 6964 | |
| 6965 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 6966 | "$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] | 6967 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6968 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 6969 | 0 \ |
| 6970 | -c "Read from server: 1 bytes read" |
| 6971 | |
| 6972 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6973 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 6974 | "$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] | 6975 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6976 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 6977 | 0 \ |
| 6978 | -c "Read from server: 1 bytes read" |
| 6979 | |
| 6980 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 6981 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 6982 | "$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] | 6983 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6984 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 6985 | 0 \ |
| 6986 | -c "Read from server: 1 bytes read" |
| 6987 | |
| 6988 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 6989 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6990 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6991 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 6992 | 0 \ |
| 6993 | -c "Read from server: 1 bytes read" |
| 6994 | |
| 6995 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 6996 | "$P_SRV response_size=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 6997 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6998 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6999 | 0 \ |
| 7000 | -c "Read from server: 1 bytes read" |
| 7001 | |
| 7002 | # Tests for small server packets in DTLS |
| 7003 | |
| 7004 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7005 | run_test "Small server packet DTLS 1.0" \ |
| 7006 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 7007 | "$P_CLI dtls=1 \ |
| 7008 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7009 | 0 \ |
| 7010 | -c "Read from server: 1 bytes read" |
| 7011 | |
| 7012 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7013 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 7014 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 7015 | "$P_CLI dtls=1 \ |
| 7016 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7017 | 0 \ |
| 7018 | -c "Read from server: 1 bytes read" |
| 7019 | |
| 7020 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7021 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7022 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 7023 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 7024 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 7025 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7026 | 0 \ |
| 7027 | -c "Read from server: 1 bytes read" |
| 7028 | |
| 7029 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7030 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7031 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 7032 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 7033 | "$P_CLI dtls=1 \ |
| 7034 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 7035 | 0 \ |
| 7036 | -c "Read from server: 1 bytes read" |
| 7037 | |
| 7038 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7039 | run_test "Small server packet DTLS 1.2" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7040 | "$P_SRV dtls=1 response_size=1 force_version=dtls12" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7041 | "$P_CLI dtls=1 \ |
| 7042 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7043 | 0 \ |
| 7044 | -c "Read from server: 1 bytes read" |
| 7045 | |
| 7046 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7047 | run_test "Small server packet DTLS 1.2, without EtM" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7048 | "$P_SRV dtls=1 response_size=1 force_version=dtls12 etm=0" \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7049 | "$P_CLI dtls=1 \ |
| 7050 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7051 | 0 \ |
| 7052 | -c "Read from server: 1 bytes read" |
| 7053 | |
| 7054 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7055 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7056 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7057 | "$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] | 7058 | "$P_CLI dtls=1 \ |
| 7059 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 7060 | 0 \ |
| 7061 | -c "Read from server: 1 bytes read" |
| 7062 | |
| 7063 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7064 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7065 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7066 | "$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] | 7067 | "$P_CLI dtls=1 \ |
| 7068 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 7069 | 0 \ |
| 7070 | -c "Read from server: 1 bytes read" |
| 7071 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 7072 | # A test for extensions in SSLv3 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7073 | requires_max_content_len 4096 |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 7074 | run_test "SSLv3 with extensions, server side" \ |
| 7075 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 7076 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 7077 | 0 \ |
| 7078 | -S "dumping 'client hello extensions'" \ |
| 7079 | -S "server hello, total extension length:" |
| 7080 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7081 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7082 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7083 | # How many fragments do we expect to write $1 bytes? |
| 7084 | fragments_for_write() { |
| 7085 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 7086 | } |
| 7087 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7088 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 7089 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7090 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7091 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7092 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7093 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7094 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7095 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7096 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7097 | "$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] | 7098 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 7099 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7100 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7101 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7102 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7103 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7104 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7105 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7106 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7107 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7108 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7109 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7110 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7111 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7112 | 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] | 7113 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7114 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 7115 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7116 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7117 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7118 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7119 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7120 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7121 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7122 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7123 | 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] | 7124 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7125 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7126 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7127 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7128 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7129 | 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] | 7130 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7131 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7132 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7133 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7134 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7135 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7136 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7137 | "$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] | 7138 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7139 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7140 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7141 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7142 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7143 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7144 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7145 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7146 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7147 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7148 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7149 | |
| 7150 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7151 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7152 | "$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] | 7153 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7154 | 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] | 7155 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7156 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7157 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7158 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7159 | 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] | 7160 | "$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] | 7161 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7162 | 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] | 7163 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7164 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7165 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7166 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7167 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7168 | "$P_SRV" \ |
| 7169 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 7170 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7171 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7172 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7173 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7174 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7175 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7176 | "$P_SRV" \ |
| 7177 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 7178 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7179 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7180 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7181 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7182 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7183 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7184 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7185 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7186 | 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] | 7187 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7188 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7189 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7190 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7191 | 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] | 7192 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7193 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7194 | 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] | 7195 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7196 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7197 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7198 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7199 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7200 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 7201 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7202 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7203 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7204 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7205 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7206 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7207 | "$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] | 7208 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7209 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7210 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7211 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7212 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7213 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7214 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7215 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7216 | "$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] | 7217 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7218 | 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] | 7219 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7220 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7221 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7222 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7223 | 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] | 7224 | "$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] | 7225 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7226 | 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] | 7227 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7228 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7229 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7230 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7231 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7232 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7233 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7234 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7235 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7236 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7237 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7238 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7239 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7240 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7241 | "$P_CLI request_size=16384 force_version=tls12 etm=0 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7242 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7243 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7244 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7245 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7246 | 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] | 7247 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7248 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 7249 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7250 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7251 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7252 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7253 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7254 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7255 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7256 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7257 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7258 | 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] | 7259 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7260 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7261 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7262 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7263 | 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] | 7264 | "$P_SRV trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7265 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7266 | 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] | 7267 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7268 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7269 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7270 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7271 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 7272 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7273 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7274 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7275 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7276 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7277 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7278 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7279 | 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] | 7280 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7281 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7282 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7283 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7284 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7285 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 7286 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7287 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7288 | "$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] | 7289 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7290 | 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] | 7291 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7292 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7293 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 7294 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7295 | 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] | 7296 | "$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] | 7297 | "$P_CLI request_size=16384 force_version=tls12 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 7298 | 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] | 7299 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7300 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7301 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7302 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7303 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7304 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7305 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7306 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7307 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7308 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7309 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7310 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7311 | 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] | 7312 | "$P_SRV" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7313 | "$P_CLI request_size=16384 force_version=tls12 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7314 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7315 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 7316 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 7317 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 7318 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7319 | # Test for large server packets |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7320 | # 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] | 7321 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 7322 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7323 | "$P_CLI force_version=ssl3 \ |
| 7324 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7325 | 0 \ |
| 7326 | -c "Read from server: 16384 bytes read" |
| 7327 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 7328 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 7329 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 7330 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 7331 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 7332 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7333 | 0 \ |
| 7334 | -c "Read from server: 1 bytes read"\ |
| 7335 | -c "16383 bytes read"\ |
| 7336 | -C "Read from server: 16384 bytes read" |
| 7337 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7338 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 7339 | "$P_SRV response_size=16384" \ |
| 7340 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7341 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7342 | 0 \ |
| 7343 | -c "Read from server: 1 bytes read"\ |
| 7344 | -c "16383 bytes read"\ |
| 7345 | -C "Read from server: 16384 bytes read" |
| 7346 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7347 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 7348 | "$P_SRV response_size=16384" \ |
| 7349 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 7350 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7351 | 0 \ |
| 7352 | -c "Read from server: 1 bytes read"\ |
| 7353 | -c "16383 bytes read"\ |
| 7354 | -C "Read from server: 16384 bytes read" |
| 7355 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7356 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7357 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 7358 | "$P_SRV response_size=16384" \ |
| 7359 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 7360 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7361 | trunc_hmac=1" \ |
| 7362 | 0 \ |
| 7363 | -c "Read from server: 1 bytes read"\ |
| 7364 | -c "16383 bytes read"\ |
| 7365 | -C "Read from server: 16384 bytes read" |
| 7366 | |
| 7367 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7368 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 7369 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7370 | "$P_CLI force_version=tls1 \ |
| 7371 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7372 | trunc_hmac=1" \ |
| 7373 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7374 | -s "16384 bytes written in 1 fragments" \ |
| 7375 | -c "Read from server: 16384 bytes read" |
| 7376 | |
| 7377 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 7378 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7379 | "$P_CLI force_version=tls1 \ |
| 7380 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7381 | 0 \ |
| 7382 | -s "16384 bytes written in 1 fragments" \ |
| 7383 | -c "Read from server: 16384 bytes read" |
| 7384 | |
| 7385 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 7386 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7387 | "$P_CLI force_version=tls1 \ |
| 7388 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7389 | 0 \ |
| 7390 | -s "16384 bytes written in 1 fragments" \ |
| 7391 | -c "Read from server: 16384 bytes read" |
| 7392 | |
| 7393 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7394 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 7395 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7396 | "$P_CLI force_version=tls1 \ |
| 7397 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7398 | 0 \ |
| 7399 | -s "16384 bytes written in 1 fragments" \ |
| 7400 | -c "Read from server: 16384 bytes read" |
| 7401 | |
| 7402 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7403 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 7404 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7405 | "$P_CLI force_version=tls1 \ |
| 7406 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7407 | 0 \ |
| 7408 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7409 | -c "Read from server: 16384 bytes read" |
| 7410 | |
| 7411 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 7412 | "$P_SRV response_size=16384" \ |
| 7413 | "$P_CLI force_version=tls1_1 \ |
| 7414 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7415 | 0 \ |
| 7416 | -c "Read from server: 16384 bytes read" |
| 7417 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7418 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 7419 | "$P_SRV response_size=16384" \ |
| 7420 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 7421 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7422 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7423 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7424 | -c "Read from server: 16384 bytes read" |
| 7425 | |
| 7426 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7427 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 7428 | "$P_SRV response_size=16384" \ |
| 7429 | "$P_CLI force_version=tls1_1 \ |
| 7430 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7431 | trunc_hmac=1" \ |
| 7432 | 0 \ |
| 7433 | -c "Read from server: 16384 bytes read" |
| 7434 | |
| 7435 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7436 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 7437 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 7438 | "$P_CLI force_version=tls1_1 \ |
| 7439 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7440 | 0 \ |
| 7441 | -s "16384 bytes written in 1 fragments" \ |
| 7442 | -c "Read from server: 16384 bytes read" |
| 7443 | |
| 7444 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 7445 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7446 | "$P_CLI force_version=tls1_1 \ |
| 7447 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7448 | 0 \ |
| 7449 | -c "Read from server: 16384 bytes read" |
| 7450 | |
| 7451 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 7452 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7453 | "$P_CLI force_version=tls1_1 \ |
| 7454 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7455 | 0 \ |
| 7456 | -s "16384 bytes written in 1 fragments" \ |
| 7457 | -c "Read from server: 16384 bytes read" |
| 7458 | |
| 7459 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7460 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 7461 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7462 | "$P_CLI force_version=tls1_1 \ |
| 7463 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7464 | trunc_hmac=1" \ |
| 7465 | 0 \ |
| 7466 | -c "Read from server: 16384 bytes read" |
| 7467 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7468 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 7469 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 7470 | "$P_CLI force_version=tls1_1 \ |
| 7471 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7472 | 0 \ |
| 7473 | -s "16384 bytes written in 1 fragments" \ |
| 7474 | -c "Read from server: 16384 bytes read" |
| 7475 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7476 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 7477 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7478 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7479 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7480 | 0 \ |
| 7481 | -c "Read from server: 16384 bytes read" |
| 7482 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7483 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 7484 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7485 | "$P_CLI force_version=tls12 etm=0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7486 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 7487 | 0 \ |
| 7488 | -s "16384 bytes written in 1 fragments" \ |
| 7489 | -c "Read from server: 16384 bytes read" |
| 7490 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7491 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 7492 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7493 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7494 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 7495 | 0 \ |
| 7496 | -c "Read from server: 16384 bytes read" |
| 7497 | |
| 7498 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7499 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 7500 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7501 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7502 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 7503 | trunc_hmac=1" \ |
| 7504 | 0 \ |
| 7505 | -c "Read from server: 16384 bytes read" |
| 7506 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7507 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 7508 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7509 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7510 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 7511 | 0 \ |
| 7512 | -s "16384 bytes written in 1 fragments" \ |
| 7513 | -c "Read from server: 16384 bytes read" |
| 7514 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7515 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 7516 | "$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] | 7517 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7518 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 7519 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7520 | -s "16384 bytes written in 1 fragments" \ |
| 7521 | -c "Read from server: 16384 bytes read" |
| 7522 | |
| 7523 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 7524 | "$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] | 7525 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7526 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 7527 | 0 \ |
| 7528 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7529 | -c "Read from server: 16384 bytes read" |
| 7530 | |
| 7531 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7532 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 7533 | "$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] | 7534 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7535 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 7536 | trunc_hmac=1" \ |
| 7537 | 0 \ |
| 7538 | -c "Read from server: 16384 bytes read" |
| 7539 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7540 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 7541 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 7542 | "$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] | 7543 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7544 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 7545 | 0 \ |
| 7546 | -s "16384 bytes written in 1 fragments" \ |
| 7547 | -c "Read from server: 16384 bytes read" |
| 7548 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7549 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 7550 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7551 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7552 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 7553 | 0 \ |
| 7554 | -c "Read from server: 16384 bytes read" |
| 7555 | |
| 7556 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 7557 | "$P_SRV response_size=16384" \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 7558 | "$P_CLI force_version=tls12 \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7559 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 7560 | 0 \ |
| 7561 | -c "Read from server: 16384 bytes read" |
| 7562 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7563 | # Tests for restartable ECC |
| 7564 | |
| 7565 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7566 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7567 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7568 | "$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] | 7569 | 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] | 7570 | debug_level=1" \ |
| 7571 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7572 | -C "x509_verify_cert.*4b00" \ |
| 7573 | -C "mbedtls_pk_verify.*4b00" \ |
| 7574 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7575 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7576 | |
| 7577 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7578 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7579 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7580 | "$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] | 7581 | 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] | 7582 | debug_level=1 ec_max_ops=0" \ |
| 7583 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7584 | -C "x509_verify_cert.*4b00" \ |
| 7585 | -C "mbedtls_pk_verify.*4b00" \ |
| 7586 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7587 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7588 | |
| 7589 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7590 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7591 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7592 | "$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] | 7593 | 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] | 7594 | debug_level=1 ec_max_ops=65535" \ |
| 7595 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7596 | -C "x509_verify_cert.*4b00" \ |
| 7597 | -C "mbedtls_pk_verify.*4b00" \ |
| 7598 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7599 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7600 | |
| 7601 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7602 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7603 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7604 | "$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] | 7605 | 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] | 7606 | debug_level=1 ec_max_ops=1000" \ |
| 7607 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7608 | -c "x509_verify_cert.*4b00" \ |
| 7609 | -c "mbedtls_pk_verify.*4b00" \ |
| 7610 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7611 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7612 | |
| 7613 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7614 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 7615 | "$P_SRV auth_mode=required \ |
| 7616 | crt_file=data_files/server5-badsign.crt \ |
| 7617 | key_file=data_files/server5.key" \ |
| 7618 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7619 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7620 | debug_level=1 ec_max_ops=1000" \ |
| 7621 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7622 | -c "x509_verify_cert.*4b00" \ |
| 7623 | -C "mbedtls_pk_verify.*4b00" \ |
| 7624 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7625 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7626 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7627 | -c "! mbedtls_ssl_handshake returned" \ |
| 7628 | -c "X509 - Certificate verification failed" |
| 7629 | |
| 7630 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7631 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 7632 | "$P_SRV auth_mode=required \ |
| 7633 | crt_file=data_files/server5-badsign.crt \ |
| 7634 | key_file=data_files/server5.key" \ |
| 7635 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7636 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7637 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 7638 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7639 | -c "x509_verify_cert.*4b00" \ |
| 7640 | -c "mbedtls_pk_verify.*4b00" \ |
| 7641 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7642 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7643 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 7644 | -C "! mbedtls_ssl_handshake returned" \ |
| 7645 | -C "X509 - Certificate verification failed" |
| 7646 | |
| 7647 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7648 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 7649 | "$P_SRV auth_mode=required \ |
| 7650 | crt_file=data_files/server5-badsign.crt \ |
| 7651 | key_file=data_files/server5.key" \ |
| 7652 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7653 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7654 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 7655 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7656 | -C "x509_verify_cert.*4b00" \ |
| 7657 | -c "mbedtls_pk_verify.*4b00" \ |
| 7658 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7659 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7660 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 7661 | -C "! mbedtls_ssl_handshake returned" \ |
| 7662 | -C "X509 - Certificate verification failed" |
| 7663 | |
| 7664 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7665 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7666 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7667 | "$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] | 7668 | 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] | 7669 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 7670 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7671 | -c "x509_verify_cert.*4b00" \ |
| 7672 | -c "mbedtls_pk_verify.*4b00" \ |
| 7673 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7674 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7675 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7676 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7677 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 7678 | "$P_SRV" \ |
| 7679 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7680 | debug_level=1 ec_max_ops=1000" \ |
| 7681 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7682 | -c "x509_verify_cert.*4b00" \ |
| 7683 | -c "mbedtls_pk_verify.*4b00" \ |
| 7684 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 7685 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7686 | |
| 7687 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 7688 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 7689 | "$P_SRV psk=abc123" \ |
| 7690 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 7691 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 7692 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7693 | -C "x509_verify_cert.*4b00" \ |
| 7694 | -C "mbedtls_pk_verify.*4b00" \ |
| 7695 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 7696 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7697 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7698 | # Tests of asynchronous private key support in SSL |
| 7699 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7700 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7701 | run_test "SSL async private: sign, delay=0" \ |
| 7702 | "$P_SRV \ |
| 7703 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7704 | "$P_CLI" \ |
| 7705 | 0 \ |
| 7706 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7707 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7708 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7709 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7710 | run_test "SSL async private: sign, delay=1" \ |
| 7711 | "$P_SRV \ |
| 7712 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7713 | "$P_CLI" \ |
| 7714 | 0 \ |
| 7715 | -s "Async sign callback: using key slot " \ |
| 7716 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7717 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7718 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7719 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7720 | run_test "SSL async private: sign, delay=2" \ |
| 7721 | "$P_SRV \ |
| 7722 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 7723 | "$P_CLI" \ |
| 7724 | 0 \ |
| 7725 | -s "Async sign callback: using key slot " \ |
| 7726 | -U "Async sign callback: using key slot " \ |
| 7727 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 7728 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7729 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7730 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7731 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 7732 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 7733 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7734 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 7735 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 7736 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 7737 | "$P_CLI force_version=tls1_1" \ |
| 7738 | 0 \ |
| 7739 | -s "Async sign callback: using key slot " \ |
| 7740 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 7741 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7742 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7743 | run_test "SSL async private: sign, SNI" \ |
| 7744 | "$P_SRV debug_level=3 \ |
| 7745 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 7746 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 7747 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 7748 | "$P_CLI server_name=polarssl.example" \ |
| 7749 | 0 \ |
| 7750 | -s "Async sign callback: using key slot " \ |
| 7751 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7752 | -s "parse ServerName extension" \ |
| 7753 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 7754 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 7755 | |
| 7756 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7757 | run_test "SSL async private: decrypt, delay=0" \ |
| 7758 | "$P_SRV \ |
| 7759 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7760 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7761 | 0 \ |
| 7762 | -s "Async decrypt callback: using key slot " \ |
| 7763 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7764 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7765 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7766 | run_test "SSL async private: decrypt, delay=1" \ |
| 7767 | "$P_SRV \ |
| 7768 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7769 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7770 | 0 \ |
| 7771 | -s "Async decrypt callback: using key slot " \ |
| 7772 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7773 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7774 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7775 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7776 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 7777 | "$P_SRV psk=abc123 \ |
| 7778 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 7779 | "$P_CLI psk=abc123 \ |
| 7780 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7781 | 0 \ |
| 7782 | -s "Async decrypt callback: using key slot " \ |
| 7783 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7784 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7785 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7786 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 7787 | "$P_SRV psk=abc123 \ |
| 7788 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7789 | "$P_CLI psk=abc123 \ |
| 7790 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 7791 | 0 \ |
| 7792 | -s "Async decrypt callback: using key slot " \ |
| 7793 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 7794 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 7795 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7796 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7797 | run_test "SSL async private: sign callback not present" \ |
| 7798 | "$P_SRV \ |
| 7799 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 7800 | "$P_CLI; [ \$? -eq 1 ] && |
| 7801 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7802 | 0 \ |
| 7803 | -S "Async sign callback" \ |
| 7804 | -s "! mbedtls_ssl_handshake returned" \ |
| 7805 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 7806 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 7807 | -s "Successful connection" |
| 7808 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7809 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7810 | run_test "SSL async private: decrypt callback not present" \ |
| 7811 | "$P_SRV debug_level=1 \ |
| 7812 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 7813 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 7814 | [ \$? -eq 1 ] && $P_CLI" \ |
| 7815 | 0 \ |
| 7816 | -S "Async decrypt callback" \ |
| 7817 | -s "! mbedtls_ssl_handshake returned" \ |
| 7818 | -s "got no RSA private key" \ |
| 7819 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 7820 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7821 | |
| 7822 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7823 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7824 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7825 | "$P_SRV \ |
| 7826 | async_operations=s async_private_delay1=1 \ |
| 7827 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7828 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7829 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 7830 | 0 \ |
| 7831 | -s "Async sign callback: using key slot 0," \ |
| 7832 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7833 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7834 | |
| 7835 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7836 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7837 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7838 | "$P_SRV \ |
| 7839 | async_operations=s async_private_delay2=1 \ |
| 7840 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7841 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7842 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7843 | 0 \ |
| 7844 | -s "Async sign callback: using key slot 0," \ |
| 7845 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7846 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7847 | |
| 7848 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7849 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7850 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7851 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7852 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7853 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7854 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7855 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7856 | 0 \ |
| 7857 | -s "Async sign callback: using key slot 1," \ |
| 7858 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7859 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7860 | |
| 7861 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7862 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7863 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7864 | "$P_SRV \ |
| 7865 | async_operations=s async_private_delay1=1 \ |
| 7866 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7867 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7868 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7869 | 0 \ |
| 7870 | -s "Async sign callback: no key matches this certificate." |
| 7871 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7872 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7873 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7874 | "$P_SRV \ |
| 7875 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7876 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7877 | "$P_CLI" \ |
| 7878 | 1 \ |
| 7879 | -s "Async sign callback: injected error" \ |
| 7880 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7881 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7882 | -s "! mbedtls_ssl_handshake returned" |
| 7883 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7884 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7885 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7886 | "$P_SRV \ |
| 7887 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7888 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7889 | "$P_CLI" \ |
| 7890 | 1 \ |
| 7891 | -s "Async sign callback: using key slot " \ |
| 7892 | -S "Async resume" \ |
| 7893 | -s "Async cancel" |
| 7894 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7895 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7896 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7897 | "$P_SRV \ |
| 7898 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7899 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7900 | "$P_CLI" \ |
| 7901 | 1 \ |
| 7902 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7903 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7904 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7905 | -s "! mbedtls_ssl_handshake returned" |
| 7906 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7907 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7908 | run_test "SSL async private: decrypt, error in start" \ |
| 7909 | "$P_SRV \ |
| 7910 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7911 | async_private_error=1" \ |
| 7912 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7913 | 1 \ |
| 7914 | -s "Async decrypt callback: injected error" \ |
| 7915 | -S "Async resume" \ |
| 7916 | -S "Async cancel" \ |
| 7917 | -s "! mbedtls_ssl_handshake returned" |
| 7918 | |
| 7919 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7920 | run_test "SSL async private: decrypt, cancel after start" \ |
| 7921 | "$P_SRV \ |
| 7922 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7923 | async_private_error=2" \ |
| 7924 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7925 | 1 \ |
| 7926 | -s "Async decrypt callback: using key slot " \ |
| 7927 | -S "Async resume" \ |
| 7928 | -s "Async cancel" |
| 7929 | |
| 7930 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 7931 | run_test "SSL async private: decrypt, error in resume" \ |
| 7932 | "$P_SRV \ |
| 7933 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 7934 | async_private_error=3" \ |
| 7935 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7936 | 1 \ |
| 7937 | -s "Async decrypt callback: using key slot " \ |
| 7938 | -s "Async resume callback: decrypt done but injected error" \ |
| 7939 | -S "Async cancel" \ |
| 7940 | -s "! mbedtls_ssl_handshake returned" |
| 7941 | |
| 7942 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7943 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7944 | "$P_SRV \ |
| 7945 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7946 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7947 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7948 | 0 \ |
| 7949 | -s "Async cancel" \ |
| 7950 | -s "! mbedtls_ssl_handshake returned" \ |
| 7951 | -s "Async resume" \ |
| 7952 | -s "Successful connection" |
| 7953 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7954 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7955 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7956 | "$P_SRV \ |
| 7957 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 7958 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7959 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 7960 | 0 \ |
| 7961 | -s "! mbedtls_ssl_handshake returned" \ |
| 7962 | -s "Async resume" \ |
| 7963 | -s "Successful connection" |
| 7964 | |
| 7965 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7966 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7967 | 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] | 7968 | "$P_SRV \ |
| 7969 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 7970 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7971 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7972 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7973 | [ \$? -eq 1 ] && |
| 7974 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7975 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7976 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7977 | -S "Async resume" \ |
| 7978 | -s "Async cancel" \ |
| 7979 | -s "! mbedtls_ssl_handshake returned" \ |
| 7980 | -s "Async sign callback: no key matches this certificate." \ |
| 7981 | -s "Successful connection" |
| 7982 | |
| 7983 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7984 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7985 | 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] | 7986 | "$P_SRV \ |
| 7987 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 7988 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 7989 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7990 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 7991 | [ \$? -eq 1 ] && |
| 7992 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 7993 | 0 \ |
| 7994 | -s "Async resume" \ |
| 7995 | -s "! mbedtls_ssl_handshake returned" \ |
| 7996 | -s "Async sign callback: no key matches this certificate." \ |
| 7997 | -s "Successful connection" |
| 7998 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7999 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8000 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8001 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8002 | "$P_SRV \ |
| 8003 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8004 | exchanges=2 renegotiation=1" \ |
| 8005 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8006 | 0 \ |
| 8007 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8008 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8009 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8010 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8011 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8012 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8013 | "$P_SRV \ |
| 8014 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8015 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8016 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 8017 | 0 \ |
| 8018 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8019 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 8020 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8021 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8022 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8023 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8024 | "$P_SRV \ |
| 8025 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8026 | exchanges=2 renegotiation=1" \ |
| 8027 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 8028 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8029 | 0 \ |
| 8030 | -s "Async decrypt callback: using key slot " \ |
| 8031 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 8032 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 8033 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8034 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 8035 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 8036 | "$P_SRV \ |
| 8037 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 8038 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 8039 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 8040 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8041 | 0 \ |
| 8042 | -s "Async decrypt callback: using key slot " \ |
| 8043 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 8044 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8045 | # Tests for ECC extensions (rfc 4492) |
| 8046 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8047 | requires_config_enabled MBEDTLS_AES_C |
| 8048 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8049 | requires_config_enabled MBEDTLS_SHA256_C |
| 8050 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8051 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 8052 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8053 | "$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] | 8054 | 0 \ |
| 8055 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 8056 | -C "client hello, adding supported_point_formats extension" \ |
| 8057 | -S "found supported elliptic curves extension" \ |
| 8058 | -S "found supported point formats extension" |
| 8059 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8060 | requires_config_enabled MBEDTLS_AES_C |
| 8061 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8062 | requires_config_enabled MBEDTLS_SHA256_C |
| 8063 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8064 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8065 | "$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] | 8066 | "$P_CLI debug_level=3" \ |
| 8067 | 0 \ |
| 8068 | -C "found supported_point_formats extension" \ |
| 8069 | -S "server hello, supported_point_formats extension" |
| 8070 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8071 | requires_config_enabled MBEDTLS_AES_C |
| 8072 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8073 | requires_config_enabled MBEDTLS_SHA256_C |
| 8074 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8075 | run_test "Force an ECC ciphersuite in the client side" \ |
| 8076 | "$P_SRV debug_level=3" \ |
| 8077 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8078 | 0 \ |
| 8079 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 8080 | -c "client hello, adding supported_point_formats extension" \ |
| 8081 | -s "found supported elliptic curves extension" \ |
| 8082 | -s "found supported point formats extension" |
| 8083 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 8084 | requires_config_enabled MBEDTLS_AES_C |
| 8085 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8086 | requires_config_enabled MBEDTLS_SHA256_C |
| 8087 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 8088 | run_test "Force an ECC ciphersuite in the server side" \ |
| 8089 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 8090 | "$P_CLI debug_level=3" \ |
| 8091 | 0 \ |
| 8092 | -c "found supported_point_formats extension" \ |
| 8093 | -s "server hello, supported_point_formats extension" |
| 8094 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8095 | # Tests for DTLS HelloVerifyRequest |
| 8096 | |
| 8097 | run_test "DTLS cookie: enabled" \ |
| 8098 | "$P_SRV dtls=1 debug_level=2" \ |
| 8099 | "$P_CLI dtls=1 debug_level=2" \ |
| 8100 | 0 \ |
| 8101 | -s "cookie verification failed" \ |
| 8102 | -s "cookie verification passed" \ |
| 8103 | -S "cookie verification skipped" \ |
| 8104 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8105 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8106 | -S "SSL - The requested feature is not available" |
| 8107 | |
| 8108 | run_test "DTLS cookie: disabled" \ |
| 8109 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 8110 | "$P_CLI dtls=1 debug_level=2" \ |
| 8111 | 0 \ |
| 8112 | -S "cookie verification failed" \ |
| 8113 | -S "cookie verification passed" \ |
| 8114 | -s "cookie verification skipped" \ |
| 8115 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8116 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8117 | -S "SSL - The requested feature is not available" |
| 8118 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8119 | run_test "DTLS cookie: default (failing)" \ |
| 8120 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 8121 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 8122 | 1 \ |
| 8123 | -s "cookie verification failed" \ |
| 8124 | -S "cookie verification passed" \ |
| 8125 | -S "cookie verification skipped" \ |
| 8126 | -C "received hello verify request" \ |
| 8127 | -S "hello verification requested" \ |
| 8128 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8129 | |
| 8130 | requires_ipv6 |
| 8131 | run_test "DTLS cookie: enabled, IPv6" \ |
| 8132 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 8133 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 8134 | 0 \ |
| 8135 | -s "cookie verification failed" \ |
| 8136 | -s "cookie verification passed" \ |
| 8137 | -S "cookie verification skipped" \ |
| 8138 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8139 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 8140 | -S "SSL - The requested feature is not available" |
| 8141 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8142 | run_test "DTLS cookie: enabled, nbio" \ |
| 8143 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 8144 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8145 | 0 \ |
| 8146 | -s "cookie verification failed" \ |
| 8147 | -s "cookie verification passed" \ |
| 8148 | -S "cookie verification skipped" \ |
| 8149 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 8150 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 8151 | -S "SSL - The requested feature is not available" |
| 8152 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8153 | # Tests for client reconnecting from the same port with DTLS |
| 8154 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8155 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8156 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8157 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8158 | "$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] | 8159 | 0 \ |
| 8160 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8161 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8162 | -S "Client initiated reconnection from same port" |
| 8163 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8164 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8165 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8166 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 8167 | "$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] | 8168 | 0 \ |
| 8169 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8170 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8171 | -s "Client initiated reconnection from same port" |
| 8172 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8173 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 8174 | 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] | 8175 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 8176 | "$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] | 8177 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8178 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 8179 | -s "Client initiated reconnection from same port" |
| 8180 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 8181 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 8182 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 8183 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 8184 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 8185 | 0 \ |
| 8186 | -S "The operation timed out" \ |
| 8187 | -s "Client initiated reconnection from same port" |
| 8188 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8189 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 8190 | "$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] | 8191 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 8192 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 8193 | -s "The operation timed out" \ |
| 8194 | -S "Client initiated reconnection from same port" |
| 8195 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 8196 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 8197 | -p "$P_PXY inject_clihlo=1" \ |
| 8198 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 8199 | "$P_CLI dtls=1 exchanges=2" \ |
| 8200 | 0 \ |
| 8201 | -s "possible client reconnect from the same port" \ |
| 8202 | -S "Client initiated reconnection from same port" |
| 8203 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8204 | # Tests for various cases of client authentication with DTLS |
| 8205 | # (focused on handshake flows and message parsing) |
| 8206 | |
| 8207 | run_test "DTLS client auth: required" \ |
| 8208 | "$P_SRV dtls=1 auth_mode=required" \ |
| 8209 | "$P_CLI dtls=1" \ |
| 8210 | 0 \ |
| 8211 | -s "Verifying peer X.509 certificate... ok" |
| 8212 | |
| 8213 | run_test "DTLS client auth: optional, client has no cert" \ |
| 8214 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 8215 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 8216 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8217 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8218 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8219 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8220 | "$P_SRV dtls=1 auth_mode=none" \ |
| 8221 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 8222 | 0 \ |
| 8223 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 8224 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 8225 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 8226 | run_test "DTLS wrong PSK: badmac alert" \ |
| 8227 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 8228 | "$P_CLI dtls=1 psk=abc124" \ |
| 8229 | 1 \ |
| 8230 | -s "SSL - Verification of the message MAC failed" \ |
| 8231 | -c "SSL - A fatal alert message was received from our peer" |
| 8232 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 8233 | # Tests for receiving fragmented handshake messages with DTLS |
| 8234 | |
| 8235 | requires_gnutls |
| 8236 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 8237 | "$G_SRV -u --mtu 2048 -a" \ |
| 8238 | "$P_CLI dtls=1 debug_level=2" \ |
| 8239 | 0 \ |
| 8240 | -C "found fragmented DTLS handshake message" \ |
| 8241 | -C "error" |
| 8242 | |
| 8243 | requires_gnutls |
| 8244 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 8245 | "$G_SRV -u --mtu 512" \ |
| 8246 | "$P_CLI dtls=1 debug_level=2" \ |
| 8247 | 0 \ |
| 8248 | -c "found fragmented DTLS handshake message" \ |
| 8249 | -C "error" |
| 8250 | |
| 8251 | requires_gnutls |
| 8252 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 8253 | "$G_SRV -u --mtu 128" \ |
| 8254 | "$P_CLI dtls=1 debug_level=2" \ |
| 8255 | 0 \ |
| 8256 | -c "found fragmented DTLS handshake message" \ |
| 8257 | -C "error" |
| 8258 | |
| 8259 | requires_gnutls |
| 8260 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 8261 | "$G_SRV -u --mtu 128" \ |
| 8262 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8263 | 0 \ |
| 8264 | -c "found fragmented DTLS handshake message" \ |
| 8265 | -C "error" |
| 8266 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8267 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8268 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8269 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 8270 | "$G_SRV -u --mtu 256" \ |
| 8271 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8272 | 0 \ |
| 8273 | -c "found fragmented DTLS handshake message" \ |
| 8274 | -c "client hello, adding renegotiation extension" \ |
| 8275 | -c "found renegotiation extension" \ |
| 8276 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8277 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8278 | -C "error" \ |
| 8279 | -s "Extra-header:" |
| 8280 | |
| 8281 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8282 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8283 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 8284 | "$G_SRV -u --mtu 256" \ |
| 8285 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 8286 | 0 \ |
| 8287 | -c "found fragmented DTLS handshake message" \ |
| 8288 | -c "client hello, adding renegotiation extension" \ |
| 8289 | -c "found renegotiation extension" \ |
| 8290 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 8291 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 8292 | -C "error" \ |
| 8293 | -s "Extra-header:" |
| 8294 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8295 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 8296 | "$O_SRV -dtls1 -mtu 2048" \ |
| 8297 | "$P_CLI dtls=1 debug_level=2" \ |
| 8298 | 0 \ |
| 8299 | -C "found fragmented DTLS handshake message" \ |
| 8300 | -C "error" |
| 8301 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8302 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 8303 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8304 | "$P_CLI dtls=1 debug_level=2" \ |
| 8305 | 0 \ |
| 8306 | -c "found fragmented DTLS handshake message" \ |
| 8307 | -C "error" |
| 8308 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8309 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8310 | "$O_SRV -dtls1 -mtu 256" \ |
| 8311 | "$P_CLI dtls=1 debug_level=2" \ |
| 8312 | 0 \ |
| 8313 | -c "found fragmented DTLS handshake message" \ |
| 8314 | -C "error" |
| 8315 | |
| 8316 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 8317 | "$O_SRV -dtls1 -mtu 256" \ |
| 8318 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 8319 | 0 \ |
| 8320 | -c "found fragmented DTLS handshake message" \ |
| 8321 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8322 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8323 | # Tests for sending fragmented handshake messages with DTLS |
| 8324 | # |
| 8325 | # Use client auth when we need the client to send large messages, |
| 8326 | # and use large cert chains on both sides too (the long chains we have all use |
| 8327 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 8328 | # Sizes reached (UDP payload): |
| 8329 | # - 2037B for server certificate |
| 8330 | # - 1542B for client certificate |
| 8331 | # - 1013B for newsessionticket |
| 8332 | # - all others below 512B |
| 8333 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 8334 | |
| 8335 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8336 | requires_config_enabled MBEDTLS_RSA_C |
| 8337 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8338 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8339 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8340 | run_test "DTLS fragmenting: none (for reference)" \ |
| 8341 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8342 | crt_file=data_files/server7_int-ca.crt \ |
| 8343 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8344 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8345 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8346 | "$P_CLI dtls=1 debug_level=2 \ |
| 8347 | crt_file=data_files/server8_int-ca2.crt \ |
| 8348 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8349 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8350 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8351 | 0 \ |
| 8352 | -S "found fragmented DTLS handshake message" \ |
| 8353 | -C "found fragmented DTLS handshake message" \ |
| 8354 | -C "error" |
| 8355 | |
| 8356 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8357 | requires_config_enabled MBEDTLS_RSA_C |
| 8358 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8359 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8360 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8361 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8362 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8363 | crt_file=data_files/server7_int-ca.crt \ |
| 8364 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8365 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8366 | max_frag_len=1024" \ |
| 8367 | "$P_CLI dtls=1 debug_level=2 \ |
| 8368 | crt_file=data_files/server8_int-ca2.crt \ |
| 8369 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8370 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8371 | max_frag_len=2048" \ |
| 8372 | 0 \ |
| 8373 | -S "found fragmented DTLS handshake message" \ |
| 8374 | -c "found fragmented DTLS handshake message" \ |
| 8375 | -C "error" |
| 8376 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8377 | # With the MFL extension, the server has no way of forcing |
| 8378 | # the client to not exceed a certain MTU; hence, the following |
| 8379 | # test can't be replicated with an MTU proxy such as the one |
| 8380 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8381 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8382 | requires_config_enabled MBEDTLS_RSA_C |
| 8383 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8384 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8385 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8386 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8387 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8388 | crt_file=data_files/server7_int-ca.crt \ |
| 8389 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8390 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8391 | max_frag_len=512" \ |
| 8392 | "$P_CLI dtls=1 debug_level=2 \ |
| 8393 | crt_file=data_files/server8_int-ca2.crt \ |
| 8394 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8395 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 8396 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8397 | 0 \ |
| 8398 | -S "found fragmented DTLS handshake message" \ |
| 8399 | -c "found fragmented DTLS handshake message" \ |
| 8400 | -C "error" |
| 8401 | |
| 8402 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8403 | requires_config_enabled MBEDTLS_RSA_C |
| 8404 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8405 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8406 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8407 | 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] | 8408 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8409 | crt_file=data_files/server7_int-ca.crt \ |
| 8410 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8411 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8412 | max_frag_len=2048" \ |
| 8413 | "$P_CLI dtls=1 debug_level=2 \ |
| 8414 | crt_file=data_files/server8_int-ca2.crt \ |
| 8415 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8416 | hs_timeout=2500-60000 \ |
| 8417 | max_frag_len=1024" \ |
| 8418 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8419 | -S "found fragmented DTLS handshake message" \ |
| 8420 | -c "found fragmented DTLS handshake message" \ |
| 8421 | -C "error" |
| 8422 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8423 | # While not required by the standard defining the MFL extension |
| 8424 | # (according to which it only applies to records, not to datagrams), |
| 8425 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8426 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8427 | # to the peer. |
| 8428 | # The next test checks that no datagrams significantly larger than the |
| 8429 | # negotiated MFL are sent. |
| 8430 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8431 | requires_config_enabled MBEDTLS_RSA_C |
| 8432 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8433 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8434 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8435 | 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] | 8436 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8437 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 8438 | crt_file=data_files/server7_int-ca.crt \ |
| 8439 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8440 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8441 | max_frag_len=2048" \ |
| 8442 | "$P_CLI dtls=1 debug_level=2 \ |
| 8443 | crt_file=data_files/server8_int-ca2.crt \ |
| 8444 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8445 | hs_timeout=2500-60000 \ |
| 8446 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8447 | 0 \ |
| 8448 | -S "found fragmented DTLS handshake message" \ |
| 8449 | -c "found fragmented DTLS handshake message" \ |
| 8450 | -C "error" |
| 8451 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8452 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8453 | requires_config_enabled MBEDTLS_RSA_C |
| 8454 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8455 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8456 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8457 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8458 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8459 | crt_file=data_files/server7_int-ca.crt \ |
| 8460 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8461 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8462 | max_frag_len=2048" \ |
| 8463 | "$P_CLI dtls=1 debug_level=2 \ |
| 8464 | crt_file=data_files/server8_int-ca2.crt \ |
| 8465 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8466 | hs_timeout=2500-60000 \ |
| 8467 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 8468 | 0 \ |
| 8469 | -s "found fragmented DTLS handshake message" \ |
| 8470 | -c "found fragmented DTLS handshake message" \ |
| 8471 | -C "error" |
| 8472 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8473 | # While not required by the standard defining the MFL extension |
| 8474 | # (according to which it only applies to records, not to datagrams), |
| 8475 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 8476 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 8477 | # to the peer. |
| 8478 | # The next test checks that no datagrams significantly larger than the |
| 8479 | # negotiated MFL are sent. |
| 8480 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8481 | requires_config_enabled MBEDTLS_RSA_C |
| 8482 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8483 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8484 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8485 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 8486 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8487 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8488 | crt_file=data_files/server7_int-ca.crt \ |
| 8489 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8490 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8491 | max_frag_len=2048" \ |
| 8492 | "$P_CLI dtls=1 debug_level=2 \ |
| 8493 | crt_file=data_files/server8_int-ca2.crt \ |
| 8494 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8495 | hs_timeout=2500-60000 \ |
| 8496 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8497 | 0 \ |
| 8498 | -s "found fragmented DTLS handshake message" \ |
| 8499 | -c "found fragmented DTLS handshake message" \ |
| 8500 | -C "error" |
| 8501 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8502 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8503 | requires_config_enabled MBEDTLS_RSA_C |
| 8504 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8505 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8506 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 8507 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8508 | crt_file=data_files/server7_int-ca.crt \ |
| 8509 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8510 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8511 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8512 | "$P_CLI dtls=1 debug_level=2 \ |
| 8513 | crt_file=data_files/server8_int-ca2.crt \ |
| 8514 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8515 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8516 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8517 | 0 \ |
| 8518 | -S "found fragmented DTLS handshake message" \ |
| 8519 | -C "found fragmented DTLS handshake message" \ |
| 8520 | -C "error" |
| 8521 | |
| 8522 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8523 | requires_config_enabled MBEDTLS_RSA_C |
| 8524 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8525 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8526 | run_test "DTLS fragmenting: client (MTU)" \ |
| 8527 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8528 | crt_file=data_files/server7_int-ca.crt \ |
| 8529 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8530 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8531 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8532 | "$P_CLI dtls=1 debug_level=2 \ |
| 8533 | crt_file=data_files/server8_int-ca2.crt \ |
| 8534 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8535 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8536 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8537 | 0 \ |
| 8538 | -s "found fragmented DTLS handshake message" \ |
| 8539 | -C "found fragmented DTLS handshake message" \ |
| 8540 | -C "error" |
| 8541 | |
| 8542 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8543 | requires_config_enabled MBEDTLS_RSA_C |
| 8544 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8545 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8546 | run_test "DTLS fragmenting: server (MTU)" \ |
| 8547 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8548 | crt_file=data_files/server7_int-ca.crt \ |
| 8549 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8550 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8551 | mtu=512" \ |
| 8552 | "$P_CLI dtls=1 debug_level=2 \ |
| 8553 | crt_file=data_files/server8_int-ca2.crt \ |
| 8554 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8555 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8556 | mtu=2048" \ |
| 8557 | 0 \ |
| 8558 | -S "found fragmented DTLS handshake message" \ |
| 8559 | -c "found fragmented DTLS handshake message" \ |
| 8560 | -C "error" |
| 8561 | |
| 8562 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8563 | requires_config_enabled MBEDTLS_RSA_C |
| 8564 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8565 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8566 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8567 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8568 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8569 | crt_file=data_files/server7_int-ca.crt \ |
| 8570 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8571 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8572 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8573 | "$P_CLI dtls=1 debug_level=2 \ |
| 8574 | crt_file=data_files/server8_int-ca2.crt \ |
| 8575 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8576 | hs_timeout=2500-60000 \ |
| 8577 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8578 | 0 \ |
| 8579 | -s "found fragmented DTLS handshake message" \ |
| 8580 | -c "found fragmented DTLS handshake message" \ |
| 8581 | -C "error" |
| 8582 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8583 | # 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] | 8584 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8585 | requires_config_enabled MBEDTLS_RSA_C |
| 8586 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8587 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8588 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8589 | requires_config_enabled MBEDTLS_AES_C |
| 8590 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8591 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8592 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8593 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8594 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8595 | crt_file=data_files/server7_int-ca.crt \ |
| 8596 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8597 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8598 | mtu=512" \ |
| 8599 | "$P_CLI dtls=1 debug_level=2 \ |
| 8600 | crt_file=data_files/server8_int-ca2.crt \ |
| 8601 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8602 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8603 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8604 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8605 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8606 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8607 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8608 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8609 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8610 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8611 | # 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] | 8612 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 8613 | # retransmissions, but in some cases (like both the server and client using |
| 8614 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 8615 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8616 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8617 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8618 | requires_config_enabled MBEDTLS_RSA_C |
| 8619 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8620 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8621 | requires_config_enabled MBEDTLS_AES_C |
| 8622 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8623 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8624 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8625 | -p "$P_PXY mtu=508" \ |
| 8626 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8627 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8628 | key_file=data_files/server7.key \ |
| 8629 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8630 | "$P_CLI dtls=1 debug_level=2 \ |
| 8631 | crt_file=data_files/server8_int-ca2.crt \ |
| 8632 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8633 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8634 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8635 | 0 \ |
| 8636 | -s "found fragmented DTLS handshake message" \ |
| 8637 | -c "found fragmented DTLS handshake message" \ |
| 8638 | -C "error" |
| 8639 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8640 | # 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] | 8641 | only_with_valgrind |
| 8642 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8643 | requires_config_enabled MBEDTLS_RSA_C |
| 8644 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8645 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8646 | requires_config_enabled MBEDTLS_AES_C |
| 8647 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8648 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8649 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8650 | -p "$P_PXY mtu=508" \ |
| 8651 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8652 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8653 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8654 | hs_timeout=250-10000" \ |
| 8655 | "$P_CLI dtls=1 debug_level=2 \ |
| 8656 | crt_file=data_files/server8_int-ca2.crt \ |
| 8657 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8658 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8659 | hs_timeout=250-10000" \ |
| 8660 | 0 \ |
| 8661 | -s "found fragmented DTLS handshake message" \ |
| 8662 | -c "found fragmented DTLS handshake message" \ |
| 8663 | -C "error" |
| 8664 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8665 | # 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] | 8666 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8667 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8668 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8669 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8670 | requires_config_enabled MBEDTLS_RSA_C |
| 8671 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8672 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8673 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8674 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8675 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8676 | crt_file=data_files/server7_int-ca.crt \ |
| 8677 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8678 | hs_timeout=10000-60000 \ |
| 8679 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8680 | "$P_CLI dtls=1 debug_level=2 \ |
| 8681 | crt_file=data_files/server8_int-ca2.crt \ |
| 8682 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8683 | hs_timeout=10000-60000 \ |
| 8684 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8685 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8686 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8687 | -s "found fragmented DTLS handshake message" \ |
| 8688 | -c "found fragmented DTLS handshake message" \ |
| 8689 | -C "error" |
| 8690 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8691 | # 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] | 8692 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 8693 | # OTOH the client might resend if the server is to slow to reset after sending |
| 8694 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8695 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8696 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8697 | requires_config_enabled MBEDTLS_RSA_C |
| 8698 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8699 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8700 | requires_config_enabled MBEDTLS_AES_C |
| 8701 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8702 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8703 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8704 | -p "$P_PXY mtu=512" \ |
| 8705 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8706 | crt_file=data_files/server7_int-ca.crt \ |
| 8707 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8708 | hs_timeout=10000-60000 \ |
| 8709 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8710 | "$P_CLI dtls=1 debug_level=2 \ |
| 8711 | crt_file=data_files/server8_int-ca2.crt \ |
| 8712 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8713 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8714 | hs_timeout=10000-60000 \ |
| 8715 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8716 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8717 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8718 | -s "found fragmented DTLS handshake message" \ |
| 8719 | -c "found fragmented DTLS handshake message" \ |
| 8720 | -C "error" |
| 8721 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8722 | not_with_valgrind # spurious autoreduction due to timeout |
| 8723 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8724 | requires_config_enabled MBEDTLS_RSA_C |
| 8725 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8726 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8727 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8728 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8729 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8730 | crt_file=data_files/server7_int-ca.crt \ |
| 8731 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8732 | hs_timeout=10000-60000 \ |
| 8733 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8734 | "$P_CLI dtls=1 debug_level=2 \ |
| 8735 | crt_file=data_files/server8_int-ca2.crt \ |
| 8736 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8737 | hs_timeout=10000-60000 \ |
| 8738 | mtu=1024 nbio=2" \ |
| 8739 | 0 \ |
| 8740 | -S "autoreduction" \ |
| 8741 | -s "found fragmented DTLS handshake message" \ |
| 8742 | -c "found fragmented DTLS handshake message" \ |
| 8743 | -C "error" |
| 8744 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8745 | # 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] | 8746 | not_with_valgrind # spurious autoreduction due to timeout |
| 8747 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8748 | requires_config_enabled MBEDTLS_RSA_C |
| 8749 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8750 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8751 | requires_config_enabled MBEDTLS_AES_C |
| 8752 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8753 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8754 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 8755 | -p "$P_PXY mtu=512" \ |
| 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 | hs_timeout=10000-60000 \ |
| 8760 | mtu=512 nbio=2" \ |
| 8761 | "$P_CLI dtls=1 debug_level=2 \ |
| 8762 | crt_file=data_files/server8_int-ca2.crt \ |
| 8763 | key_file=data_files/server8.key \ |
| 8764 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 8765 | hs_timeout=10000-60000 \ |
| 8766 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8767 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8768 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8769 | -s "found fragmented DTLS handshake message" \ |
| 8770 | -c "found fragmented DTLS handshake message" \ |
| 8771 | -C "error" |
| 8772 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8773 | # 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] | 8774 | # This ensures things still work after session_reset(). |
| 8775 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8776 | # Since we don't support reading fragmented ClientHello yet, |
| 8777 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 8778 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8779 | # An autoreduction on the client-side might happen if the server is |
| 8780 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8781 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8782 | # resumed listening, which would result in a spurious autoreduction. |
| 8783 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8784 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8785 | requires_config_enabled MBEDTLS_RSA_C |
| 8786 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8787 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8788 | requires_config_enabled MBEDTLS_AES_C |
| 8789 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8790 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8791 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 8792 | -p "$P_PXY mtu=1450" \ |
| 8793 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8794 | crt_file=data_files/server7_int-ca.crt \ |
| 8795 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8796 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8797 | mtu=1450" \ |
| 8798 | "$P_CLI dtls=1 debug_level=2 \ |
| 8799 | crt_file=data_files/server8_int-ca2.crt \ |
| 8800 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8801 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8802 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8803 | 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] | 8804 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8805 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8806 | -s "found fragmented DTLS handshake message" \ |
| 8807 | -c "found fragmented DTLS handshake message" \ |
| 8808 | -C "error" |
| 8809 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8810 | # An autoreduction on the client-side might happen if the server is |
| 8811 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8812 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8813 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8814 | requires_config_enabled MBEDTLS_RSA_C |
| 8815 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8816 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8817 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8818 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8819 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8820 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8821 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 8822 | -p "$P_PXY mtu=512" \ |
| 8823 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8824 | crt_file=data_files/server7_int-ca.crt \ |
| 8825 | key_file=data_files/server7.key \ |
| 8826 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8827 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8828 | mtu=512" \ |
| 8829 | "$P_CLI dtls=1 debug_level=2 \ |
| 8830 | crt_file=data_files/server8_int-ca2.crt \ |
| 8831 | key_file=data_files/server8.key \ |
| 8832 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8833 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8834 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8835 | mtu=512" \ |
| 8836 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8837 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8838 | -s "found fragmented DTLS handshake message" \ |
| 8839 | -c "found fragmented DTLS handshake message" \ |
| 8840 | -C "error" |
| 8841 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8842 | # An autoreduction on the client-side might happen if the server is |
| 8843 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8844 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8849 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8850 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8851 | requires_config_enabled MBEDTLS_AES_C |
| 8852 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8853 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8854 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 8855 | -p "$P_PXY mtu=512" \ |
| 8856 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8857 | crt_file=data_files/server7_int-ca.crt \ |
| 8858 | key_file=data_files/server7.key \ |
| 8859 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8860 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8861 | mtu=512" \ |
| 8862 | "$P_CLI dtls=1 debug_level=2 \ |
| 8863 | crt_file=data_files/server8_int-ca2.crt \ |
| 8864 | key_file=data_files/server8.key \ |
| 8865 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8866 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8867 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8868 | mtu=512" \ |
| 8869 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8870 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8871 | -s "found fragmented DTLS handshake message" \ |
| 8872 | -c "found fragmented DTLS handshake message" \ |
| 8873 | -C "error" |
| 8874 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8875 | # An autoreduction on the client-side might happen if the server is |
| 8876 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8877 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8878 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8879 | requires_config_enabled MBEDTLS_RSA_C |
| 8880 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8881 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8882 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8883 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8884 | requires_config_enabled MBEDTLS_AES_C |
| 8885 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8886 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8887 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8888 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8889 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8890 | crt_file=data_files/server7_int-ca.crt \ |
| 8891 | key_file=data_files/server7.key \ |
| 8892 | exchanges=2 renegotiation=1 \ |
| 8893 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8894 | hs_timeout=10000-60000 \ |
| 8895 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8896 | "$P_CLI dtls=1 debug_level=2 \ |
| 8897 | crt_file=data_files/server8_int-ca2.crt \ |
| 8898 | key_file=data_files/server8.key \ |
| 8899 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8900 | hs_timeout=10000-60000 \ |
| 8901 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8902 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8903 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8904 | -s "found fragmented DTLS handshake message" \ |
| 8905 | -c "found fragmented DTLS handshake message" \ |
| 8906 | -C "error" |
| 8907 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8908 | # An autoreduction on the client-side might happen if the server is |
| 8909 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8910 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8911 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8912 | requires_config_enabled MBEDTLS_RSA_C |
| 8913 | requires_config_enabled MBEDTLS_ECDSA_C |
| 8914 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8915 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8916 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8917 | requires_config_enabled MBEDTLS_AES_C |
| 8918 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 8919 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8920 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8921 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8922 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8923 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8924 | crt_file=data_files/server7_int-ca.crt \ |
| 8925 | key_file=data_files/server7.key \ |
| 8926 | exchanges=2 renegotiation=1 \ |
| 8927 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8928 | hs_timeout=10000-60000 \ |
| 8929 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8930 | "$P_CLI dtls=1 debug_level=2 \ |
| 8931 | crt_file=data_files/server8_int-ca2.crt \ |
| 8932 | key_file=data_files/server8.key \ |
| 8933 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8934 | hs_timeout=10000-60000 \ |
| 8935 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8936 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8937 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8938 | -s "found fragmented DTLS handshake message" \ |
| 8939 | -c "found fragmented DTLS handshake message" \ |
| 8940 | -C "error" |
| 8941 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8942 | # An autoreduction on the client-side might happen if the server is |
| 8943 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 8944 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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_SHA256_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8949 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8950 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 8951 | requires_config_enabled MBEDTLS_AES_C |
| 8952 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8953 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8954 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8955 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8956 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 8957 | crt_file=data_files/server7_int-ca.crt \ |
| 8958 | key_file=data_files/server7.key \ |
| 8959 | exchanges=2 renegotiation=1 \ |
| 8960 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8961 | hs_timeout=10000-60000 \ |
| 8962 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8963 | "$P_CLI dtls=1 debug_level=2 \ |
| 8964 | crt_file=data_files/server8_int-ca2.crt \ |
| 8965 | key_file=data_files/server8.key \ |
| 8966 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8967 | hs_timeout=10000-60000 \ |
| 8968 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8969 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8970 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8971 | -s "found fragmented DTLS handshake message" \ |
| 8972 | -c "found fragmented DTLS handshake message" \ |
| 8973 | -C "error" |
| 8974 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8975 | # 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] | 8976 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 8977 | requires_config_enabled MBEDTLS_RSA_C |
| 8978 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 8979 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8980 | requires_config_enabled MBEDTLS_AES_C |
| 8981 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8982 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8983 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8984 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 8985 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8986 | "$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] | 8987 | crt_file=data_files/server7_int-ca.crt \ |
| 8988 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8989 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8990 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8991 | crt_file=data_files/server8_int-ca2.crt \ |
| 8992 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8993 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8994 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8995 | 0 \ |
| 8996 | -s "found fragmented DTLS handshake message" \ |
| 8997 | -c "found fragmented DTLS handshake message" \ |
| 8998 | -C "error" |
| 8999 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 9000 | # 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] | 9001 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9002 | requires_config_enabled MBEDTLS_RSA_C |
| 9003 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | e7738c3 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 9004 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9005 | requires_config_enabled MBEDTLS_AES_C |
| 9006 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9007 | client_needs_more_time 2 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9008 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9009 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 9010 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 9011 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 9012 | crt_file=data_files/server7_int-ca.crt \ |
| 9013 | key_file=data_files/server7.key \ |
| 9014 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9015 | "$P_CLI dtls=1 debug_level=2 \ |
| 9016 | crt_file=data_files/server8_int-ca2.crt \ |
| 9017 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 9018 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 9019 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 9020 | 0 \ |
| 9021 | -s "found fragmented DTLS handshake message" \ |
| 9022 | -c "found fragmented DTLS handshake message" \ |
| 9023 | -C "error" |
| 9024 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9025 | # interop tests for DTLS fragmentating with reliable connection |
| 9026 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9027 | # here and below we just want to test that the we fragment in a way that |
| 9028 | # pleases other implementations, so we don't need the peer to fragment |
| 9029 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9030 | requires_config_enabled MBEDTLS_RSA_C |
| 9031 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9032 | requires_gnutls |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9033 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9034 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 9035 | "$G_SRV -u" \ |
| 9036 | "$P_CLI dtls=1 debug_level=2 \ |
| 9037 | crt_file=data_files/server8_int-ca2.crt \ |
| 9038 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9039 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9040 | 0 \ |
| 9041 | -c "fragmenting handshake message" \ |
| 9042 | -C "error" |
| 9043 | |
| 9044 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9045 | requires_config_enabled MBEDTLS_RSA_C |
| 9046 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9047 | requires_gnutls |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9048 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9049 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 9050 | "$G_SRV -u" \ |
| 9051 | "$P_CLI dtls=1 debug_level=2 \ |
| 9052 | crt_file=data_files/server8_int-ca2.crt \ |
| 9053 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9054 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9055 | 0 \ |
| 9056 | -c "fragmenting handshake message" \ |
| 9057 | -C "error" |
| 9058 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9059 | # We use --insecure for the GnuTLS client because it expects |
| 9060 | # the hostname / IP it connects to to be the name used in the |
| 9061 | # certificate obtained from the server. Here, however, it |
| 9062 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 9063 | # as the server name in the certificate. This will make the |
Shaun Case | 0e7791f | 2021-12-20 21:14:10 -0800 | [diff] [blame] | 9064 | # certificate validation fail, but passing --insecure makes |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9065 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9066 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9067 | requires_config_enabled MBEDTLS_RSA_C |
| 9068 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9069 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9070 | requires_not_i686 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9071 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9072 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9073 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9074 | crt_file=data_files/server7_int-ca.crt \ |
| 9075 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9076 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9077 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9078 | 0 \ |
| 9079 | -s "fragmenting handshake message" |
| 9080 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 9081 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9082 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9083 | requires_config_enabled MBEDTLS_RSA_C |
| 9084 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 9085 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 9086 | requires_not_i686 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9087 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9088 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9089 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9090 | crt_file=data_files/server7_int-ca.crt \ |
| 9091 | key_file=data_files/server7.key \ |
| 9092 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 9093 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9094 | 0 \ |
| 9095 | -s "fragmenting handshake message" |
| 9096 | |
| 9097 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9098 | requires_config_enabled MBEDTLS_RSA_C |
| 9099 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9100 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9101 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 9102 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9103 | "$P_CLI dtls=1 debug_level=2 \ |
| 9104 | crt_file=data_files/server8_int-ca2.crt \ |
| 9105 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9106 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9107 | 0 \ |
| 9108 | -c "fragmenting handshake message" \ |
| 9109 | -C "error" |
| 9110 | |
| 9111 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9112 | requires_config_enabled MBEDTLS_RSA_C |
| 9113 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9114 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9115 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 9116 | "$O_SRV -dtls1 -verify 10" \ |
| 9117 | "$P_CLI dtls=1 debug_level=2 \ |
| 9118 | crt_file=data_files/server8_int-ca2.crt \ |
| 9119 | key_file=data_files/server8.key \ |
| 9120 | mtu=512 force_version=dtls1" \ |
| 9121 | 0 \ |
| 9122 | -c "fragmenting handshake message" \ |
| 9123 | -C "error" |
| 9124 | |
| 9125 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9126 | requires_config_enabled MBEDTLS_RSA_C |
| 9127 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9128 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9129 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 9130 | "$P_SRV dtls=1 debug_level=2 \ |
| 9131 | crt_file=data_files/server7_int-ca.crt \ |
| 9132 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9133 | mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9134 | "$O_CLI -dtls1_2" \ |
| 9135 | 0 \ |
| 9136 | -s "fragmenting handshake message" |
| 9137 | |
| 9138 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9139 | requires_config_enabled MBEDTLS_RSA_C |
| 9140 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9141 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 9142 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 9143 | "$P_SRV dtls=1 debug_level=2 \ |
| 9144 | crt_file=data_files/server7_int-ca.crt \ |
| 9145 | key_file=data_files/server7.key \ |
| 9146 | mtu=512 force_version=dtls1" \ |
| 9147 | "$O_CLI -dtls1" \ |
| 9148 | 0 \ |
| 9149 | -s "fragmenting handshake message" |
| 9150 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9151 | # interop tests for DTLS fragmentating with unreliable connection |
| 9152 | # |
| 9153 | # again we just want to test that the we fragment in a way that |
| 9154 | # pleases other implementations, so we don't need the peer to fragment |
| 9155 | requires_gnutls_next |
| 9156 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9157 | requires_config_enabled MBEDTLS_RSA_C |
| 9158 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9159 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9160 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9161 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 9162 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9163 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9164 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9165 | crt_file=data_files/server8_int-ca2.crt \ |
| 9166 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9167 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9168 | 0 \ |
| 9169 | -c "fragmenting handshake message" \ |
| 9170 | -C "error" |
| 9171 | |
| 9172 | requires_gnutls_next |
| 9173 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9174 | requires_config_enabled MBEDTLS_RSA_C |
| 9175 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9176 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9177 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9178 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 9179 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9180 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9181 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9182 | crt_file=data_files/server8_int-ca2.crt \ |
| 9183 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9184 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9185 | 0 \ |
| 9186 | -c "fragmenting handshake message" \ |
| 9187 | -C "error" |
| 9188 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9189 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9190 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9191 | requires_config_enabled MBEDTLS_RSA_C |
| 9192 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9193 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9194 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9195 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 9196 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9197 | "$P_SRV dtls=1 debug_level=2 \ |
| 9198 | crt_file=data_files/server7_int-ca.crt \ |
| 9199 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9200 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9201 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9202 | 0 \ |
| 9203 | -s "fragmenting handshake message" |
| 9204 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9205 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9206 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9207 | requires_config_enabled MBEDTLS_RSA_C |
| 9208 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9209 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9210 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9211 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 9212 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9213 | "$P_SRV dtls=1 debug_level=2 \ |
| 9214 | crt_file=data_files/server7_int-ca.crt \ |
| 9215 | key_file=data_files/server7.key \ |
| 9216 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9217 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9218 | 0 \ |
| 9219 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9220 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9221 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 9222 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9223 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9224 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 9225 | ## (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] | 9226 | skip_next_test |
| 9227 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9228 | requires_config_enabled MBEDTLS_RSA_C |
| 9229 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9230 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9231 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9232 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 9233 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9234 | "$O_SRV -dtls1_2 -verify 10" \ |
| 9235 | "$P_CLI dtls=1 debug_level=2 \ |
| 9236 | crt_file=data_files/server8_int-ca2.crt \ |
| 9237 | key_file=data_files/server8.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9238 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 9239 | 0 \ |
| 9240 | -c "fragmenting handshake message" \ |
| 9241 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9242 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9243 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9244 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9245 | requires_config_enabled MBEDTLS_RSA_C |
| 9246 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9247 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9248 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9249 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 9250 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9251 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9252 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9253 | crt_file=data_files/server8_int-ca2.crt \ |
| 9254 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9255 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9256 | 0 \ |
| 9257 | -c "fragmenting handshake message" \ |
| 9258 | -C "error" |
| 9259 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9260 | skip_next_test |
| 9261 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9262 | requires_config_enabled MBEDTLS_RSA_C |
| 9263 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9264 | client_needs_more_time 4 |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 9265 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9266 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 9267 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 9268 | "$P_SRV dtls=1 debug_level=2 \ |
| 9269 | crt_file=data_files/server7_int-ca.crt \ |
| 9270 | key_file=data_files/server7.key \ |
Xiaofei Bai | f40545d | 2021-12-02 08:43:35 +0000 | [diff] [blame] | 9271 | hs_timeout=250-60000 mtu=512 force_version=dtls12" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9272 | "$O_CLI -dtls1_2" \ |
| 9273 | 0 \ |
| 9274 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9275 | |
| 9276 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 9277 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9278 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9279 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 9280 | requires_config_enabled MBEDTLS_RSA_C |
| 9281 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9282 | client_needs_more_time 4 |
Yuto Takano | 75ab928 | 2021-07-26 08:27:47 +0100 | [diff] [blame] | 9283 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9284 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 9285 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9286 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9287 | crt_file=data_files/server7_int-ca.crt \ |
| 9288 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 9289 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 9290 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 9291 | 0 \ |
| 9292 | -s "fragmenting handshake message" |
| 9293 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9294 | # Tests for DTLS-SRTP (RFC 5764) |
| 9295 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9296 | run_test "DTLS-SRTP all profiles supported" \ |
| 9297 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9298 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9299 | 0 \ |
| 9300 | -s "found use_srtp extension" \ |
| 9301 | -s "found srtp profile" \ |
| 9302 | -s "selected srtp profile" \ |
| 9303 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9304 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9305 | -c "client hello, adding use_srtp extension" \ |
| 9306 | -c "found use_srtp extension" \ |
| 9307 | -c "found srtp profile" \ |
| 9308 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9309 | -c "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 | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9311 | -C "error" |
| 9312 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9313 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9314 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9315 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 9316 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9317 | "$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] | 9318 | 0 \ |
| 9319 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9320 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 9321 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9322 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9323 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9324 | -c "client hello, adding use_srtp extension" \ |
| 9325 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9326 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9327 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9328 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9329 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9330 | -C "error" |
| 9331 | |
| 9332 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9333 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9334 | "$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] | 9335 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9336 | 0 \ |
| 9337 | -s "found use_srtp extension" \ |
| 9338 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9339 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9340 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9341 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9342 | -c "client hello, adding use_srtp extension" \ |
| 9343 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9344 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9345 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9346 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9347 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9348 | -C "error" |
| 9349 | |
| 9350 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9351 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 9352 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9353 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9354 | 0 \ |
| 9355 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9356 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9357 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9358 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9359 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9360 | -c "client hello, adding use_srtp extension" \ |
| 9361 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9362 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9363 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9364 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9365 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9366 | -C "error" |
| 9367 | |
| 9368 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9369 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 9370 | "$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] | 9371 | "$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] | 9372 | 0 \ |
| 9373 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9374 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9375 | -S "selected srtp profile" \ |
| 9376 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9377 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9378 | -c "client hello, adding use_srtp extension" \ |
| 9379 | -C "found use_srtp extension" \ |
| 9380 | -C "found srtp profile" \ |
| 9381 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9382 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9383 | -C "error" |
| 9384 | |
| 9385 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9386 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 9387 | "$P_SRV dtls=1 debug_level=3" \ |
| 9388 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9389 | 0 \ |
| 9390 | -s "found use_srtp extension" \ |
| 9391 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9392 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9393 | -c "client hello, adding use_srtp extension" \ |
| 9394 | -C "found use_srtp extension" \ |
| 9395 | -C "found srtp profile" \ |
| 9396 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9397 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9398 | -C "error" |
| 9399 | |
| 9400 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9401 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 9402 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 9403 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9404 | 0 \ |
| 9405 | -s "found use_srtp extension" \ |
| 9406 | -s "found srtp profile" \ |
| 9407 | -s "selected srtp profile" \ |
| 9408 | -s "server hello, adding use_srtp extension" \ |
| 9409 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9410 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9411 | -c "client hello, adding use_srtp extension" \ |
| 9412 | -c "found use_srtp extension" \ |
| 9413 | -c "found srtp profile" \ |
| 9414 | -c "selected srtp profile" \ |
| 9415 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9416 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9417 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9418 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9419 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9420 | -C "error" |
| 9421 | |
| 9422 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9423 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 9424 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9425 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9426 | 0 \ |
| 9427 | -s "found use_srtp extension" \ |
| 9428 | -s "found srtp profile" \ |
| 9429 | -s "selected srtp profile" \ |
| 9430 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9431 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9432 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9433 | -S "dumping 'using mki' (8 bytes)" \ |
| 9434 | -c "client hello, adding use_srtp extension" \ |
| 9435 | -c "found use_srtp extension" \ |
| 9436 | -c "found srtp profile" \ |
| 9437 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9438 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9439 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9440 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 9441 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9442 | -C "dumping 'received mki' (8 bytes)" \ |
| 9443 | -C "error" |
| 9444 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9445 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9446 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 9447 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9448 | "$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] | 9449 | 0 \ |
| 9450 | -s "found use_srtp extension" \ |
| 9451 | -s "found srtp profile" \ |
| 9452 | -s "selected srtp profile" \ |
| 9453 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9454 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9455 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9456 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 9457 | |
| 9458 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9459 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 9460 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9461 | "$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] | 9462 | 0 \ |
| 9463 | -s "found use_srtp extension" \ |
| 9464 | -s "found srtp profile" \ |
| 9465 | -s "selected srtp profile" \ |
| 9466 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9467 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9468 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9469 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9470 | |
| 9471 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9472 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 9473 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9474 | "$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] | 9475 | 0 \ |
| 9476 | -s "found use_srtp extension" \ |
| 9477 | -s "found srtp profile" \ |
| 9478 | -s "selected srtp profile" \ |
| 9479 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9480 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9481 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9482 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9483 | |
| 9484 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9485 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 9486 | "$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] | 9487 | "$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] | 9488 | 0 \ |
| 9489 | -s "found use_srtp extension" \ |
| 9490 | -s "found srtp profile" \ |
| 9491 | -s "selected srtp profile" \ |
| 9492 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9493 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9494 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9495 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9496 | |
| 9497 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9498 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 9499 | "$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] | 9500 | "$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] | 9501 | 0 \ |
| 9502 | -s "found use_srtp extension" \ |
| 9503 | -s "found srtp profile" \ |
| 9504 | -s "selected srtp profile" \ |
| 9505 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9506 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 9507 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9508 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 9509 | |
| 9510 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9511 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 9512 | "$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] | 9513 | "$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] | 9514 | 0 \ |
| 9515 | -s "found use_srtp extension" \ |
| 9516 | -s "found srtp profile" \ |
| 9517 | -S "selected srtp profile" \ |
| 9518 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9519 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9520 | -C "SRTP Extension negotiated, profile" |
| 9521 | |
| 9522 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9523 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 9524 | "$P_SRV dtls=1 debug_level=3" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9525 | "$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] | 9526 | 0 \ |
| 9527 | -s "found use_srtp extension" \ |
| 9528 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9529 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9530 | -C "SRTP Extension negotiated, profile" |
| 9531 | |
| 9532 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9533 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9534 | "$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] | 9535 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9536 | 0 \ |
| 9537 | -c "client hello, adding use_srtp extension" \ |
| 9538 | -c "found use_srtp extension" \ |
| 9539 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9540 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9541 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9542 | -C "error" |
| 9543 | |
| 9544 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9545 | 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] | 9546 | "$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] | 9547 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9548 | 0 \ |
| 9549 | -c "client hello, adding use_srtp extension" \ |
| 9550 | -c "found use_srtp extension" \ |
| 9551 | -c "found srtp profile" \ |
| 9552 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9553 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9554 | -C "error" |
| 9555 | |
| 9556 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9557 | 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] | 9558 | "$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] | 9559 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9560 | 0 \ |
| 9561 | -c "client hello, adding use_srtp extension" \ |
| 9562 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9563 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9564 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9565 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9566 | -C "error" |
| 9567 | |
| 9568 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9569 | 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] | 9570 | "$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] | 9571 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9572 | 0 \ |
| 9573 | -c "client hello, adding use_srtp extension" \ |
| 9574 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9575 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9576 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9577 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9578 | -C "error" |
| 9579 | |
| 9580 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9581 | 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] | 9582 | "$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] | 9583 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9584 | 0 \ |
| 9585 | -c "client hello, adding use_srtp extension" \ |
| 9586 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9587 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9588 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9589 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9590 | -C "error" |
| 9591 | |
| 9592 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9593 | 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] | 9594 | "$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] | 9595 | "$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] | 9596 | 0 \ |
| 9597 | -c "client hello, adding use_srtp extension" \ |
| 9598 | -C "found use_srtp extension" \ |
| 9599 | -C "found srtp profile" \ |
| 9600 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9601 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9602 | -C "error" |
| 9603 | |
| 9604 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9605 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 9606 | "$O_SRV -dtls1" \ |
| 9607 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9608 | 0 \ |
| 9609 | -c "client hello, adding use_srtp extension" \ |
| 9610 | -C "found use_srtp extension" \ |
| 9611 | -C "found srtp profile" \ |
| 9612 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9613 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9614 | -C "error" |
| 9615 | |
| 9616 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 9617 | 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] | 9618 | "$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] | 9619 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9620 | 0 \ |
| 9621 | -c "client hello, adding use_srtp extension" \ |
| 9622 | -c "found use_srtp extension" \ |
| 9623 | -c "found srtp profile" \ |
| 9624 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9625 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9626 | -c "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9627 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9628 | -C "dumping 'received mki' (8 bytes)" \ |
| 9629 | -C "error" |
| 9630 | |
| 9631 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9632 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9633 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9634 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9635 | "$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] | 9636 | 0 \ |
| 9637 | -s "found use_srtp extension" \ |
| 9638 | -s "found srtp profile" \ |
| 9639 | -s "selected srtp profile" \ |
| 9640 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9641 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9642 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 9643 | |
| 9644 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9645 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9646 | 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] | 9647 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9648 | "$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] | 9649 | 0 \ |
| 9650 | -s "found use_srtp extension" \ |
| 9651 | -s "found srtp profile" \ |
| 9652 | -s "selected srtp profile" \ |
| 9653 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9654 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9655 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 9656 | |
| 9657 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9658 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9659 | 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] | 9660 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 9661 | "$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] | 9662 | 0 \ |
| 9663 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9664 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9665 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9666 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9667 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9668 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9669 | |
| 9670 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9671 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9672 | 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] | 9673 | "$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] | 9674 | "$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] | 9675 | 0 \ |
| 9676 | -s "found use_srtp extension" \ |
| 9677 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9678 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9679 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9680 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9681 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 9682 | |
| 9683 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9684 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9685 | 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] | 9686 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9687 | "$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] | 9688 | 0 \ |
| 9689 | -s "found use_srtp extension" \ |
| 9690 | -s "found srtp profile" \ |
| 9691 | -s "selected srtp profile" \ |
| 9692 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9693 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9694 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 9695 | |
| 9696 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9697 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9698 | 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] | 9699 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 9700 | "$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] | 9701 | 0 \ |
| 9702 | -s "found use_srtp extension" \ |
| 9703 | -s "found srtp profile" \ |
| 9704 | -S "selected srtp profile" \ |
| 9705 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9706 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9707 | -C "SRTP profile:" |
| 9708 | |
| 9709 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9710 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9711 | 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] | 9712 | "$P_SRV dtls=1 debug_level=3" \ |
| 9713 | "$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] | 9714 | 0 \ |
| 9715 | -s "found use_srtp extension" \ |
| 9716 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9717 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9718 | -C "SRTP profile:" |
| 9719 | |
| 9720 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9721 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9722 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 9723 | "$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" \ |
| 9724 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9725 | 0 \ |
| 9726 | -c "client hello, adding use_srtp extension" \ |
| 9727 | -c "found use_srtp extension" \ |
| 9728 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9729 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9730 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9731 | -C "error" |
| 9732 | |
| 9733 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9734 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9735 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 9736 | "$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" \ |
| 9737 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9738 | 0 \ |
| 9739 | -c "client hello, adding use_srtp extension" \ |
| 9740 | -c "found use_srtp extension" \ |
| 9741 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9742 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9743 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9744 | -C "error" |
| 9745 | |
| 9746 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9747 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9748 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 9749 | "$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" \ |
| 9750 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9751 | 0 \ |
| 9752 | -c "client hello, adding use_srtp extension" \ |
| 9753 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9754 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9755 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9756 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9757 | -C "error" |
| 9758 | |
| 9759 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9760 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9761 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 9762 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9763 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9764 | 0 \ |
| 9765 | -c "client hello, adding use_srtp extension" \ |
| 9766 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9767 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9768 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9769 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9770 | -C "error" |
| 9771 | |
| 9772 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9773 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9774 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 9775 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 9776 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 9777 | 0 \ |
| 9778 | -c "client hello, adding use_srtp extension" \ |
| 9779 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9780 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9781 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9782 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9783 | -C "error" |
| 9784 | |
| 9785 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9786 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9787 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 9788 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9789 | "$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] | 9790 | 0 \ |
| 9791 | -c "client hello, adding use_srtp extension" \ |
| 9792 | -C "found use_srtp extension" \ |
| 9793 | -C "found srtp profile" \ |
| 9794 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9795 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9796 | -C "error" |
| 9797 | |
| 9798 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9799 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9800 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 9801 | "$G_SRV -u" \ |
| 9802 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 9803 | 0 \ |
| 9804 | -c "client hello, adding use_srtp extension" \ |
| 9805 | -C "found use_srtp extension" \ |
| 9806 | -C "found srtp profile" \ |
| 9807 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9808 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9809 | -C "error" |
| 9810 | |
| 9811 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9812 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9813 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 9814 | "$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" \ |
| 9815 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 9816 | 0 \ |
| 9817 | -c "client hello, adding use_srtp extension" \ |
| 9818 | -c "found use_srtp extension" \ |
| 9819 | -c "found srtp profile" \ |
| 9820 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9821 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9822 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9823 | -c "dumping 'sending mki' (8 bytes)" \ |
| 9824 | -c "dumping 'received mki' (8 bytes)" \ |
| 9825 | -C "error" |
| 9826 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9827 | # Tests for specific things with "unreliable" UDP connection |
| 9828 | |
| 9829 | not_with_valgrind # spurious resend due to timeout |
| 9830 | run_test "DTLS proxy: reference" \ |
| 9831 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9832 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 9833 | "$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] | 9834 | 0 \ |
| 9835 | -C "replayed record" \ |
| 9836 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9837 | -C "Buffer record from epoch" \ |
| 9838 | -S "Buffer record from epoch" \ |
| 9839 | -C "ssl_buffer_message" \ |
| 9840 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9841 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9842 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9843 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9844 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9845 | -c "HTTP/1.0 200 OK" |
| 9846 | |
| 9847 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9848 | run_test "DTLS proxy: duplicate every packet" \ |
| 9849 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9850 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 9851 | "$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] | 9852 | 0 \ |
| 9853 | -c "replayed record" \ |
| 9854 | -s "replayed record" \ |
| 9855 | -c "record from another epoch" \ |
| 9856 | -s "record from another epoch" \ |
| 9857 | -S "resend" \ |
| 9858 | -s "Extra-header:" \ |
| 9859 | -c "HTTP/1.0 200 OK" |
| 9860 | |
| 9861 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 9862 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9863 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 9864 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9865 | 0 \ |
| 9866 | -c "replayed record" \ |
| 9867 | -S "replayed record" \ |
| 9868 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9869 | -s "record from another epoch" \ |
| 9870 | -c "resend" \ |
| 9871 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9872 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9873 | -c "HTTP/1.0 200 OK" |
| 9874 | |
| 9875 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 9876 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9877 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9878 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9879 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9880 | -c "next record in same datagram" \ |
| 9881 | -s "next record in same datagram" |
| 9882 | |
| 9883 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 9884 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9885 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 9886 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9887 | 0 \ |
| 9888 | -c "next record in same datagram" \ |
| 9889 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9890 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9891 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 9892 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9893 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 9894 | "$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] | 9895 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9896 | -c "discarding invalid record (mac)" \ |
| 9897 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9898 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9899 | -c "HTTP/1.0 200 OK" \ |
| 9900 | -S "too many records with bad MAC" \ |
| 9901 | -S "Verification of the message MAC failed" |
| 9902 | |
| 9903 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 9904 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9905 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 9906 | "$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] | 9907 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9908 | -C "discarding invalid record (mac)" \ |
| 9909 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9910 | -S "Extra-header:" \ |
| 9911 | -C "HTTP/1.0 200 OK" \ |
| 9912 | -s "too many records with bad MAC" \ |
| 9913 | -s "Verification of the message MAC failed" |
| 9914 | |
| 9915 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 9916 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9917 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 9918 | "$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] | 9919 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9920 | -c "discarding invalid record (mac)" \ |
| 9921 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9922 | -s "Extra-header:" \ |
| 9923 | -c "HTTP/1.0 200 OK" \ |
| 9924 | -S "too many records with bad MAC" \ |
| 9925 | -S "Verification of the message MAC failed" |
| 9926 | |
| 9927 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 9928 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9929 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 9930 | "$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] | 9931 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9932 | -c "discarding invalid record (mac)" \ |
| 9933 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9934 | -s "Extra-header:" \ |
| 9935 | -c "HTTP/1.0 200 OK" \ |
| 9936 | -s "too many records with bad MAC" \ |
| 9937 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9938 | |
| 9939 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 9940 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9941 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 9942 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9943 | 0 \ |
| 9944 | -c "record from another epoch" \ |
| 9945 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9946 | -s "Extra-header:" \ |
| 9947 | -c "HTTP/1.0 200 OK" |
| 9948 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9949 | # Tests for reordering support with DTLS |
| 9950 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9951 | requires_certificate_authentication |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9952 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 9953 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9954 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9955 | hs_timeout=2500-60000" \ |
| 9956 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9957 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9958 | 0 \ |
| 9959 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9960 | -c "Next handshake message has been buffered - load"\ |
| 9961 | -S "Buffering HS message" \ |
| 9962 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9963 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9964 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9965 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9966 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9967 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9968 | requires_certificate_authentication |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9969 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 9970 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9971 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9972 | hs_timeout=2500-60000" \ |
| 9973 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9974 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9975 | 0 \ |
| 9976 | -c "Buffering HS message" \ |
| 9977 | -c "found fragmented DTLS handshake message"\ |
| 9978 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 9979 | -c "Next handshake message has been buffered - load"\ |
| 9980 | -S "Buffering HS message" \ |
| 9981 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9982 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9983 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9984 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9985 | -S "Remember CCS message" |
| 9986 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9987 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 9988 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 9989 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 9990 | # while keeping the ServerKeyExchange. |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 9991 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9992 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 9993 | 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] | 9994 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9995 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 9996 | hs_timeout=2500-60000" \ |
| 9997 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 9998 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9999 | 0 \ |
| 10000 | -c "Buffering HS message" \ |
| 10001 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10002 | -C "attempt to make space by freeing buffered messages" \ |
| 10003 | -S "Buffering HS message" \ |
| 10004 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10005 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10006 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10007 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10008 | -S "Remember CCS message" |
| 10009 | |
| 10010 | # The size constraints ensure that the delayed certificate message can't |
| 10011 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 10012 | # when dropping it first. |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10013 | requires_certificate_authentication |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10014 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 10015 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 10016 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 10017 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10018 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10019 | hs_timeout=2500-60000" \ |
| 10020 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10021 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10022 | 0 \ |
| 10023 | -c "Buffering HS message" \ |
| 10024 | -c "attempt to make space by freeing buffered future messages" \ |
| 10025 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10026 | -S "Buffering HS message" \ |
| 10027 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10028 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10029 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10030 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 10031 | -S "Remember CCS message" |
| 10032 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10033 | requires_certificate_authentication |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10034 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 10035 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10036 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 10037 | hs_timeout=2500-60000" \ |
| 10038 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10039 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10040 | 0 \ |
| 10041 | -C "Buffering HS message" \ |
| 10042 | -C "Next handshake message has been buffered - load"\ |
| 10043 | -s "Buffering HS message" \ |
| 10044 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10045 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10046 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10047 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10048 | -S "Remember CCS message" |
| 10049 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10050 | requires_certificate_authentication |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10051 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 10052 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10053 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10054 | hs_timeout=2500-60000" \ |
| 10055 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10056 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10057 | 0 \ |
| 10058 | -C "Buffering HS message" \ |
| 10059 | -C "Next handshake message has been buffered - load"\ |
| 10060 | -S "Buffering HS message" \ |
| 10061 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10062 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10063 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10064 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10065 | -S "Remember CCS message" |
| 10066 | |
Gilles Peskine | 22cc649 | 2022-03-14 18:21:24 +0100 | [diff] [blame] | 10067 | requires_certificate_authentication |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10068 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 10069 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10070 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10071 | hs_timeout=2500-60000" \ |
| 10072 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10073 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10074 | 0 \ |
| 10075 | -C "Buffering HS message" \ |
| 10076 | -C "Next handshake message has been buffered - load"\ |
| 10077 | -S "Buffering HS message" \ |
| 10078 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10079 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10080 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 10081 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10082 | -s "Remember CCS message" |
| 10083 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10084 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10085 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10086 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 10087 | hs_timeout=2500-60000" \ |
| 10088 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 10089 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 10090 | 0 \ |
| 10091 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 10092 | -s "Found buffered record from current epoch - load" \ |
| 10093 | -c "Buffer record from epoch 1" \ |
| 10094 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10095 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10096 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 10097 | # from the server are delayed, so that the encrypted Finished message |
| 10098 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 10099 | # in afterwards, the encrypted Finished message must be freed in order |
| 10100 | # to make space for the NewSessionTicket to be reassembled. |
| 10101 | # This works only in very particular circumstances: |
| 10102 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 10103 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 10104 | # the encrypted Finished message. |
| 10105 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 10106 | # needs to be fragmented. |
| 10107 | # - All messages sent by the server must be small enough to be either sent |
| 10108 | # without fragmentation or be reassembled within the bounds of |
| 10109 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 10110 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 10111 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 10112 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 10113 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 10114 | -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] | 10115 | "$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] | 10116 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 10117 | 0 \ |
| 10118 | -s "Buffer record from epoch 1" \ |
| 10119 | -s "Found buffered record from current epoch - load" \ |
| 10120 | -c "Buffer record from epoch 1" \ |
| 10121 | -C "Found buffered record from current epoch - load" \ |
| 10122 | -c "Enough space available after freeing future epoch record" |
| 10123 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 10124 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 10125 | |
| 10126 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 10127 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 10128 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10129 | "$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] | 10130 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10131 | "$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] | 10132 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10133 | 0 \ |
| 10134 | -s "Extra-header:" \ |
| 10135 | -c "HTTP/1.0 200 OK" |
| 10136 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10137 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10138 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 10139 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10140 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10141 | "$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] | 10142 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 10143 | 0 \ |
| 10144 | -s "Extra-header:" \ |
| 10145 | -c "HTTP/1.0 200 OK" |
| 10146 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10147 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10148 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 10149 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10150 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 10151 | "$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] | 10152 | 0 \ |
| 10153 | -s "Extra-header:" \ |
| 10154 | -c "HTTP/1.0 200 OK" |
| 10155 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10156 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10157 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 10158 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10159 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 10160 | "$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] | 10161 | 0 \ |
| 10162 | -s "Extra-header:" \ |
| 10163 | -c "HTTP/1.0 200 OK" |
| 10164 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10165 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10166 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 10167 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10168 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 10169 | "$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] | 10170 | 0 \ |
| 10171 | -s "Extra-header:" \ |
| 10172 | -c "HTTP/1.0 200 OK" |
| 10173 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10174 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 10175 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 10176 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10177 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 10178 | "$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] | 10179 | 0 \ |
| 10180 | -s "Extra-header:" \ |
| 10181 | -c "HTTP/1.0 200 OK" |
| 10182 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10183 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10184 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 10185 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10186 | "$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] | 10187 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10188 | "$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] | 10189 | 0 \ |
| 10190 | -s "Extra-header:" \ |
| 10191 | -c "HTTP/1.0 200 OK" |
| 10192 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10193 | client_needs_more_time 4 |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10194 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 10195 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 10196 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10197 | "$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] | 10198 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10199 | "$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] | 10200 | 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] | 10201 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10202 | 0 \ |
| 10203 | -s "a session has been resumed" \ |
| 10204 | -c "a session has been resumed" \ |
| 10205 | -s "Extra-header:" \ |
| 10206 | -c "HTTP/1.0 200 OK" |
| 10207 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10208 | client_needs_more_time 4 |
Gilles Peskine | 111fde4 | 2022-02-25 19:51:52 +0100 | [diff] [blame] | 10209 | requires_config_enabled MBEDTLS_SSL_CACHE_C |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 10210 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 10211 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10212 | "$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] | 10213 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10214 | "$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] | 10215 | 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] | 10216 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 10217 | 0 \ |
| 10218 | -s "a session has been resumed" \ |
| 10219 | -c "a session has been resumed" \ |
| 10220 | -s "Extra-header:" \ |
| 10221 | -c "HTTP/1.0 200 OK" |
| 10222 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10223 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10224 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10225 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10226 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10227 | "$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] | 10228 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10229 | "$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] | 10230 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 10231 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10232 | 0 \ |
| 10233 | -c "=> renegotiate" \ |
| 10234 | -s "=> renegotiate" \ |
| 10235 | -s "Extra-header:" \ |
| 10236 | -c "HTTP/1.0 200 OK" |
| 10237 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10238 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10239 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10240 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 10241 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10242 | "$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] | 10243 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10244 | "$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] | 10245 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10246 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10247 | 0 \ |
| 10248 | -c "=> renegotiate" \ |
| 10249 | -s "=> renegotiate" \ |
| 10250 | -s "Extra-header:" \ |
| 10251 | -c "HTTP/1.0 200 OK" |
| 10252 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10253 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10254 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10255 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 10256 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10257 | "$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] | 10258 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10259 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10260 | "$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] | 10261 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10262 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10263 | 0 \ |
| 10264 | -c "=> renegotiate" \ |
| 10265 | -s "=> renegotiate" \ |
| 10266 | -s "Extra-header:" \ |
| 10267 | -c "HTTP/1.0 200 OK" |
| 10268 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10269 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 10270 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10271 | 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] | 10272 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10273 | "$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] | 10274 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10275 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10276 | "$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] | 10277 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 10278 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 10279 | 0 \ |
| 10280 | -c "=> renegotiate" \ |
| 10281 | -s "=> renegotiate" \ |
| 10282 | -s "Extra-header:" \ |
| 10283 | -c "HTTP/1.0 200 OK" |
| 10284 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10285 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 10286 | ## all versions installed on the CI machines), reported here: |
| 10287 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 10288 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 10289 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 10290 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10291 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10292 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10293 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10294 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10295 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10296 | "$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] | 10297 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 10298 | -c "HTTP/1.0 200 OK" |
| 10299 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10300 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10301 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10302 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10303 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 10304 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10305 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10306 | "$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] | 10307 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10308 | -c "HTTP/1.0 200 OK" |
| 10309 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 10310 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10311 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10312 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10313 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 10314 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 10315 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10316 | "$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] | 10317 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10318 | -c "HTTP/1.0 200 OK" |
| 10319 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 10320 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10321 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10322 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10323 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 10324 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 10325 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10326 | "$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] | 10327 | 0 \ |
| 10328 | -s "Extra-header:" \ |
| 10329 | -c "Extra-header:" |
| 10330 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10331 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10332 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10333 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 10334 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 10335 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10336 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10337 | "$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] | 10338 | 0 \ |
| 10339 | -s "Extra-header:" \ |
| 10340 | -c "Extra-header:" |
| 10341 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10342 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 10343 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 10344 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 10345 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 10346 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 10347 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 10348 | "$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] | 10349 | 0 \ |
| 10350 | -s "Extra-header:" \ |
| 10351 | -c "Extra-header:" |
| 10352 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10353 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 10354 | run_test "export keys functionality" \ |
| 10355 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 10356 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 10357 | 0 \ |
| 10358 | -s "exported maclen is " \ |
| 10359 | -s "exported keylen is " \ |
| 10360 | -s "exported ivlen is " \ |
| 10361 | -c "exported maclen is " \ |
| 10362 | -c "exported keylen is " \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 10363 | -c "exported ivlen is " \ |
| 10364 | -c "EAP-TLS key material is:"\ |
| 10365 | -s "EAP-TLS key material is:"\ |
| 10366 | -c "EAP-TLS IV is:" \ |
| 10367 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 10368 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10369 | # Test heap memory usage after handshake |
| 10370 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 10371 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 10372 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | a49124e | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 10373 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 10374 | run_tests_memory_after_hanshake |
| 10375 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 10376 | # Final report |
| 10377 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10378 | echo "------------------------------------------------------------------------" |
| 10379 | |
| 10380 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10381 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10382 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 10383 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10384 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 10385 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 10386 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 10387 | |
| 10388 | exit $FAILS |