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 | a2947ac | 2020-08-19 16:37:36 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors |
Bence Szépkúti | f744bd7 | 2020-06-05 13:02:18 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
| 7 | # |
| 8 | # This file is provided under the Apache License 2.0, or the |
| 9 | # GNU General Public License v2.0 or later. |
| 10 | # |
| 11 | # ********** |
| 12 | # Apache License 2.0: |
Bence Szépkúti | 51b41d5 | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 13 | # |
| 14 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 15 | # not use this file except in compliance with the License. |
| 16 | # You may obtain a copy of the License at |
| 17 | # |
| 18 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 19 | # |
| 20 | # Unless required by applicable law or agreed to in writing, software |
| 21 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 22 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 23 | # See the License for the specific language governing permissions and |
| 24 | # limitations under the License. |
| 25 | # |
Bence Szépkúti | f744bd7 | 2020-06-05 13:02:18 +0200 | [diff] [blame] | 26 | # ********** |
| 27 | # |
| 28 | # ********** |
| 29 | # GNU General Public License v2.0 or later: |
| 30 | # |
| 31 | # This program is free software; you can redistribute it and/or modify |
| 32 | # it under the terms of the GNU General Public License as published by |
| 33 | # the Free Software Foundation; either version 2 of the License, or |
| 34 | # (at your option) any later version. |
| 35 | # |
| 36 | # This program is distributed in the hope that it will be useful, |
| 37 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 38 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 39 | # GNU General Public License for more details. |
| 40 | # |
| 41 | # You should have received a copy of the GNU General Public License along |
| 42 | # with this program; if not, write to the Free Software Foundation, Inc., |
| 43 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 44 | # |
| 45 | # ********** |
| 46 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 47 | # Purpose |
| 48 | # |
| 49 | # Executes tests to prove various TLS/SSL options and extensions. |
| 50 | # |
| 51 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 52 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 53 | # (session resumption from cache or ticket, renego, etc). |
| 54 | # |
| 55 | # The tests assume a build with default options, with exceptions expressed |
| 56 | # with a dependency. The tests focus on functionality and do not consider |
| 57 | # performance. |
| 58 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 59 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 60 | set -u |
| 61 | |
Jaeden Amero | a258ccd | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 62 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 63 | # where it may output seemingly unlimited length error logs. |
| 64 | ulimit -f 20971520 |
| 65 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 66 | if cd $( dirname $0 ); then :; else |
| 67 | echo "cd $( dirname $0 ) failed" >&2 |
| 68 | exit 1 |
| 69 | fi |
| 70 | |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 71 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 72 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 73 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 74 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 75 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 76 | : ${GNUTLS_CLI:=gnutls-cli} |
| 77 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 78 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 79 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 80 | 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] | 81 | 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] | 82 | 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] | 83 | 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] | 84 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 85 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 86 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 87 | |
| 88 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 89 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 90 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 91 | else |
| 92 | O_LEGACY_SRV=false |
| 93 | O_LEGACY_CLI=false |
| 94 | fi |
| 95 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 96 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 97 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 98 | else |
| 99 | G_NEXT_SRV=false |
| 100 | fi |
| 101 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 102 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 103 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 104 | else |
| 105 | G_NEXT_CLI=false |
| 106 | fi |
| 107 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 108 | TESTS=0 |
| 109 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 110 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 111 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 112 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 113 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 114 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 115 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 116 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 117 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 118 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 119 | RUN_TEST_NUMBER='' |
| 120 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 121 | PRESERVE_LOGS=0 |
| 122 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 123 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 124 | # port which is this plus 10000. Each port number may be independently |
| 125 | # overridden by a command line option. |
| 126 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 127 | PXY_PORT=$((SRV_PORT + 10000)) |
| 128 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 129 | print_usage() { |
| 130 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 131 | printf " -h|--help\tPrint this help.\n" |
| 132 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | b7bb068b | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 133 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 134 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 135 | 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] | 136 | 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] | 137 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 138 | printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n" |
| 139 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 140 | 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] | 141 | } |
| 142 | |
| 143 | get_options() { |
| 144 | while [ $# -gt 0 ]; do |
| 145 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 146 | -f|--filter) |
| 147 | shift; FILTER=$1 |
| 148 | ;; |
| 149 | -e|--exclude) |
| 150 | shift; EXCLUDE=$1 |
| 151 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 152 | -m|--memcheck) |
| 153 | MEMCHECK=1 |
| 154 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 155 | -n|--number) |
| 156 | shift; RUN_TEST_NUMBER=$1 |
| 157 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 158 | -s|--show-numbers) |
| 159 | SHOW_TEST_NUMBER=1 |
| 160 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 161 | -p|--preserve-logs) |
| 162 | PRESERVE_LOGS=1 |
| 163 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 164 | --port) |
| 165 | shift; SRV_PORT=$1 |
| 166 | ;; |
| 167 | --proxy-port) |
| 168 | shift; PXY_PORT=$1 |
| 169 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 170 | --seed) |
| 171 | shift; SEED="$1" |
| 172 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 173 | -h|--help) |
| 174 | print_usage |
| 175 | exit 0 |
| 176 | ;; |
| 177 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 178 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 179 | print_usage |
| 180 | exit 1 |
| 181 | ;; |
| 182 | esac |
| 183 | shift |
| 184 | done |
| 185 | } |
| 186 | |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 187 | # Read boolean configuration options from config.h for easy and quick |
| 188 | # testing. Skip non-boolean options (with something other than spaces |
| 189 | # and a comment after "#define SYMBOL"). The variable contains a |
| 190 | # space-separated list of symbols. |
| 191 | CONFIGS_ENABLED=" $(<"$CONFIG_H" \ |
| 192 | sed -n 's!^ *#define *\([A-Za-z][0-9A-Z_a-z]*\) *\(/*\)*!\1!p' | |
| 193 | tr '\n' ' ')" |
| 194 | |
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 | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 205 | case $CONFIGS_ENABLED in |
| 206 | *" $1 "*) :;; |
| 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 | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 213 | case $CONFIGS_ENABLED in |
| 214 | *" $1 "*) SKIP_NEXT="YES";; |
| 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 | 0644678 | 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 | 0644678 | 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 | 0644678 | 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 | bc632c2 | 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 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 262 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 263 | requires_openssl_with_fallback_scsv() { |
| 264 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 265 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 266 | then |
| 267 | OPENSSL_HAS_FBSCSV="YES" |
| 268 | else |
| 269 | OPENSSL_HAS_FBSCSV="NO" |
| 270 | fi |
| 271 | fi |
| 272 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 273 | SKIP_NEXT="YES" |
| 274 | fi |
| 275 | } |
| 276 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 277 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 278 | requires_max_content_len() { |
| 279 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 280 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 281 | } |
| 282 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 283 | # skip next test if GnuTLS isn't available |
| 284 | requires_gnutls() { |
| 285 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 286 | 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] | 287 | GNUTLS_AVAILABLE="YES" |
| 288 | else |
| 289 | GNUTLS_AVAILABLE="NO" |
| 290 | fi |
| 291 | fi |
| 292 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 293 | SKIP_NEXT="YES" |
| 294 | fi |
| 295 | } |
| 296 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 297 | # skip next test if GnuTLS-next isn't available |
| 298 | requires_gnutls_next() { |
| 299 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 300 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 301 | GNUTLS_NEXT_AVAILABLE="YES" |
| 302 | else |
| 303 | GNUTLS_NEXT_AVAILABLE="NO" |
| 304 | fi |
| 305 | fi |
| 306 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 307 | SKIP_NEXT="YES" |
| 308 | fi |
| 309 | } |
| 310 | |
| 311 | # skip next test if OpenSSL-legacy isn't available |
| 312 | requires_openssl_legacy() { |
| 313 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 314 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 315 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 316 | else |
| 317 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 318 | fi |
| 319 | fi |
| 320 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 321 | SKIP_NEXT="YES" |
| 322 | fi |
| 323 | } |
| 324 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 325 | # skip next test if IPv6 isn't available on this host |
| 326 | requires_ipv6() { |
| 327 | if [ -z "${HAS_IPV6:-}" ]; then |
| 328 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 329 | SRV_PID=$! |
| 330 | sleep 1 |
| 331 | kill $SRV_PID >/dev/null 2>&1 |
| 332 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 333 | HAS_IPV6="NO" |
| 334 | else |
| 335 | HAS_IPV6="YES" |
| 336 | fi |
| 337 | rm -r $SRV_OUT |
| 338 | fi |
| 339 | |
| 340 | if [ "$HAS_IPV6" = "NO" ]; then |
| 341 | SKIP_NEXT="YES" |
| 342 | fi |
| 343 | } |
| 344 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 345 | # skip next test if it's i686 or uname is not available |
| 346 | requires_not_i686() { |
| 347 | if [ -z "${IS_I686:-}" ]; then |
| 348 | IS_I686="YES" |
| 349 | if which "uname" >/dev/null 2>&1; then |
| 350 | if [ -z "$(uname -a | grep i686)" ]; then |
| 351 | IS_I686="NO" |
| 352 | fi |
| 353 | fi |
| 354 | fi |
| 355 | if [ "$IS_I686" = "YES" ]; then |
| 356 | SKIP_NEXT="YES" |
| 357 | fi |
| 358 | } |
| 359 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 360 | # Calculate the input & output maximum content lengths set in the config |
Yuto Takano | bbf657a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 361 | MAX_CONTENT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_MAX_CONTENT_LEN" ) |
| 362 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 363 | 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] | 364 | |
Yuto Takano | 2e580ce | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 365 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 366 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 367 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 368 | fi |
| 369 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 370 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 371 | fi |
| 372 | |
| 373 | # skip the next test if the SSL output buffer is less than 16KB |
| 374 | requires_full_size_output_buffer() { |
| 375 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 376 | SKIP_NEXT="YES" |
| 377 | fi |
| 378 | } |
| 379 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 380 | # skip the next test if valgrind is in use |
| 381 | not_with_valgrind() { |
| 382 | if [ "$MEMCHECK" -gt 0 ]; then |
| 383 | SKIP_NEXT="YES" |
| 384 | fi |
| 385 | } |
| 386 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 387 | # skip the next test if valgrind is NOT in use |
| 388 | only_with_valgrind() { |
| 389 | if [ "$MEMCHECK" -eq 0 ]; then |
| 390 | SKIP_NEXT="YES" |
| 391 | fi |
| 392 | } |
| 393 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 394 | # 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] | 395 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 396 | CLI_DELAY_FACTOR=$1 |
| 397 | } |
| 398 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 399 | # wait for the given seconds after the client finished in the next test |
| 400 | server_needs_more_time() { |
| 401 | SRV_DELAY_SECONDS=$1 |
| 402 | } |
| 403 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 404 | # print_name <name> |
| 405 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 406 | TESTS=$(( $TESTS + 1 )) |
| 407 | LINE="" |
| 408 | |
| 409 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 410 | LINE="$TESTS " |
| 411 | fi |
| 412 | |
| 413 | LINE="$LINE$1" |
Gilles Peskine | ffdcadf | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 414 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 415 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 416 | for i in `seq 1 $LEN`; do printf '.'; done |
| 417 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 418 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 419 | } |
| 420 | |
| 421 | # fail <message> |
| 422 | fail() { |
| 423 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 424 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 425 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 426 | mv $SRV_OUT o-srv-${TESTS}.log |
| 427 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 428 | if [ -n "$PXY_CMD" ]; then |
| 429 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 430 | fi |
| 431 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 432 | |
Manuel Pégourié-Gonnard | e63fc6d | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 433 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 434 | echo " ! server output:" |
| 435 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 436 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 437 | echo " ! client output:" |
| 438 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 439 | if [ -n "$PXY_CMD" ]; then |
| 440 | echo " ! ========================================================" |
| 441 | echo " ! proxy output:" |
| 442 | cat o-pxy-${TESTS}.log |
| 443 | fi |
| 444 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 445 | fi |
| 446 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 447 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 448 | } |
| 449 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 450 | # is_polar <cmd_line> |
| 451 | is_polar() { |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 452 | case "$1" in |
| 453 | *ssl_client2*) true;; |
| 454 | *ssl_server2*) true;; |
| 455 | *) false;; |
| 456 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 457 | } |
| 458 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 459 | # openssl s_server doesn't have -www with DTLS |
| 460 | check_osrv_dtls() { |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 461 | case "$SRV_CMD" in |
| 462 | *s_server*-dtls*) |
| 463 | NEEDS_INPUT=1 |
| 464 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 465 | *) NEEDS_INPUT=0;; |
| 466 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 467 | } |
| 468 | |
| 469 | # provide input to commands that need it |
| 470 | provide_input() { |
| 471 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 472 | return |
| 473 | fi |
| 474 | |
| 475 | while true; do |
| 476 | echo "HTTP/1.0 200 OK" |
| 477 | sleep 1 |
| 478 | done |
| 479 | } |
| 480 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 481 | # has_mem_err <log_file_name> |
| 482 | has_mem_err() { |
| 483 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 484 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 485 | then |
| 486 | return 1 # false: does not have errors |
| 487 | else |
| 488 | return 0 # true: has errors |
| 489 | fi |
| 490 | } |
| 491 | |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 492 | # 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] | 493 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 494 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 495 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 496 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 497 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 498 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 499 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 500 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 501 | # Make a tight loop, server normally takes less than 1s to start. |
| 502 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 503 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 504 | echo "$3 START TIMEOUT" |
| 505 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 506 | break |
| 507 | fi |
| 508 | # Linux and *BSD support decimal arguments to sleep. On other |
| 509 | # OSes this may be a tight loop. |
| 510 | sleep 0.1 2>/dev/null || true |
| 511 | done |
| 512 | } |
| 513 | else |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 514 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 515 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 516 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 517 | } |
| 518 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 519 | |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 520 | # Wait for server process $2 to be listening on port $1. |
| 521 | wait_server_start() { |
| 522 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 523 | } |
| 524 | |
| 525 | # Wait for proxy process $2 to be listening on port $1. |
| 526 | wait_proxy_start() { |
| 527 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 528 | } |
| 529 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 530 | # 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] | 531 | # 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] | 532 | # acceptable bounds |
| 533 | check_server_hello_time() { |
| 534 | # 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] | 535 | 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] | 536 | # Get the Unix timestamp for now |
| 537 | CUR_TIME=$(date +'%s') |
| 538 | THRESHOLD_IN_SECS=300 |
| 539 | |
| 540 | # Check if the ServerHello time was printed |
| 541 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 542 | return 1 |
| 543 | fi |
| 544 | |
| 545 | # Check the time in ServerHello is within acceptable bounds |
| 546 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 547 | # The time in ServerHello is at least 5 minutes before now |
| 548 | return 1 |
| 549 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 550 | # 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] | 551 | return 1 |
| 552 | else |
| 553 | return 0 |
| 554 | fi |
| 555 | } |
| 556 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 557 | # wait for client to terminate and set CLI_EXIT |
| 558 | # must be called right after starting the client |
| 559 | wait_client_done() { |
| 560 | CLI_PID=$! |
| 561 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 562 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 563 | CLI_DELAY_FACTOR=1 |
| 564 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 565 | ( 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] | 566 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 567 | |
| 568 | wait $CLI_PID |
| 569 | CLI_EXIT=$? |
| 570 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 571 | kill $DOG_PID >/dev/null 2>&1 |
| 572 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 573 | |
| 574 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 575 | |
| 576 | sleep $SRV_DELAY_SECONDS |
| 577 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 578 | } |
| 579 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 580 | # check if the given command uses dtls and sets global variable DTLS |
| 581 | detect_dtls() { |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 582 | case "$1" in |
| 583 | *dtls=1*|-dtls|-u) DTLS=1;; |
| 584 | *) DTLS=0;; |
| 585 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 586 | } |
| 587 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 588 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 589 | # Options: -s pattern pattern that must be present in server output |
| 590 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 591 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 592 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 593 | # -S pattern pattern that must be absent in server output |
| 594 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 595 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 596 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 597 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 598 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 599 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 600 | |
Gilles Peskine | b7bb068b | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 601 | if is_excluded "$NAME"; then |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 602 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 603 | return |
| 604 | fi |
| 605 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 606 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 607 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 608 | # Do we only run numbered tests? |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 609 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 610 | case ",$RUN_TEST_NUMBER," in |
| 611 | *",$TESTS,"*) :;; |
| 612 | *) SKIP_NEXT="YES";; |
| 613 | esac |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 614 | fi |
| 615 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 616 | # should we skip? |
| 617 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 618 | SKIP_NEXT="NO" |
| 619 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 620 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 621 | return |
| 622 | fi |
| 623 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 624 | # does this test use a proxy? |
| 625 | if [ "X$1" = "X-p" ]; then |
| 626 | PXY_CMD="$2" |
| 627 | shift 2 |
| 628 | else |
| 629 | PXY_CMD="" |
| 630 | fi |
| 631 | |
| 632 | # get commands and client output |
| 633 | SRV_CMD="$1" |
| 634 | CLI_CMD="$2" |
| 635 | CLI_EXPECT="$3" |
| 636 | shift 3 |
| 637 | |
Hanno Becker | 7a11e72 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 638 | # Check if test uses files |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 639 | case "$SRV_CMD $CLI_CMD" in |
| 640 | *data_files/*) |
| 641 | requires_config_enabled MBEDTLS_FS_IO;; |
| 642 | esac |
Hanno Becker | 7a11e72 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 643 | |
| 644 | # should we skip? |
| 645 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 646 | SKIP_NEXT="NO" |
| 647 | echo "SKIP" |
| 648 | SKIPS=$(( $SKIPS + 1 )) |
| 649 | return |
| 650 | fi |
| 651 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 652 | # update DTLS variable |
| 653 | detect_dtls "$SRV_CMD" |
| 654 | |
Manuel Pégourié-Gonnard | fcf6c16 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 655 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 656 | # as it provides timing info that's useful to debug failures |
Manuel Pégourié-Gonnard | 581af9f | 2020-06-25 09:54:46 +0200 | [diff] [blame] | 657 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | fcf6c16 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 658 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 7442f84 | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 659 | case " $SRV_CMD " in |
| 660 | *' server_addr=::1 '*) |
| 661 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 662 | esac |
Manuel Pégourié-Gonnard | fcf6c16 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 663 | fi |
| 664 | |
Manuel Pégourié-Gonnard | bedcb3e | 2020-06-25 09:52:54 +0200 | [diff] [blame] | 665 | # fix client port |
| 666 | if [ -n "$PXY_CMD" ]; then |
| 667 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 668 | else |
| 669 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 670 | fi |
| 671 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 672 | # prepend valgrind to our commands if active |
| 673 | if [ "$MEMCHECK" -gt 0 ]; then |
| 674 | if is_polar "$SRV_CMD"; then |
| 675 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 676 | fi |
| 677 | if is_polar "$CLI_CMD"; then |
| 678 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 679 | fi |
| 680 | fi |
| 681 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 682 | TIMES_LEFT=2 |
| 683 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 684 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 685 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 686 | # run the commands |
| 687 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a1919ad | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 688 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 689 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 690 | PXY_PID=$! |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 691 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 692 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 693 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 694 | check_osrv_dtls |
Gilles Peskine | ffdcadf | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 695 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 696 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 697 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 698 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 699 | |
Gilles Peskine | ffdcadf | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 700 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 701 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 702 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 703 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 704 | sleep 0.05 |
| 705 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 706 | # terminate the server (and the proxy) |
| 707 | kill $SRV_PID |
| 708 | wait $SRV_PID |
Gilles Peskine | 634fe27 | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 709 | SRV_RET=$? |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 710 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 711 | if [ -n "$PXY_CMD" ]; then |
| 712 | kill $PXY_PID >/dev/null 2>&1 |
| 713 | wait $PXY_PID |
| 714 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 715 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 716 | # retry only on timeouts |
| 717 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 718 | printf "RETRY " |
| 719 | else |
| 720 | TIMES_LEFT=0 |
| 721 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 722 | done |
| 723 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 724 | # 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] | 725 | # (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] | 726 | # expected client exit to incorrectly succeed in case of catastrophic |
| 727 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 728 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 729 | 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] | 730 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 731 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 732 | return |
| 733 | fi |
| 734 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 735 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 736 | 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] | 737 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 738 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 739 | return |
| 740 | fi |
| 741 | fi |
| 742 | |
Gilles Peskine | 2cf44b6 | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 743 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 744 | # exit with status 0 when interrupted by a signal, and we don't really |
| 745 | # care anyway), in case e.g. the server reports a memory leak. |
| 746 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 634fe27 | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 747 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 748 | return |
| 749 | fi |
| 750 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 751 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 752 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 753 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 754 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 755 | 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] | 756 | return |
| 757 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 758 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 759 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 760 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 761 | # 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] | 762 | while [ $# -gt 0 ] |
| 763 | do |
| 764 | case $1 in |
| 765 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 766 | 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] | 767 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 768 | return |
| 769 | fi |
| 770 | ;; |
| 771 | |
| 772 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 773 | 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] | 774 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 775 | return |
| 776 | fi |
| 777 | ;; |
| 778 | |
| 779 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 780 | if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 781 | fail "pattern '$2' MUST NOT be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 782 | return |
| 783 | fi |
| 784 | ;; |
| 785 | |
| 786 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 787 | if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 788 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 789 | return |
| 790 | fi |
| 791 | ;; |
| 792 | |
| 793 | # The filtering in the following two options (-u and -U) do the following |
| 794 | # - ignore valgrind output |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 795 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 796 | # - keep one of each non-unique line |
| 797 | # - count how many lines remain |
| 798 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 799 | # if there were no duplicates. |
| 800 | "-U") |
| 801 | 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 |
| 802 | fail "lines following pattern '$2' must be unique in Server output" |
| 803 | return |
| 804 | fi |
| 805 | ;; |
| 806 | |
| 807 | "-u") |
| 808 | 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 |
| 809 | 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] | 810 | return |
| 811 | fi |
| 812 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 813 | "-F") |
| 814 | if ! $2 "$SRV_OUT"; then |
| 815 | fail "function call to '$2' failed on Server output" |
| 816 | return |
| 817 | fi |
| 818 | ;; |
| 819 | "-f") |
| 820 | if ! $2 "$CLI_OUT"; then |
| 821 | fail "function call to '$2' failed on Client output" |
| 822 | return |
| 823 | fi |
| 824 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 825 | |
| 826 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 827 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 828 | exit 1 |
| 829 | esac |
| 830 | shift 2 |
| 831 | done |
| 832 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 833 | # check valgrind's results |
| 834 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 835 | 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] | 836 | fail "Server has memory errors" |
| 837 | return |
| 838 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 839 | 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] | 840 | fail "Client has memory errors" |
| 841 | return |
| 842 | fi |
| 843 | fi |
| 844 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 845 | # if we're here, everything is ok |
| 846 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 847 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 848 | mv $SRV_OUT o-srv-${TESTS}.log |
| 849 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 850 | if [ -n "$PXY_CMD" ]; then |
| 851 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 852 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 853 | fi |
| 854 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 855 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 856 | } |
| 857 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 858 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 859 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 860 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 861 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 862 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 863 | 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] | 864 | exit 1 |
| 865 | } |
| 866 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 867 | # |
| 868 | # MAIN |
| 869 | # |
| 870 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 871 | get_options "$@" |
| 872 | |
Gilles Peskine | b7bb068b | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 873 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 874 | # patterns rather than regular expressions, use a case statement instead |
| 875 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 876 | # detects simple cases: plain substring, everything, nothing. |
| 877 | # |
| 878 | # As an exception, the character '.' is treated as an ordinary character |
| 879 | # if it is the only special character in the string. This is because it's |
| 880 | # rare to need "any one character", but needing a literal '.' is common |
| 881 | # (e.g. '-f "DTLS 1.2"'). |
| 882 | need_grep= |
| 883 | case "$FILTER" in |
| 884 | '^$') simple_filter=;; |
| 885 | '.*') simple_filter='*';; |
Gilles Peskine | c5714bb | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 886 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | b7bb068b | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 887 | need_grep=1;; |
| 888 | *) # No regexp or shell-pattern special character |
| 889 | simple_filter="*$FILTER*";; |
| 890 | esac |
| 891 | case "$EXCLUDE" in |
| 892 | '^$') simple_exclude=;; |
| 893 | '.*') simple_exclude='*';; |
Gilles Peskine | c5714bb | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 894 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | b7bb068b | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 895 | need_grep=1;; |
| 896 | *) # No regexp or shell-pattern special character |
| 897 | simple_exclude="*$EXCLUDE*";; |
| 898 | esac |
| 899 | if [ -n "$need_grep" ]; then |
| 900 | is_excluded () { |
| 901 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 902 | } |
| 903 | else |
| 904 | is_excluded () { |
| 905 | case "$1" in |
| 906 | $simple_exclude) true;; |
| 907 | $simple_filter) false;; |
| 908 | *) true;; |
| 909 | esac |
| 910 | } |
| 911 | fi |
| 912 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 913 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 914 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 915 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 916 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 917 | if [ ! -x "$P_SRV_BIN" ]; then |
| 918 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 919 | exit 1 |
| 920 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 921 | if [ ! -x "$P_CLI_BIN" ]; then |
| 922 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 923 | exit 1 |
| 924 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 925 | if [ ! -x "$P_PXY_BIN" ]; then |
| 926 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 927 | exit 1 |
| 928 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 929 | if [ "$MEMCHECK" -gt 0 ]; then |
| 930 | if which valgrind >/dev/null 2>&1; then :; else |
| 931 | echo "Memcheck not possible. Valgrind not found" |
| 932 | exit 1 |
| 933 | fi |
| 934 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 935 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 936 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 937 | exit 1 |
| 938 | fi |
| 939 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 940 | # used by watchdog |
| 941 | MAIN_PID="$$" |
| 942 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 943 | # We use somewhat arbitrary delays for tests: |
| 944 | # - how long do we wait for the server to start (when lsof not available)? |
| 945 | # - how long do we allow for the client to finish? |
| 946 | # (not to check performance, just to avoid waiting indefinitely) |
| 947 | # Things are slower with valgrind, so give extra time here. |
| 948 | # |
| 949 | # Note: without lsof, there is a trade-off between the running time of this |
| 950 | # script and the risk of spurious errors because we didn't wait long enough. |
| 951 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 952 | # 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] | 953 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 954 | START_DELAY=6 |
| 955 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 956 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 957 | START_DELAY=2 |
| 958 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 959 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 960 | |
| 961 | # some particular tests need more time: |
| 962 | # - for the client, we multiply the usual watchdog limit by a factor |
| 963 | # - for the server, we sleep for a number of seconds after the client exits |
| 964 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 965 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 966 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 967 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 968 | # 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] | 969 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 970 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 971 | 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] | 972 | 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 | 63a2b91 | 2021-04-01 14:00:11 +0200 | [diff] [blame] | 973 | O_SRV="$O_SRV -accept $SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 974 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 975 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 976 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 977 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 978 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 979 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 980 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 981 | fi |
| 982 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 983 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 984 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 985 | fi |
| 986 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 987 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 988 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 989 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 990 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 991 | # Allow SHA-1, because many of our test certificates use it |
| 992 | P_SRV="$P_SRV allow_sha1=1" |
| 993 | P_CLI="$P_CLI allow_sha1=1" |
| 994 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 995 | # Also pick a unique name for intermediate files |
| 996 | SRV_OUT="srv_out.$$" |
| 997 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 998 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 999 | SESSION="session.$$" |
| 1000 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1001 | SKIP_NEXT="NO" |
| 1002 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1003 | trap cleanup INT TERM HUP |
| 1004 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1005 | # Basic test |
| 1006 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1007 | # Checks that: |
| 1008 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1009 | # - the expected (highest security) parameters are selected |
| 1010 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1011 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1012 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1013 | "$P_CLI" \ |
| 1014 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1015 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1016 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1017 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1018 | -s "ECDHE curve: secp521r1" \ |
| 1019 | -S "error" \ |
| 1020 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1021 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1022 | run_test "Default, DTLS" \ |
| 1023 | "$P_SRV dtls=1" \ |
| 1024 | "$P_CLI dtls=1" \ |
| 1025 | 0 \ |
| 1026 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1027 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1028 | |
Manuel Pégourié-Gonnard | 95a17fb | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1029 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1030 | run_test "Default (compression enabled)" \ |
| 1031 | "$P_SRV debug_level=3" \ |
| 1032 | "$P_CLI debug_level=3" \ |
| 1033 | 0 \ |
| 1034 | -s "Allocating compression buffer" \ |
| 1035 | -c "Allocating compression buffer" \ |
| 1036 | -s "Record expansion is unknown (compression)" \ |
| 1037 | -c "Record expansion is unknown (compression)" \ |
| 1038 | -S "error" \ |
| 1039 | -C "error" |
| 1040 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1041 | # Test current time in ServerHello |
| 1042 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1043 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1044 | "$P_SRV debug_level=3" \ |
| 1045 | "$P_CLI debug_level=3" \ |
| 1046 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1047 | -f "check_server_hello_time" \ |
| 1048 | -F "check_server_hello_time" |
| 1049 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1050 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1051 | run_test "Unique IV in GCM" \ |
| 1052 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1053 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1054 | 0 \ |
| 1055 | -u "IV used" \ |
| 1056 | -U "IV used" |
| 1057 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1058 | # Tests for rc4 option |
| 1059 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1060 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1061 | run_test "RC4: server disabled, client enabled" \ |
| 1062 | "$P_SRV" \ |
| 1063 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1064 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1065 | -s "SSL - The server has no ciphersuites in common" |
| 1066 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1067 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1068 | run_test "RC4: server half, client enabled" \ |
| 1069 | "$P_SRV arc4=1" \ |
| 1070 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1071 | 1 \ |
| 1072 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1073 | |
| 1074 | run_test "RC4: server enabled, client disabled" \ |
| 1075 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1076 | "$P_CLI" \ |
| 1077 | 1 \ |
| 1078 | -s "SSL - The server has no ciphersuites in common" |
| 1079 | |
| 1080 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1081 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1082 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1083 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1084 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1085 | -S "SSL - The server has no ciphersuites in common" |
| 1086 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1087 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1088 | |
| 1089 | requires_gnutls |
| 1090 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1091 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1092 | "$G_SRV"\ |
| 1093 | "$P_CLI force_version=tls1_1" \ |
| 1094 | 0 |
| 1095 | |
| 1096 | requires_gnutls |
| 1097 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1098 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1099 | "$G_SRV"\ |
| 1100 | "$P_CLI force_version=tls1" \ |
| 1101 | 0 |
| 1102 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1103 | # Tests for SHA-1 support |
| 1104 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1105 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1106 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1107 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1108 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1109 | 1 \ |
| 1110 | -c "The certificate is signed with an unacceptable hash" |
| 1111 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1112 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1113 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1114 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1115 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1116 | 0 |
| 1117 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1118 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1119 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1120 | "$P_CLI allow_sha1=1" \ |
| 1121 | 0 |
| 1122 | |
| 1123 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1124 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1125 | "$P_CLI allow_sha1=0" \ |
| 1126 | 0 |
| 1127 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1128 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1129 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1130 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1131 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1132 | 1 \ |
| 1133 | -s "The certificate is signed with an unacceptable hash" |
| 1134 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1135 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1136 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1137 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1138 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1139 | 0 |
| 1140 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1141 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1142 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1143 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1144 | 0 |
| 1145 | |
| 1146 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1147 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1148 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1149 | 0 |
| 1150 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1151 | # Tests for datagram packing |
| 1152 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1153 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1154 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1155 | 0 \ |
| 1156 | -c "next record in same datagram" \ |
| 1157 | -s "next record in same datagram" |
| 1158 | |
| 1159 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1160 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1161 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1162 | 0 \ |
| 1163 | -s "next record in same datagram" \ |
| 1164 | -C "next record in same datagram" |
| 1165 | |
| 1166 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1167 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1168 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1169 | 0 \ |
| 1170 | -S "next record in same datagram" \ |
| 1171 | -c "next record in same datagram" |
| 1172 | |
| 1173 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1174 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1175 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1176 | 0 \ |
| 1177 | -S "next record in same datagram" \ |
| 1178 | -C "next record in same datagram" |
| 1179 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1180 | # Tests for Truncated HMAC extension |
| 1181 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1182 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1183 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1184 | "$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] | 1185 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1186 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1187 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1188 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1189 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1190 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1191 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1192 | "$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] | 1193 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1194 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1195 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1196 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1197 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1198 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1199 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1200 | "$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] | 1201 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1202 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1203 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1204 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1205 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1206 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1207 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1208 | "$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] | 1209 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1210 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1211 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1212 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1213 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1214 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1215 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1216 | "$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] | 1217 | 0 \ |
| 1218 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1219 | -S "dumping 'expected mac' (10 bytes)" |
| 1220 | |
| 1221 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1222 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1223 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1224 | "$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] | 1225 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1226 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1227 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1228 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1229 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1230 | "$P_SRV dtls=1 debug_level=4" \ |
| 1231 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1232 | 0 \ |
| 1233 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1234 | -S "dumping 'expected mac' (10 bytes)" |
| 1235 | |
| 1236 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1237 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1238 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1239 | "$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] | 1240 | 0 \ |
| 1241 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1242 | -S "dumping 'expected mac' (10 bytes)" |
| 1243 | |
| 1244 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1245 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1246 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1247 | "$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] | 1248 | 0 \ |
| 1249 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1250 | -S "dumping 'expected mac' (10 bytes)" |
| 1251 | |
| 1252 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1253 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1254 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1255 | "$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] | 1256 | 0 \ |
| 1257 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1258 | -S "dumping 'expected mac' (10 bytes)" |
| 1259 | |
| 1260 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1261 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1262 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1263 | "$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] | 1264 | 0 \ |
| 1265 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1266 | -S "dumping 'expected mac' (10 bytes)" |
| 1267 | |
| 1268 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1269 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1270 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1271 | "$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] | 1272 | 0 \ |
| 1273 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1274 | -s "dumping 'expected mac' (10 bytes)" |
| 1275 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1276 | # Tests for Encrypt-then-MAC extension |
| 1277 | |
| 1278 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1279 | "$P_SRV debug_level=3 \ |
| 1280 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1281 | "$P_CLI debug_level=3" \ |
| 1282 | 0 \ |
| 1283 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1284 | -s "found encrypt then mac extension" \ |
| 1285 | -s "server hello, adding encrypt then mac extension" \ |
| 1286 | -c "found encrypt_then_mac extension" \ |
| 1287 | -c "using encrypt then mac" \ |
| 1288 | -s "using encrypt then mac" |
| 1289 | |
| 1290 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1291 | "$P_SRV debug_level=3 etm=0 \ |
| 1292 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1293 | "$P_CLI debug_level=3 etm=1" \ |
| 1294 | 0 \ |
| 1295 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1296 | -s "found encrypt then mac extension" \ |
| 1297 | -S "server hello, adding encrypt then mac extension" \ |
| 1298 | -C "found encrypt_then_mac extension" \ |
| 1299 | -C "using encrypt then mac" \ |
| 1300 | -S "using encrypt then mac" |
| 1301 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1302 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1303 | "$P_SRV debug_level=3 etm=1 \ |
| 1304 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1305 | "$P_CLI debug_level=3 etm=1" \ |
| 1306 | 0 \ |
| 1307 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1308 | -s "found encrypt then mac extension" \ |
| 1309 | -S "server hello, adding encrypt then mac extension" \ |
| 1310 | -C "found encrypt_then_mac extension" \ |
| 1311 | -C "using encrypt then mac" \ |
| 1312 | -S "using encrypt then mac" |
| 1313 | |
| 1314 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1315 | "$P_SRV debug_level=3 etm=1 \ |
| 1316 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1317 | "$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] | 1318 | 0 \ |
| 1319 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1320 | -s "found encrypt then mac extension" \ |
| 1321 | -S "server hello, adding encrypt then mac extension" \ |
| 1322 | -C "found encrypt_then_mac extension" \ |
| 1323 | -C "using encrypt then mac" \ |
| 1324 | -S "using encrypt then mac" |
| 1325 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1326 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1327 | "$P_SRV debug_level=3 etm=1 \ |
| 1328 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1329 | "$P_CLI debug_level=3 etm=0" \ |
| 1330 | 0 \ |
| 1331 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1332 | -S "found encrypt then mac extension" \ |
| 1333 | -S "server hello, adding encrypt then mac extension" \ |
| 1334 | -C "found encrypt_then_mac extension" \ |
| 1335 | -C "using encrypt then mac" \ |
| 1336 | -S "using encrypt then mac" |
| 1337 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1338 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1339 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1340 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1341 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1342 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1343 | 0 \ |
| 1344 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1345 | -S "found encrypt then mac extension" \ |
| 1346 | -S "server hello, adding encrypt then mac extension" \ |
| 1347 | -C "found encrypt_then_mac extension" \ |
| 1348 | -C "using encrypt then mac" \ |
| 1349 | -S "using encrypt then mac" |
| 1350 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1351 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1352 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1353 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1354 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1355 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1356 | 0 \ |
| 1357 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1358 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1359 | -S "server hello, adding encrypt then mac extension" \ |
| 1360 | -C "found encrypt_then_mac extension" \ |
| 1361 | -C "using encrypt then mac" \ |
| 1362 | -S "using encrypt then mac" |
| 1363 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1364 | # Tests for Extended Master Secret extension |
| 1365 | |
| 1366 | run_test "Extended Master Secret: default" \ |
| 1367 | "$P_SRV debug_level=3" \ |
| 1368 | "$P_CLI debug_level=3" \ |
| 1369 | 0 \ |
| 1370 | -c "client hello, adding extended_master_secret extension" \ |
| 1371 | -s "found extended master secret extension" \ |
| 1372 | -s "server hello, adding extended master secret extension" \ |
| 1373 | -c "found extended_master_secret extension" \ |
| 1374 | -c "using extended master secret" \ |
| 1375 | -s "using extended master secret" |
| 1376 | |
| 1377 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1378 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1379 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1380 | 0 \ |
| 1381 | -c "client hello, adding extended_master_secret extension" \ |
| 1382 | -s "found extended master secret extension" \ |
| 1383 | -S "server hello, adding extended master secret extension" \ |
| 1384 | -C "found extended_master_secret extension" \ |
| 1385 | -C "using extended master secret" \ |
| 1386 | -S "using extended master secret" |
| 1387 | |
| 1388 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1389 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1390 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1391 | 0 \ |
| 1392 | -C "client hello, adding extended_master_secret extension" \ |
| 1393 | -S "found extended master secret extension" \ |
| 1394 | -S "server hello, adding extended master secret extension" \ |
| 1395 | -C "found extended_master_secret extension" \ |
| 1396 | -C "using extended master secret" \ |
| 1397 | -S "using extended master secret" |
| 1398 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1399 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1400 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1401 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1402 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1403 | 0 \ |
| 1404 | -C "client hello, adding extended_master_secret extension" \ |
| 1405 | -S "found extended master secret extension" \ |
| 1406 | -S "server hello, adding extended master secret extension" \ |
| 1407 | -C "found extended_master_secret extension" \ |
| 1408 | -C "using extended master secret" \ |
| 1409 | -S "using extended master secret" |
| 1410 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1411 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1412 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1413 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1414 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1415 | 0 \ |
| 1416 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1417 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1418 | -S "server hello, adding extended master secret extension" \ |
| 1419 | -C "found extended_master_secret extension" \ |
| 1420 | -C "using extended master secret" \ |
| 1421 | -S "using extended master secret" |
| 1422 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1423 | # Tests for FALLBACK_SCSV |
| 1424 | |
| 1425 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1426 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1427 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1428 | 0 \ |
| 1429 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1430 | -S "received FALLBACK_SCSV" \ |
| 1431 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1432 | -C "is a fatal alert message (msg 86)" |
| 1433 | |
| 1434 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1435 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1436 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1437 | 0 \ |
| 1438 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1439 | -S "received FALLBACK_SCSV" \ |
| 1440 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1441 | -C "is a fatal alert message (msg 86)" |
| 1442 | |
| 1443 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1444 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1445 | "$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] | 1446 | 1 \ |
| 1447 | -c "adding FALLBACK_SCSV" \ |
| 1448 | -s "received FALLBACK_SCSV" \ |
| 1449 | -s "inapropriate fallback" \ |
| 1450 | -c "is a fatal alert message (msg 86)" |
| 1451 | |
| 1452 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1453 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1454 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1455 | 0 \ |
| 1456 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1457 | -s "received FALLBACK_SCSV" \ |
| 1458 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1459 | -C "is a fatal alert message (msg 86)" |
| 1460 | |
| 1461 | requires_openssl_with_fallback_scsv |
| 1462 | run_test "Fallback SCSV: default, openssl server" \ |
| 1463 | "$O_SRV" \ |
| 1464 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1465 | 0 \ |
| 1466 | -C "adding FALLBACK_SCSV" \ |
| 1467 | -C "is a fatal alert message (msg 86)" |
| 1468 | |
| 1469 | requires_openssl_with_fallback_scsv |
| 1470 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1471 | "$O_SRV" \ |
| 1472 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1473 | 1 \ |
| 1474 | -c "adding FALLBACK_SCSV" \ |
| 1475 | -c "is a fatal alert message (msg 86)" |
| 1476 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1477 | requires_openssl_with_fallback_scsv |
| 1478 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1479 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1480 | "$O_CLI -tls1_1" \ |
| 1481 | 0 \ |
| 1482 | -S "received FALLBACK_SCSV" \ |
| 1483 | -S "inapropriate fallback" |
| 1484 | |
| 1485 | requires_openssl_with_fallback_scsv |
| 1486 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1487 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1488 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1489 | 1 \ |
| 1490 | -s "received FALLBACK_SCSV" \ |
| 1491 | -s "inapropriate fallback" |
| 1492 | |
| 1493 | requires_openssl_with_fallback_scsv |
| 1494 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1495 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1496 | "$O_CLI -fallback_scsv" \ |
| 1497 | 0 \ |
| 1498 | -s "received FALLBACK_SCSV" \ |
| 1499 | -S "inapropriate fallback" |
| 1500 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1501 | # Test sending and receiving empty application data records |
| 1502 | |
| 1503 | run_test "Encrypt then MAC: empty application data record" \ |
| 1504 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1505 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1506 | 0 \ |
| 1507 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1508 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1509 | -c "0 bytes written in 1 fragments" |
| 1510 | |
Manuel Pégourié-Gonnard | 98a879a | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 1511 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1512 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1513 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1514 | 0 \ |
| 1515 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1516 | -c "0 bytes written in 1 fragments" |
| 1517 | |
| 1518 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1519 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1520 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1521 | 0 \ |
| 1522 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1523 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1524 | -c "0 bytes written in 1 fragments" |
| 1525 | |
Manuel Pégourié-Gonnard | 98a879a | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 1526 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1527 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1528 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1529 | 0 \ |
| 1530 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1531 | -c "0 bytes written in 1 fragments" |
| 1532 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1533 | ## ClientHello generated with |
| 1534 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1535 | ## then manually twiddling the ciphersuite list. |
| 1536 | ## The ClientHello content is spelled out below as a hex string as |
| 1537 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1538 | ## The expected response is an inappropriate_fallback alert. |
| 1539 | requires_openssl_with_fallback_scsv |
| 1540 | run_test "Fallback SCSV: beginning of list" \ |
| 1541 | "$P_SRV debug_level=2" \ |
| 1542 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1543 | 0 \ |
| 1544 | -s "received FALLBACK_SCSV" \ |
| 1545 | -s "inapropriate fallback" |
| 1546 | |
| 1547 | requires_openssl_with_fallback_scsv |
| 1548 | run_test "Fallback SCSV: end of list" \ |
| 1549 | "$P_SRV debug_level=2" \ |
| 1550 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1551 | 0 \ |
| 1552 | -s "received FALLBACK_SCSV" \ |
| 1553 | -s "inapropriate fallback" |
| 1554 | |
| 1555 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1556 | requires_openssl_with_fallback_scsv |
| 1557 | run_test "Fallback SCSV: not in list" \ |
| 1558 | "$P_SRV debug_level=2" \ |
| 1559 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1560 | 0 \ |
| 1561 | -S "received FALLBACK_SCSV" \ |
| 1562 | -S "inapropriate fallback" |
| 1563 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1564 | # Tests for CBC 1/n-1 record splitting |
| 1565 | |
| 1566 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1567 | "$P_SRV" \ |
| 1568 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1569 | request_size=123 force_version=tls1_2" \ |
| 1570 | 0 \ |
| 1571 | -s "Read from client: 123 bytes read" \ |
| 1572 | -S "Read from client: 1 bytes read" \ |
| 1573 | -S "122 bytes read" |
| 1574 | |
| 1575 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1576 | "$P_SRV" \ |
| 1577 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1578 | request_size=123 force_version=tls1_1" \ |
| 1579 | 0 \ |
| 1580 | -s "Read from client: 123 bytes read" \ |
| 1581 | -S "Read from client: 1 bytes read" \ |
| 1582 | -S "122 bytes read" |
| 1583 | |
| 1584 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1585 | "$P_SRV" \ |
| 1586 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1587 | request_size=123 force_version=tls1" \ |
| 1588 | 0 \ |
| 1589 | -S "Read from client: 123 bytes read" \ |
| 1590 | -s "Read from client: 1 bytes read" \ |
| 1591 | -s "122 bytes read" |
| 1592 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1593 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1594 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1595 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1596 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1597 | request_size=123 force_version=ssl3" \ |
| 1598 | 0 \ |
| 1599 | -S "Read from client: 123 bytes read" \ |
| 1600 | -s "Read from client: 1 bytes read" \ |
| 1601 | -s "122 bytes read" |
| 1602 | |
| 1603 | 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] | 1604 | "$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] | 1605 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1606 | request_size=123 force_version=tls1" \ |
| 1607 | 0 \ |
| 1608 | -s "Read from client: 123 bytes read" \ |
| 1609 | -S "Read from client: 1 bytes read" \ |
| 1610 | -S "122 bytes read" |
| 1611 | |
| 1612 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1613 | "$P_SRV" \ |
| 1614 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1615 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1616 | 0 \ |
| 1617 | -s "Read from client: 123 bytes read" \ |
| 1618 | -S "Read from client: 1 bytes read" \ |
| 1619 | -S "122 bytes read" |
| 1620 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1621 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1622 | "$P_SRV nbio=2" \ |
| 1623 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1624 | request_size=123 force_version=tls1" \ |
| 1625 | 0 \ |
| 1626 | -S "Read from client: 123 bytes read" \ |
| 1627 | -s "Read from client: 1 bytes read" \ |
| 1628 | -s "122 bytes read" |
| 1629 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1630 | # Tests for Session Tickets |
| 1631 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1632 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1633 | "$P_SRV debug_level=3 tickets=1" \ |
| 1634 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1635 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1636 | -c "client hello, adding session ticket extension" \ |
| 1637 | -s "found session ticket extension" \ |
| 1638 | -s "server hello, adding session ticket extension" \ |
| 1639 | -c "found session_ticket extension" \ |
| 1640 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1641 | -S "session successfully restored from cache" \ |
| 1642 | -s "session successfully restored from ticket" \ |
| 1643 | -s "a session has been resumed" \ |
| 1644 | -c "a session has been resumed" |
| 1645 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1646 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1647 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1648 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1649 | 0 \ |
| 1650 | -c "client hello, adding session ticket extension" \ |
| 1651 | -s "found session ticket extension" \ |
| 1652 | -s "server hello, adding session ticket extension" \ |
| 1653 | -c "found session_ticket extension" \ |
| 1654 | -c "parse new session ticket" \ |
| 1655 | -S "session successfully restored from cache" \ |
| 1656 | -s "session successfully restored from ticket" \ |
| 1657 | -s "a session has been resumed" \ |
| 1658 | -c "a session has been resumed" |
| 1659 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1660 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1661 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1662 | "$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] | 1663 | 0 \ |
| 1664 | -c "client hello, adding session ticket extension" \ |
| 1665 | -s "found session ticket extension" \ |
| 1666 | -s "server hello, adding session ticket extension" \ |
| 1667 | -c "found session_ticket extension" \ |
| 1668 | -c "parse new session ticket" \ |
| 1669 | -S "session successfully restored from cache" \ |
| 1670 | -S "session successfully restored from ticket" \ |
| 1671 | -S "a session has been resumed" \ |
| 1672 | -C "a session has been resumed" |
| 1673 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1674 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1675 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1676 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1677 | 0 \ |
| 1678 | -c "client hello, adding session ticket extension" \ |
| 1679 | -c "found session_ticket extension" \ |
| 1680 | -c "parse new session ticket" \ |
| 1681 | -c "a session has been resumed" |
| 1682 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1683 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1684 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1685 | "( $O_CLI -sess_out $SESSION; \ |
| 1686 | $O_CLI -sess_in $SESSION; \ |
| 1687 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1688 | 0 \ |
| 1689 | -s "found session ticket extension" \ |
| 1690 | -s "server hello, adding session ticket extension" \ |
| 1691 | -S "session successfully restored from cache" \ |
| 1692 | -s "session successfully restored from ticket" \ |
| 1693 | -s "a session has been resumed" |
| 1694 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1695 | # Tests for Session Tickets with DTLS |
| 1696 | |
| 1697 | run_test "Session resume using tickets, DTLS: basic" \ |
| 1698 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1699 | "$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] | 1700 | 0 \ |
| 1701 | -c "client hello, adding session ticket extension" \ |
| 1702 | -s "found session ticket extension" \ |
| 1703 | -s "server hello, adding session ticket extension" \ |
| 1704 | -c "found session_ticket extension" \ |
| 1705 | -c "parse new session ticket" \ |
| 1706 | -S "session successfully restored from cache" \ |
| 1707 | -s "session successfully restored from ticket" \ |
| 1708 | -s "a session has been resumed" \ |
| 1709 | -c "a session has been resumed" |
| 1710 | |
| 1711 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 1712 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1713 | "$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] | 1714 | 0 \ |
| 1715 | -c "client hello, adding session ticket extension" \ |
| 1716 | -s "found session ticket extension" \ |
| 1717 | -s "server hello, adding session ticket extension" \ |
| 1718 | -c "found session_ticket extension" \ |
| 1719 | -c "parse new session ticket" \ |
| 1720 | -S "session successfully restored from cache" \ |
| 1721 | -s "session successfully restored from ticket" \ |
| 1722 | -s "a session has been resumed" \ |
| 1723 | -c "a session has been resumed" |
| 1724 | |
| 1725 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 1726 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1727 | "$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] | 1728 | 0 \ |
| 1729 | -c "client hello, adding session ticket extension" \ |
| 1730 | -s "found session ticket extension" \ |
| 1731 | -s "server hello, adding session ticket extension" \ |
| 1732 | -c "found session_ticket extension" \ |
| 1733 | -c "parse new session ticket" \ |
| 1734 | -S "session successfully restored from cache" \ |
| 1735 | -S "session successfully restored from ticket" \ |
| 1736 | -S "a session has been resumed" \ |
| 1737 | -C "a session has been resumed" |
| 1738 | |
| 1739 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 1740 | "$O_SRV -dtls1" \ |
| 1741 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1742 | 0 \ |
| 1743 | -c "client hello, adding session ticket extension" \ |
| 1744 | -c "found session_ticket extension" \ |
| 1745 | -c "parse new session ticket" \ |
| 1746 | -c "a session has been resumed" |
| 1747 | |
| 1748 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 1749 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 1750 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1751 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1752 | rm -f $SESSION )" \ |
| 1753 | 0 \ |
| 1754 | -s "found session ticket extension" \ |
| 1755 | -s "server hello, adding session ticket extension" \ |
| 1756 | -S "session successfully restored from cache" \ |
| 1757 | -s "session successfully restored from ticket" \ |
| 1758 | -s "a session has been resumed" |
| 1759 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1760 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1761 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1762 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1763 | "$P_SRV debug_level=3 tickets=0" \ |
| 1764 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1765 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1766 | -c "client hello, adding session ticket extension" \ |
| 1767 | -s "found session ticket extension" \ |
| 1768 | -S "server hello, adding session ticket extension" \ |
| 1769 | -C "found session_ticket extension" \ |
| 1770 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1771 | -s "session successfully restored from cache" \ |
| 1772 | -S "session successfully restored from ticket" \ |
| 1773 | -s "a session has been resumed" \ |
| 1774 | -c "a session has been resumed" |
| 1775 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1776 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1777 | "$P_SRV debug_level=3 tickets=1" \ |
| 1778 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1779 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1780 | -C "client hello, adding session ticket extension" \ |
| 1781 | -S "found session ticket extension" \ |
| 1782 | -S "server hello, adding session ticket extension" \ |
| 1783 | -C "found session_ticket extension" \ |
| 1784 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1785 | -s "session successfully restored from cache" \ |
| 1786 | -S "session successfully restored from ticket" \ |
| 1787 | -s "a session has been resumed" \ |
| 1788 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1790 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1791 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1792 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1793 | 0 \ |
| 1794 | -S "session successfully restored from cache" \ |
| 1795 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1796 | -S "a session has been resumed" \ |
| 1797 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1798 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1799 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1800 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1801 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1802 | 0 \ |
| 1803 | -s "session successfully restored from cache" \ |
| 1804 | -S "session successfully restored from ticket" \ |
| 1805 | -s "a session has been resumed" \ |
| 1806 | -c "a session has been resumed" |
| 1807 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1808 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1809 | "$P_SRV debug_level=3 tickets=0" \ |
| 1810 | "$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] | 1811 | 0 \ |
| 1812 | -s "session successfully restored from cache" \ |
| 1813 | -S "session successfully restored from ticket" \ |
| 1814 | -s "a session has been resumed" \ |
| 1815 | -c "a session has been resumed" |
| 1816 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1817 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1818 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1819 | "$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] | 1820 | 0 \ |
| 1821 | -S "session successfully restored from cache" \ |
| 1822 | -S "session successfully restored from ticket" \ |
| 1823 | -S "a session has been resumed" \ |
| 1824 | -C "a session has been resumed" |
| 1825 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1826 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1827 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1828 | "$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] | 1829 | 0 \ |
| 1830 | -s "session successfully restored from cache" \ |
| 1831 | -S "session successfully restored from ticket" \ |
| 1832 | -s "a session has been resumed" \ |
| 1833 | -c "a session has been resumed" |
| 1834 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1835 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1836 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1837 | "( $O_CLI -sess_out $SESSION; \ |
| 1838 | $O_CLI -sess_in $SESSION; \ |
| 1839 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1840 | 0 \ |
| 1841 | -s "found session ticket extension" \ |
| 1842 | -S "server hello, adding session ticket extension" \ |
| 1843 | -s "session successfully restored from cache" \ |
| 1844 | -S "session successfully restored from ticket" \ |
| 1845 | -s "a session has been resumed" |
| 1846 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1847 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1848 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1849 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1850 | 0 \ |
| 1851 | -C "found session_ticket extension" \ |
| 1852 | -C "parse new session ticket" \ |
| 1853 | -c "a session has been resumed" |
| 1854 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1855 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 1856 | |
| 1857 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 1858 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1859 | "$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] | 1860 | 0 \ |
| 1861 | -c "client hello, adding session ticket extension" \ |
| 1862 | -s "found session ticket extension" \ |
| 1863 | -S "server hello, adding session ticket extension" \ |
| 1864 | -C "found session_ticket extension" \ |
| 1865 | -C "parse new session ticket" \ |
| 1866 | -s "session successfully restored from cache" \ |
| 1867 | -S "session successfully restored from ticket" \ |
| 1868 | -s "a session has been resumed" \ |
| 1869 | -c "a session has been resumed" |
| 1870 | |
| 1871 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 1872 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1873 | "$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] | 1874 | 0 \ |
| 1875 | -C "client hello, adding session ticket extension" \ |
| 1876 | -S "found session ticket extension" \ |
| 1877 | -S "server hello, adding session ticket extension" \ |
| 1878 | -C "found session_ticket extension" \ |
| 1879 | -C "parse new session ticket" \ |
| 1880 | -s "session successfully restored from cache" \ |
| 1881 | -S "session successfully restored from ticket" \ |
| 1882 | -s "a session has been resumed" \ |
| 1883 | -c "a session has been resumed" |
| 1884 | |
| 1885 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 1886 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1887 | "$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] | 1888 | 0 \ |
| 1889 | -S "session successfully restored from cache" \ |
| 1890 | -S "session successfully restored from ticket" \ |
| 1891 | -S "a session has been resumed" \ |
| 1892 | -C "a session has been resumed" |
| 1893 | |
| 1894 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 1895 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1896 | "$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] | 1897 | 0 \ |
| 1898 | -s "session successfully restored from cache" \ |
| 1899 | -S "session successfully restored from ticket" \ |
| 1900 | -s "a session has been resumed" \ |
| 1901 | -c "a session has been resumed" |
| 1902 | |
| 1903 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 1904 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1905 | "$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] | 1906 | 0 \ |
| 1907 | -s "session successfully restored from cache" \ |
| 1908 | -S "session successfully restored from ticket" \ |
| 1909 | -s "a session has been resumed" \ |
| 1910 | -c "a session has been resumed" |
| 1911 | |
| 1912 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 1913 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1914 | "$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] | 1915 | 0 \ |
| 1916 | -S "session successfully restored from cache" \ |
| 1917 | -S "session successfully restored from ticket" \ |
| 1918 | -S "a session has been resumed" \ |
| 1919 | -C "a session has been resumed" |
| 1920 | |
| 1921 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 1922 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1923 | "$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] | 1924 | 0 \ |
| 1925 | -s "session successfully restored from cache" \ |
| 1926 | -S "session successfully restored from ticket" \ |
| 1927 | -s "a session has been resumed" \ |
| 1928 | -c "a session has been resumed" |
| 1929 | |
| 1930 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 1931 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1932 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1933 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1934 | rm -f $SESSION )" \ |
| 1935 | 0 \ |
| 1936 | -s "found session ticket extension" \ |
| 1937 | -S "server hello, adding session ticket extension" \ |
| 1938 | -s "session successfully restored from cache" \ |
| 1939 | -S "session successfully restored from ticket" \ |
| 1940 | -s "a session has been resumed" |
| 1941 | |
| 1942 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 1943 | "$O_SRV -dtls1" \ |
| 1944 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1945 | 0 \ |
| 1946 | -C "found session_ticket extension" \ |
| 1947 | -C "parse new session ticket" \ |
| 1948 | -c "a session has been resumed" |
| 1949 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1950 | # Tests for Max Fragment Length extension |
| 1951 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1952 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1953 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1954 | "$P_SRV debug_level=3" \ |
| 1955 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1956 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1957 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1958 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1959 | -C "client hello, adding max_fragment_length extension" \ |
| 1960 | -S "found max fragment length extension" \ |
| 1961 | -S "server hello, max_fragment_length extension" \ |
| 1962 | -C "found max_fragment_length extension" |
| 1963 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1964 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1965 | run_test "Max fragment length: enabled, default, larger message" \ |
| 1966 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1967 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1968 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1969 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1970 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1971 | -C "client hello, adding max_fragment_length extension" \ |
| 1972 | -S "found max fragment length extension" \ |
| 1973 | -S "server hello, max_fragment_length extension" \ |
| 1974 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1975 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1976 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1977 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1978 | |
| 1979 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1980 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 1981 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1982 | "$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] | 1983 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1984 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1985 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1986 | -C "client hello, adding max_fragment_length extension" \ |
| 1987 | -S "found max fragment length extension" \ |
| 1988 | -S "server hello, max_fragment_length extension" \ |
| 1989 | -C "found max_fragment_length extension" \ |
| 1990 | -c "fragment larger than.*maximum " |
| 1991 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1992 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 1993 | # (session fragment length will be 16384 regardless of mbedtls |
| 1994 | # content length configuration.) |
| 1995 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1996 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1997 | run_test "Max fragment length: disabled, larger message" \ |
| 1998 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1999 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2000 | 0 \ |
| 2001 | -C "Maximum fragment length is 16384" \ |
| 2002 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2003 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2004 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2005 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2006 | |
| 2007 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 2e580ce | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2008 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2009 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2010 | "$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] | 2011 | 1 \ |
| 2012 | -C "Maximum fragment length is 16384" \ |
| 2013 | -S "Maximum fragment length is 16384" \ |
| 2014 | -c "fragment larger than.*maximum " |
| 2015 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2016 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2017 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2018 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2019 | "$P_SRV debug_level=3" \ |
| 2020 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2021 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2022 | -c "Maximum fragment length is 4096" \ |
| 2023 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2024 | -c "client hello, adding max_fragment_length extension" \ |
| 2025 | -s "found max fragment length extension" \ |
| 2026 | -s "server hello, max_fragment_length extension" \ |
| 2027 | -c "found max_fragment_length extension" |
| 2028 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2029 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2030 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2031 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2032 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2033 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2034 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2035 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2036 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2037 | -C "client hello, adding max_fragment_length extension" \ |
| 2038 | -S "found max fragment length extension" \ |
| 2039 | -S "server hello, max_fragment_length extension" \ |
| 2040 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2041 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2042 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2043 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2044 | requires_gnutls |
| 2045 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2046 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2047 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2048 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2049 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2050 | -c "client hello, adding max_fragment_length extension" \ |
| 2051 | -c "found max_fragment_length extension" |
| 2052 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2053 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2054 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2055 | run_test "Max fragment length: client, message just fits" \ |
| 2056 | "$P_SRV debug_level=3" \ |
| 2057 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 2058 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2059 | -c "Maximum fragment length is 2048" \ |
| 2060 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2061 | -c "client hello, adding max_fragment_length extension" \ |
| 2062 | -s "found max fragment length extension" \ |
| 2063 | -s "server hello, max_fragment_length extension" \ |
| 2064 | -c "found max_fragment_length extension" \ |
| 2065 | -c "2048 bytes written in 1 fragments" \ |
| 2066 | -s "2048 bytes read" |
| 2067 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2068 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2069 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2070 | run_test "Max fragment length: client, larger message" \ |
| 2071 | "$P_SRV debug_level=3" \ |
| 2072 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 2073 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2074 | -c "Maximum fragment length is 2048" \ |
| 2075 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2076 | -c "client hello, adding max_fragment_length extension" \ |
| 2077 | -s "found max fragment length extension" \ |
| 2078 | -s "server hello, max_fragment_length extension" \ |
| 2079 | -c "found max_fragment_length extension" \ |
| 2080 | -c "2345 bytes written in 2 fragments" \ |
| 2081 | -s "2048 bytes read" \ |
| 2082 | -s "297 bytes read" |
| 2083 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2084 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2085 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 2086 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2087 | "$P_SRV debug_level=3 dtls=1" \ |
| 2088 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 2089 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2090 | -c "Maximum fragment length is 2048" \ |
| 2091 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2092 | -c "client hello, adding max_fragment_length extension" \ |
| 2093 | -s "found max fragment length extension" \ |
| 2094 | -s "server hello, max_fragment_length extension" \ |
| 2095 | -c "found max_fragment_length extension" \ |
| 2096 | -c "fragment larger than.*maximum" |
| 2097 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2098 | # Tests for renegotiation |
| 2099 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2100 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2101 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2102 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2103 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2104 | 0 \ |
| 2105 | -C "client hello, adding renegotiation extension" \ |
| 2106 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2107 | -S "found renegotiation extension" \ |
| 2108 | -s "server hello, secure renegotiation extension" \ |
| 2109 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2110 | -C "=> renegotiate" \ |
| 2111 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2112 | -S "write hello request" |
| 2113 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2114 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2115 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2116 | "$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] | 2117 | "$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] | 2118 | 0 \ |
| 2119 | -c "client hello, adding renegotiation extension" \ |
| 2120 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2121 | -s "found renegotiation extension" \ |
| 2122 | -s "server hello, secure renegotiation extension" \ |
| 2123 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2124 | -c "=> renegotiate" \ |
| 2125 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2126 | -S "write hello request" |
| 2127 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2128 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2129 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2130 | "$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] | 2131 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2132 | 0 \ |
| 2133 | -c "client hello, adding renegotiation extension" \ |
| 2134 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2135 | -s "found renegotiation extension" \ |
| 2136 | -s "server hello, secure renegotiation extension" \ |
| 2137 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2138 | -c "=> renegotiate" \ |
| 2139 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2140 | -s "write hello request" |
| 2141 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2142 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2143 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2144 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2145 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2146 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 2147 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 2148 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2149 | 0 \ |
| 2150 | -c "client hello, adding renegotiation extension" \ |
| 2151 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2152 | -s "found renegotiation extension" \ |
| 2153 | -s "server hello, secure renegotiation extension" \ |
| 2154 | -c "found renegotiation extension" \ |
| 2155 | -c "=> renegotiate" \ |
| 2156 | -s "=> renegotiate" \ |
| 2157 | -S "write hello request" \ |
| 2158 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2159 | |
| 2160 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2161 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2162 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2163 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2164 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 2165 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 2166 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2167 | 0 \ |
| 2168 | -c "client hello, adding renegotiation extension" \ |
| 2169 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2170 | -s "found renegotiation extension" \ |
| 2171 | -s "server hello, secure renegotiation extension" \ |
| 2172 | -c "found renegotiation extension" \ |
| 2173 | -c "=> renegotiate" \ |
| 2174 | -s "=> renegotiate" \ |
| 2175 | -s "write hello request" \ |
| 2176 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2177 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2178 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2179 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2180 | "$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] | 2181 | "$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] | 2182 | 0 \ |
| 2183 | -c "client hello, adding renegotiation extension" \ |
| 2184 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2185 | -s "found renegotiation extension" \ |
| 2186 | -s "server hello, secure renegotiation extension" \ |
| 2187 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2188 | -c "=> renegotiate" \ |
| 2189 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2190 | -s "write hello request" |
| 2191 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2192 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2193 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2194 | "$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] | 2195 | "$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] | 2196 | 1 \ |
| 2197 | -c "client hello, adding renegotiation extension" \ |
| 2198 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2199 | -S "found renegotiation extension" \ |
| 2200 | -s "server hello, secure renegotiation extension" \ |
| 2201 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2202 | -c "=> renegotiate" \ |
| 2203 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2204 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 2205 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2206 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2207 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2208 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2209 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2210 | "$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] | 2211 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2212 | 0 \ |
| 2213 | -C "client hello, adding renegotiation extension" \ |
| 2214 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2215 | -S "found renegotiation extension" \ |
| 2216 | -s "server hello, secure renegotiation extension" \ |
| 2217 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2218 | -C "=> renegotiate" \ |
| 2219 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2220 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 2221 | -S "SSL - An unexpected message was received from our peer" \ |
| 2222 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2223 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2224 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2225 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2226 | "$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] | 2227 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2228 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2229 | 0 \ |
| 2230 | -C "client hello, adding renegotiation extension" \ |
| 2231 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2232 | -S "found renegotiation extension" \ |
| 2233 | -s "server hello, secure renegotiation extension" \ |
| 2234 | -c "found renegotiation extension" \ |
| 2235 | -C "=> renegotiate" \ |
| 2236 | -S "=> renegotiate" \ |
| 2237 | -s "write hello request" \ |
| 2238 | -S "SSL - An unexpected message was received from our peer" \ |
| 2239 | -S "failed" |
| 2240 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2241 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2242 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2243 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2244 | "$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] | 2245 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2246 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2247 | 0 \ |
| 2248 | -C "client hello, adding renegotiation extension" \ |
| 2249 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2250 | -S "found renegotiation extension" \ |
| 2251 | -s "server hello, secure renegotiation extension" \ |
| 2252 | -c "found renegotiation extension" \ |
| 2253 | -C "=> renegotiate" \ |
| 2254 | -S "=> renegotiate" \ |
| 2255 | -s "write hello request" \ |
| 2256 | -S "SSL - An unexpected message was received from our peer" \ |
| 2257 | -S "failed" |
| 2258 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2259 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2260 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2261 | "$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] | 2262 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2263 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2264 | 0 \ |
| 2265 | -C "client hello, adding renegotiation extension" \ |
| 2266 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2267 | -S "found renegotiation extension" \ |
| 2268 | -s "server hello, secure renegotiation extension" \ |
| 2269 | -c "found renegotiation extension" \ |
| 2270 | -C "=> renegotiate" \ |
| 2271 | -S "=> renegotiate" \ |
| 2272 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2273 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2274 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2275 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2276 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2277 | "$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] | 2278 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2279 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2280 | 0 \ |
| 2281 | -c "client hello, adding renegotiation extension" \ |
| 2282 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2283 | -s "found renegotiation extension" \ |
| 2284 | -s "server hello, secure renegotiation extension" \ |
| 2285 | -c "found renegotiation extension" \ |
| 2286 | -c "=> renegotiate" \ |
| 2287 | -s "=> renegotiate" \ |
| 2288 | -s "write hello request" \ |
| 2289 | -S "SSL - An unexpected message was received from our peer" \ |
| 2290 | -S "failed" |
| 2291 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2292 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2293 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2294 | "$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] | 2295 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2296 | 0 \ |
| 2297 | -C "client hello, adding renegotiation extension" \ |
| 2298 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2299 | -S "found renegotiation extension" \ |
| 2300 | -s "server hello, secure renegotiation extension" \ |
| 2301 | -c "found renegotiation extension" \ |
| 2302 | -S "record counter limit reached: renegotiate" \ |
| 2303 | -C "=> renegotiate" \ |
| 2304 | -S "=> renegotiate" \ |
| 2305 | -S "write hello request" \ |
| 2306 | -S "SSL - An unexpected message was received from our peer" \ |
| 2307 | -S "failed" |
| 2308 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 2309 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2310 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2311 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2312 | "$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] | 2313 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2314 | 0 \ |
| 2315 | -c "client hello, adding renegotiation extension" \ |
| 2316 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2317 | -s "found renegotiation extension" \ |
| 2318 | -s "server hello, secure renegotiation extension" \ |
| 2319 | -c "found renegotiation extension" \ |
| 2320 | -s "record counter limit reached: renegotiate" \ |
| 2321 | -c "=> renegotiate" \ |
| 2322 | -s "=> renegotiate" \ |
| 2323 | -s "write hello request" \ |
| 2324 | -S "SSL - An unexpected message was received from our peer" \ |
| 2325 | -S "failed" |
| 2326 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2327 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2328 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2329 | "$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] | 2330 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2331 | 0 \ |
| 2332 | -c "client hello, adding renegotiation extension" \ |
| 2333 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2334 | -s "found renegotiation extension" \ |
| 2335 | -s "server hello, secure renegotiation extension" \ |
| 2336 | -c "found renegotiation extension" \ |
| 2337 | -s "record counter limit reached: renegotiate" \ |
| 2338 | -c "=> renegotiate" \ |
| 2339 | -s "=> renegotiate" \ |
| 2340 | -s "write hello request" \ |
| 2341 | -S "SSL - An unexpected message was received from our peer" \ |
| 2342 | -S "failed" |
| 2343 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2344 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2345 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2346 | "$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] | 2347 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 2348 | 0 \ |
| 2349 | -C "client hello, adding renegotiation extension" \ |
| 2350 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2351 | -S "found renegotiation extension" \ |
| 2352 | -s "server hello, secure renegotiation extension" \ |
| 2353 | -c "found renegotiation extension" \ |
| 2354 | -S "record counter limit reached: renegotiate" \ |
| 2355 | -C "=> renegotiate" \ |
| 2356 | -S "=> renegotiate" \ |
| 2357 | -S "write hello request" \ |
| 2358 | -S "SSL - An unexpected message was received from our peer" \ |
| 2359 | -S "failed" |
| 2360 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2361 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2362 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2363 | "$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] | 2364 | "$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] | 2365 | 0 \ |
| 2366 | -c "client hello, adding renegotiation extension" \ |
| 2367 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2368 | -s "found renegotiation extension" \ |
| 2369 | -s "server hello, secure renegotiation extension" \ |
| 2370 | -c "found renegotiation extension" \ |
| 2371 | -c "=> renegotiate" \ |
| 2372 | -s "=> renegotiate" \ |
| 2373 | -S "write hello request" |
| 2374 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2375 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2376 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2377 | "$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] | 2378 | "$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] | 2379 | 0 \ |
| 2380 | -c "client hello, adding renegotiation extension" \ |
| 2381 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2382 | -s "found renegotiation extension" \ |
| 2383 | -s "server hello, secure renegotiation extension" \ |
| 2384 | -c "found renegotiation extension" \ |
| 2385 | -c "=> renegotiate" \ |
| 2386 | -s "=> renegotiate" \ |
| 2387 | -s "write hello request" |
| 2388 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2390 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2391 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2392 | "$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] | 2393 | 0 \ |
| 2394 | -c "client hello, adding renegotiation extension" \ |
| 2395 | -c "found renegotiation extension" \ |
| 2396 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2397 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2398 | -C "error" \ |
| 2399 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2400 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2401 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2402 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2403 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 2404 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2405 | "$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] | 2406 | 0 \ |
| 2407 | -c "client hello, adding renegotiation extension" \ |
| 2408 | -c "found renegotiation extension" \ |
| 2409 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2410 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2411 | -C "error" \ |
| 2412 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2413 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2414 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2415 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2416 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 2417 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2418 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2419 | 1 \ |
| 2420 | -c "client hello, adding renegotiation extension" \ |
| 2421 | -C "found renegotiation extension" \ |
| 2422 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2423 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2424 | -c "error" \ |
| 2425 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2426 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2427 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2428 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2429 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 2430 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2431 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2432 | allow_legacy=0" \ |
| 2433 | 1 \ |
| 2434 | -c "client hello, adding renegotiation extension" \ |
| 2435 | -C "found renegotiation extension" \ |
| 2436 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2437 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2438 | -c "error" \ |
| 2439 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2440 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2441 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2442 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2443 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 2444 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2445 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2446 | allow_legacy=1" \ |
| 2447 | 0 \ |
| 2448 | -c "client hello, adding renegotiation extension" \ |
| 2449 | -C "found renegotiation extension" \ |
| 2450 | -c "=> renegotiate" \ |
| 2451 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2452 | -C "error" \ |
| 2453 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2454 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2455 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2456 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 2457 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 2458 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2459 | 0 \ |
| 2460 | -c "client hello, adding renegotiation extension" \ |
| 2461 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2462 | -s "found renegotiation extension" \ |
| 2463 | -s "server hello, secure renegotiation extension" \ |
| 2464 | -c "found renegotiation extension" \ |
| 2465 | -c "=> renegotiate" \ |
| 2466 | -s "=> renegotiate" \ |
| 2467 | -S "write hello request" |
| 2468 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2469 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2470 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 2471 | "$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] | 2472 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 2473 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2474 | 0 \ |
| 2475 | -c "client hello, adding renegotiation extension" \ |
| 2476 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2477 | -s "found renegotiation extension" \ |
| 2478 | -s "server hello, secure renegotiation extension" \ |
| 2479 | -c "found renegotiation extension" \ |
| 2480 | -c "=> renegotiate" \ |
| 2481 | -s "=> renegotiate" \ |
| 2482 | -s "write hello request" |
| 2483 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2484 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2485 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2486 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2487 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2488 | 0 \ |
| 2489 | -c "client hello, adding renegotiation extension" \ |
| 2490 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2491 | -s "found renegotiation extension" \ |
| 2492 | -s "server hello, secure renegotiation extension" \ |
| 2493 | -s "record counter limit reached: renegotiate" \ |
| 2494 | -c "=> renegotiate" \ |
| 2495 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2496 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2497 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2498 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2499 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2500 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2501 | "$G_SRV -u --mtu 4096" \ |
| 2502 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2503 | 0 \ |
| 2504 | -c "client hello, adding renegotiation extension" \ |
| 2505 | -c "found renegotiation extension" \ |
| 2506 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2507 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2508 | -C "error" \ |
| 2509 | -s "Extra-header:" |
| 2510 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2511 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2512 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2513 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2514 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2515 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2516 | "$P_CLI debug_level=3" \ |
| 2517 | 0 \ |
| 2518 | -c "found renegotiation extension" \ |
| 2519 | -C "error" \ |
| 2520 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2521 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2522 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2523 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2524 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2525 | "$P_CLI debug_level=3" \ |
| 2526 | 0 \ |
| 2527 | -C "found renegotiation extension" \ |
| 2528 | -C "error" \ |
| 2529 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2530 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2531 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2532 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2533 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2534 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2535 | 1 \ |
| 2536 | -C "found renegotiation extension" \ |
| 2537 | -c "error" \ |
| 2538 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2539 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2540 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2541 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2542 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2543 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2544 | 0 \ |
| 2545 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2546 | -s "server hello, secure renegotiation extension" |
| 2547 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2548 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2549 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2550 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2551 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2552 | 0 \ |
| 2553 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2554 | -S "server hello, secure renegotiation extension" |
| 2555 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2556 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2557 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2558 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2559 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2560 | 1 \ |
| 2561 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2562 | -S "server hello, secure renegotiation extension" |
| 2563 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2564 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2565 | |
| 2566 | requires_gnutls |
| 2567 | run_test "DER format: no trailing bytes" \ |
| 2568 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2569 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2570 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2571 | 0 \ |
| 2572 | -c "Handshake was completed" \ |
| 2573 | |
| 2574 | requires_gnutls |
| 2575 | run_test "DER format: with a trailing zero byte" \ |
| 2576 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2577 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2578 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2579 | 0 \ |
| 2580 | -c "Handshake was completed" \ |
| 2581 | |
| 2582 | requires_gnutls |
| 2583 | run_test "DER format: with a trailing random byte" \ |
| 2584 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2585 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2586 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2587 | 0 \ |
| 2588 | -c "Handshake was completed" \ |
| 2589 | |
| 2590 | requires_gnutls |
| 2591 | run_test "DER format: with 2 trailing random bytes" \ |
| 2592 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2593 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2594 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2595 | 0 \ |
| 2596 | -c "Handshake was completed" \ |
| 2597 | |
| 2598 | requires_gnutls |
| 2599 | run_test "DER format: with 4 trailing random bytes" \ |
| 2600 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2601 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2602 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2603 | 0 \ |
| 2604 | -c "Handshake was completed" \ |
| 2605 | |
| 2606 | requires_gnutls |
| 2607 | run_test "DER format: with 8 trailing random bytes" \ |
| 2608 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2609 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2610 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2611 | 0 \ |
| 2612 | -c "Handshake was completed" \ |
| 2613 | |
| 2614 | requires_gnutls |
| 2615 | run_test "DER format: with 9 trailing random bytes" \ |
| 2616 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2617 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2618 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2619 | 0 \ |
| 2620 | -c "Handshake was completed" \ |
| 2621 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2622 | # Tests for auth_mode |
| 2623 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2624 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2625 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2626 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2627 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2628 | 1 \ |
| 2629 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2630 | -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] | 2631 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2632 | -c "X509 - Certificate verification failed" |
| 2633 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2634 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2635 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2636 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2637 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2638 | 0 \ |
| 2639 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2640 | -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] | 2641 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2642 | -C "X509 - Certificate verification failed" |
| 2643 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2644 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2645 | "$P_SRV" \ |
| 2646 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2647 | 0 \ |
| 2648 | -c "x509_verify_cert() returned" \ |
| 2649 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2650 | -c "! Certificate verification flags"\ |
| 2651 | -C "! mbedtls_ssl_handshake returned" \ |
| 2652 | -C "X509 - Certificate verification failed" \ |
| 2653 | -C "SSL - No CA Chain is set, but required to operate" |
| 2654 | |
| 2655 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2656 | "$P_SRV" \ |
| 2657 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2658 | 1 \ |
| 2659 | -c "x509_verify_cert() returned" \ |
| 2660 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2661 | -c "! Certificate verification flags"\ |
| 2662 | -c "! mbedtls_ssl_handshake returned" \ |
| 2663 | -c "SSL - No CA Chain is set, but required to operate" |
| 2664 | |
| 2665 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2666 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2667 | # the client informs the server about the supported curves - it does, though, in the |
| 2668 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2669 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2670 | # different means to have the server ignoring the client's supported curve list. |
| 2671 | |
| 2672 | requires_config_enabled MBEDTLS_ECP_C |
| 2673 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2674 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2675 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2676 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2677 | 1 \ |
| 2678 | -c "bad certificate (EC key curve)"\ |
| 2679 | -c "! Certificate verification flags"\ |
| 2680 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2681 | |
| 2682 | requires_config_enabled MBEDTLS_ECP_C |
| 2683 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2684 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2685 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2686 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2687 | 1 \ |
| 2688 | -c "bad certificate (EC key curve)"\ |
| 2689 | -c "! Certificate verification flags"\ |
| 2690 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2691 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2692 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2693 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2694 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2695 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2696 | 0 \ |
| 2697 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2698 | -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] | 2699 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2700 | -C "X509 - Certificate verification failed" |
| 2701 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2702 | run_test "Authentication: client SHA256, server required" \ |
| 2703 | "$P_SRV auth_mode=required" \ |
| 2704 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2705 | key_file=data_files/server6.key \ |
| 2706 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2707 | 0 \ |
| 2708 | -c "Supported Signature Algorithm found: 4," \ |
| 2709 | -c "Supported Signature Algorithm found: 5," |
| 2710 | |
| 2711 | run_test "Authentication: client SHA384, server required" \ |
| 2712 | "$P_SRV auth_mode=required" \ |
| 2713 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2714 | key_file=data_files/server6.key \ |
| 2715 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2716 | 0 \ |
| 2717 | -c "Supported Signature Algorithm found: 4," \ |
| 2718 | -c "Supported Signature Algorithm found: 5," |
| 2719 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2720 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2721 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2722 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2723 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2724 | key_file=data_files/server5.key" \ |
| 2725 | 1 \ |
| 2726 | -S "skip write certificate request" \ |
| 2727 | -C "skip parse certificate request" \ |
| 2728 | -c "got a certificate request" \ |
| 2729 | -c "got no certificate to send" \ |
| 2730 | -S "x509_verify_cert() returned" \ |
| 2731 | -s "client has no certificate" \ |
| 2732 | -s "! mbedtls_ssl_handshake returned" \ |
| 2733 | -c "! mbedtls_ssl_handshake returned" \ |
| 2734 | -s "No client certification received from the client, but required by the authentication mode" |
| 2735 | |
| 2736 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2737 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2738 | "$P_CLI debug_level=3 crt_file=none \ |
| 2739 | key_file=data_files/server5.key" \ |
| 2740 | 1 \ |
| 2741 | -S "skip write certificate request" \ |
| 2742 | -C "skip parse certificate request" \ |
| 2743 | -c "got a certificate request" \ |
| 2744 | -c "= write certificate$" \ |
| 2745 | -C "skip write certificate$" \ |
| 2746 | -S "x509_verify_cert() returned" \ |
| 2747 | -s "client has no certificate" \ |
| 2748 | -s "! mbedtls_ssl_handshake returned" \ |
| 2749 | -c "! mbedtls_ssl_handshake returned" \ |
| 2750 | -s "No client certification received from the client, but required by the authentication mode" |
| 2751 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2752 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2753 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2754 | "$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] | 2755 | key_file=data_files/server5.key" \ |
| 2756 | 1 \ |
| 2757 | -S "skip write certificate request" \ |
| 2758 | -C "skip parse certificate request" \ |
| 2759 | -c "got a certificate request" \ |
| 2760 | -C "skip write certificate" \ |
| 2761 | -C "skip write certificate verify" \ |
| 2762 | -S "skip parse certificate verify" \ |
| 2763 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2764 | -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] | 2765 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2766 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2767 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2768 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2769 | # We don't check that the client receives the alert because it might |
| 2770 | # detect that its write end of the connection is closed and abort |
| 2771 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2772 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2773 | run_test "Authentication: client cert not trusted, server required" \ |
| 2774 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2775 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2776 | key_file=data_files/server5.key" \ |
| 2777 | 1 \ |
| 2778 | -S "skip write certificate request" \ |
| 2779 | -C "skip parse certificate request" \ |
| 2780 | -c "got a certificate request" \ |
| 2781 | -C "skip write certificate" \ |
| 2782 | -C "skip write certificate verify" \ |
| 2783 | -S "skip parse certificate verify" \ |
| 2784 | -s "x509_verify_cert() returned" \ |
| 2785 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2786 | -s "! mbedtls_ssl_handshake returned" \ |
| 2787 | -c "! mbedtls_ssl_handshake returned" \ |
| 2788 | -s "X509 - Certificate verification failed" |
| 2789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2790 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2791 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2792 | "$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] | 2793 | key_file=data_files/server5.key" \ |
| 2794 | 0 \ |
| 2795 | -S "skip write certificate request" \ |
| 2796 | -C "skip parse certificate request" \ |
| 2797 | -c "got a certificate request" \ |
| 2798 | -C "skip write certificate" \ |
| 2799 | -C "skip write certificate verify" \ |
| 2800 | -S "skip parse certificate verify" \ |
| 2801 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2802 | -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] | 2803 | -S "! mbedtls_ssl_handshake returned" \ |
| 2804 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2805 | -S "X509 - Certificate verification failed" |
| 2806 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2807 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2808 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2809 | "$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] | 2810 | key_file=data_files/server5.key" \ |
| 2811 | 0 \ |
| 2812 | -s "skip write certificate request" \ |
| 2813 | -C "skip parse certificate request" \ |
| 2814 | -c "got no certificate request" \ |
| 2815 | -c "skip write certificate" \ |
| 2816 | -c "skip write certificate verify" \ |
| 2817 | -s "skip parse certificate verify" \ |
| 2818 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2819 | -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] | 2820 | -S "! mbedtls_ssl_handshake returned" \ |
| 2821 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2822 | -S "X509 - Certificate verification failed" |
| 2823 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2824 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2825 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2826 | "$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] | 2827 | 0 \ |
| 2828 | -S "skip write certificate request" \ |
| 2829 | -C "skip parse certificate request" \ |
| 2830 | -c "got a certificate request" \ |
| 2831 | -C "skip write certificate$" \ |
| 2832 | -C "got no certificate to send" \ |
| 2833 | -S "SSLv3 client has no certificate" \ |
| 2834 | -c "skip write certificate verify" \ |
| 2835 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2836 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2837 | -S "! mbedtls_ssl_handshake returned" \ |
| 2838 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2839 | -S "X509 - Certificate verification failed" |
| 2840 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2841 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2842 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2843 | "$O_CLI" \ |
| 2844 | 0 \ |
| 2845 | -S "skip write certificate request" \ |
| 2846 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2847 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2848 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2849 | -S "X509 - Certificate verification failed" |
| 2850 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2851 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2852 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2853 | "$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] | 2854 | 0 \ |
| 2855 | -C "skip parse certificate request" \ |
| 2856 | -c "got a certificate request" \ |
| 2857 | -C "skip write certificate$" \ |
| 2858 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2859 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2860 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2861 | run_test "Authentication: client no cert, openssl server required" \ |
| 2862 | "$O_SRV -Verify 10" \ |
| 2863 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 2864 | 1 \ |
| 2865 | -C "skip parse certificate request" \ |
| 2866 | -c "got a certificate request" \ |
| 2867 | -C "skip write certificate$" \ |
| 2868 | -c "skip write certificate verify" \ |
| 2869 | -c "! mbedtls_ssl_handshake returned" |
| 2870 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2871 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2872 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2873 | "$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] | 2874 | "$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] | 2875 | 0 \ |
| 2876 | -S "skip write certificate request" \ |
| 2877 | -C "skip parse certificate request" \ |
| 2878 | -c "got a certificate request" \ |
| 2879 | -C "skip write certificate$" \ |
| 2880 | -c "skip write certificate verify" \ |
| 2881 | -c "got no certificate to send" \ |
| 2882 | -s "SSLv3 client has no certificate" \ |
| 2883 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2884 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2885 | -S "! mbedtls_ssl_handshake returned" \ |
| 2886 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2887 | -S "X509 - Certificate verification failed" |
| 2888 | |
Yuto Takano | 8df2d25 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 2889 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 2890 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 2891 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2892 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2893 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2894 | |
Yuto Takano | 8df2d25 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 2895 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 2896 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 2897 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 2898 | # are in place so that the semantics are consistent with the test description. |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame^] | 2899 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2900 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2901 | run_test "Authentication: server max_int chain, client default" \ |
| 2902 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2903 | key_file=data_files/dir-maxpath/09.key" \ |
| 2904 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2905 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2906 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2907 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame^] | 2908 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2909 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2910 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2911 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2912 | key_file=data_files/dir-maxpath/10.key" \ |
| 2913 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2914 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2915 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2916 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame^] | 2917 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2918 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2919 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 2920 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2921 | key_file=data_files/dir-maxpath/10.key" \ |
| 2922 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2923 | auth_mode=optional" \ |
| 2924 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2925 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2926 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame^] | 2927 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2928 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2929 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 2930 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2931 | key_file=data_files/dir-maxpath/10.key" \ |
| 2932 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2933 | auth_mode=none" \ |
| 2934 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2935 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2936 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame^] | 2937 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2938 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2939 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2940 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2941 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2942 | key_file=data_files/dir-maxpath/10.key" \ |
| 2943 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2944 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2945 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame^] | 2946 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2947 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2948 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2949 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2950 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2951 | key_file=data_files/dir-maxpath/10.key" \ |
| 2952 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2953 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2954 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame^] | 2955 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2956 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2957 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 2958 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2959 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2960 | key_file=data_files/dir-maxpath/10.key" \ |
| 2961 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2962 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2963 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame^] | 2964 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2965 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2966 | run_test "Authentication: client max_int chain, server required" \ |
| 2967 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2968 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 2969 | key_file=data_files/dir-maxpath/09.key" \ |
| 2970 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2971 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2972 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2973 | # Tests for CA list in CertificateRequest messages |
| 2974 | |
| 2975 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 2976 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2977 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2978 | key_file=data_files/server6.key" \ |
| 2979 | 0 \ |
| 2980 | -s "requested DN" |
| 2981 | |
| 2982 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 2983 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2984 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2985 | key_file=data_files/server6.key" \ |
| 2986 | 0 \ |
| 2987 | -S "requested DN" |
| 2988 | |
| 2989 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 2990 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2991 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2992 | key_file=data_files/server5.key" \ |
| 2993 | 1 \ |
| 2994 | -S "requested DN" \ |
| 2995 | -s "x509_verify_cert() returned" \ |
| 2996 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2997 | -s "! mbedtls_ssl_handshake returned" \ |
| 2998 | -c "! mbedtls_ssl_handshake returned" \ |
| 2999 | -s "X509 - Certificate verification failed" |
| 3000 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3001 | # Tests for certificate selection based on SHA verson |
| 3002 | |
| 3003 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 3004 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3005 | key_file=data_files/server5.key \ |
| 3006 | crt_file2=data_files/server5-sha1.crt \ |
| 3007 | key_file2=data_files/server5.key" \ |
| 3008 | "$P_CLI force_version=tls1_2" \ |
| 3009 | 0 \ |
| 3010 | -c "signed using.*ECDSA with SHA256" \ |
| 3011 | -C "signed using.*ECDSA with SHA1" |
| 3012 | |
| 3013 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 3014 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3015 | key_file=data_files/server5.key \ |
| 3016 | crt_file2=data_files/server5-sha1.crt \ |
| 3017 | key_file2=data_files/server5.key" \ |
| 3018 | "$P_CLI force_version=tls1_1" \ |
| 3019 | 0 \ |
| 3020 | -C "signed using.*ECDSA with SHA256" \ |
| 3021 | -c "signed using.*ECDSA with SHA1" |
| 3022 | |
| 3023 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 3024 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3025 | key_file=data_files/server5.key \ |
| 3026 | crt_file2=data_files/server5-sha1.crt \ |
| 3027 | key_file2=data_files/server5.key" \ |
| 3028 | "$P_CLI force_version=tls1" \ |
| 3029 | 0 \ |
| 3030 | -C "signed using.*ECDSA with SHA256" \ |
| 3031 | -c "signed using.*ECDSA with SHA1" |
| 3032 | |
| 3033 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 3034 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3035 | key_file=data_files/server5.key \ |
| 3036 | crt_file2=data_files/server6.crt \ |
| 3037 | key_file2=data_files/server6.key" \ |
| 3038 | "$P_CLI force_version=tls1_1" \ |
| 3039 | 0 \ |
| 3040 | -c "serial number.*09" \ |
| 3041 | -c "signed using.*ECDSA with SHA256" \ |
| 3042 | -C "signed using.*ECDSA with SHA1" |
| 3043 | |
| 3044 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 3045 | "$P_SRV crt_file=data_files/server6.crt \ |
| 3046 | key_file=data_files/server6.key \ |
| 3047 | crt_file2=data_files/server5.crt \ |
| 3048 | key_file2=data_files/server5.key" \ |
| 3049 | "$P_CLI force_version=tls1_1" \ |
| 3050 | 0 \ |
| 3051 | -c "serial number.*0A" \ |
| 3052 | -c "signed using.*ECDSA with SHA256" \ |
| 3053 | -C "signed using.*ECDSA with SHA1" |
| 3054 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3055 | # tests for SNI |
| 3056 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3057 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3058 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3059 | 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] | 3060 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3061 | 0 \ |
| 3062 | -S "parse ServerName extension" \ |
| 3063 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3064 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3065 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3066 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3067 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3068 | 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] | 3069 | 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] | 3070 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3071 | 0 \ |
| 3072 | -s "parse ServerName extension" \ |
| 3073 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3074 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3075 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3076 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3077 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3078 | 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] | 3079 | 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] | 3080 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3081 | 0 \ |
| 3082 | -s "parse ServerName extension" \ |
| 3083 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3084 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3085 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3086 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3087 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3088 | 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] | 3089 | 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] | 3090 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3091 | 1 \ |
| 3092 | -s "parse ServerName extension" \ |
| 3093 | -s "ssl_sni_wrapper() returned" \ |
| 3094 | -s "mbedtls_ssl_handshake returned" \ |
| 3095 | -c "mbedtls_ssl_handshake returned" \ |
| 3096 | -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] | 3097 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3098 | run_test "SNI: client auth no override: optional" \ |
| 3099 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3100 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3101 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3102 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3103 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3104 | -S "skip write certificate request" \ |
| 3105 | -C "skip parse certificate request" \ |
| 3106 | -c "got a certificate request" \ |
| 3107 | -C "skip write certificate" \ |
| 3108 | -C "skip write certificate verify" \ |
| 3109 | -S "skip parse certificate verify" |
| 3110 | |
| 3111 | run_test "SNI: client auth override: none -> optional" \ |
| 3112 | "$P_SRV debug_level=3 auth_mode=none \ |
| 3113 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3114 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3115 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3116 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3117 | -S "skip write certificate request" \ |
| 3118 | -C "skip parse certificate request" \ |
| 3119 | -c "got a certificate request" \ |
| 3120 | -C "skip write certificate" \ |
| 3121 | -C "skip write certificate verify" \ |
| 3122 | -S "skip parse certificate verify" |
| 3123 | |
| 3124 | run_test "SNI: client auth override: optional -> none" \ |
| 3125 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3126 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3127 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3128 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3129 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3130 | -s "skip write certificate request" \ |
| 3131 | -C "skip parse certificate request" \ |
| 3132 | -c "got no certificate request" \ |
| 3133 | -c "skip write certificate" \ |
| 3134 | -c "skip write certificate verify" \ |
| 3135 | -s "skip parse certificate verify" |
| 3136 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3137 | run_test "SNI: CA no override" \ |
| 3138 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3139 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3140 | ca_file=data_files/test-ca.crt \ |
| 3141 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3142 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3143 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3144 | 1 \ |
| 3145 | -S "skip write certificate request" \ |
| 3146 | -C "skip parse certificate request" \ |
| 3147 | -c "got a certificate request" \ |
| 3148 | -C "skip write certificate" \ |
| 3149 | -C "skip write certificate verify" \ |
| 3150 | -S "skip parse certificate verify" \ |
| 3151 | -s "x509_verify_cert() returned" \ |
| 3152 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3153 | -S "The certificate has been revoked (is on a CRL)" |
| 3154 | |
| 3155 | run_test "SNI: CA override" \ |
| 3156 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3157 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3158 | ca_file=data_files/test-ca.crt \ |
| 3159 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3160 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3161 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3162 | 0 \ |
| 3163 | -S "skip write certificate request" \ |
| 3164 | -C "skip parse certificate request" \ |
| 3165 | -c "got a certificate request" \ |
| 3166 | -C "skip write certificate" \ |
| 3167 | -C "skip write certificate verify" \ |
| 3168 | -S "skip parse certificate verify" \ |
| 3169 | -S "x509_verify_cert() returned" \ |
| 3170 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3171 | -S "The certificate has been revoked (is on a CRL)" |
| 3172 | |
| 3173 | run_test "SNI: CA override with CRL" \ |
| 3174 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3175 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3176 | ca_file=data_files/test-ca.crt \ |
| 3177 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3178 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3179 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3180 | 1 \ |
| 3181 | -S "skip write certificate request" \ |
| 3182 | -C "skip parse certificate request" \ |
| 3183 | -c "got a certificate request" \ |
| 3184 | -C "skip write certificate" \ |
| 3185 | -C "skip write certificate verify" \ |
| 3186 | -S "skip parse certificate verify" \ |
| 3187 | -s "x509_verify_cert() returned" \ |
| 3188 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3189 | -s "The certificate has been revoked (is on a CRL)" |
| 3190 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3191 | # Tests for SNI and DTLS |
| 3192 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3193 | run_test "SNI: DTLS, no SNI callback" \ |
| 3194 | "$P_SRV debug_level=3 dtls=1 \ |
| 3195 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 3196 | "$P_CLI server_name=localhost dtls=1" \ |
| 3197 | 0 \ |
| 3198 | -S "parse ServerName extension" \ |
| 3199 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3200 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3201 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3202 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3203 | "$P_SRV debug_level=3 dtls=1 \ |
| 3204 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3205 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3206 | "$P_CLI server_name=localhost dtls=1" \ |
| 3207 | 0 \ |
| 3208 | -s "parse ServerName extension" \ |
| 3209 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3210 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3211 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3212 | run_test "SNI: DTLS, matching cert 2" \ |
| 3213 | "$P_SRV debug_level=3 dtls=1 \ |
| 3214 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3215 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3216 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 3217 | 0 \ |
| 3218 | -s "parse ServerName extension" \ |
| 3219 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3220 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 3221 | |
| 3222 | run_test "SNI: DTLS, no matching cert" \ |
| 3223 | "$P_SRV debug_level=3 dtls=1 \ |
| 3224 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3225 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3226 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 3227 | 1 \ |
| 3228 | -s "parse ServerName extension" \ |
| 3229 | -s "ssl_sni_wrapper() returned" \ |
| 3230 | -s "mbedtls_ssl_handshake returned" \ |
| 3231 | -c "mbedtls_ssl_handshake returned" \ |
| 3232 | -c "SSL - A fatal alert message was received from our peer" |
| 3233 | |
| 3234 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 3235 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3236 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3237 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3238 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3239 | 0 \ |
| 3240 | -S "skip write certificate request" \ |
| 3241 | -C "skip parse certificate request" \ |
| 3242 | -c "got a certificate request" \ |
| 3243 | -C "skip write certificate" \ |
| 3244 | -C "skip write certificate verify" \ |
| 3245 | -S "skip parse certificate verify" |
| 3246 | |
| 3247 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 3248 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 3249 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3250 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3251 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3252 | 0 \ |
| 3253 | -S "skip write certificate request" \ |
| 3254 | -C "skip parse certificate request" \ |
| 3255 | -c "got a certificate request" \ |
| 3256 | -C "skip write certificate" \ |
| 3257 | -C "skip write certificate verify" \ |
| 3258 | -S "skip parse certificate verify" |
| 3259 | |
| 3260 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 3261 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3262 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3263 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3264 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3265 | 0 \ |
| 3266 | -s "skip write certificate request" \ |
| 3267 | -C "skip parse certificate request" \ |
| 3268 | -c "got no certificate request" \ |
| 3269 | -c "skip write certificate" \ |
| 3270 | -c "skip write certificate verify" \ |
| 3271 | -s "skip parse certificate verify" |
| 3272 | |
| 3273 | run_test "SNI: DTLS, CA no override" \ |
| 3274 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3275 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3276 | ca_file=data_files/test-ca.crt \ |
| 3277 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3278 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3279 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3280 | 1 \ |
| 3281 | -S "skip write certificate request" \ |
| 3282 | -C "skip parse certificate request" \ |
| 3283 | -c "got a certificate request" \ |
| 3284 | -C "skip write certificate" \ |
| 3285 | -C "skip write certificate verify" \ |
| 3286 | -S "skip parse certificate verify" \ |
| 3287 | -s "x509_verify_cert() returned" \ |
| 3288 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3289 | -S "The certificate has been revoked (is on a CRL)" |
| 3290 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3291 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3292 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3293 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3294 | ca_file=data_files/test-ca.crt \ |
| 3295 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3296 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3297 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3298 | 0 \ |
| 3299 | -S "skip write certificate request" \ |
| 3300 | -C "skip parse certificate request" \ |
| 3301 | -c "got a certificate request" \ |
| 3302 | -C "skip write certificate" \ |
| 3303 | -C "skip write certificate verify" \ |
| 3304 | -S "skip parse certificate verify" \ |
| 3305 | -S "x509_verify_cert() returned" \ |
| 3306 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3307 | -S "The certificate has been revoked (is on a CRL)" |
| 3308 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3309 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3310 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3311 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 3312 | ca_file=data_files/test-ca.crt \ |
| 3313 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3314 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3315 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3316 | 1 \ |
| 3317 | -S "skip write certificate request" \ |
| 3318 | -C "skip parse certificate request" \ |
| 3319 | -c "got a certificate request" \ |
| 3320 | -C "skip write certificate" \ |
| 3321 | -C "skip write certificate verify" \ |
| 3322 | -S "skip parse certificate verify" \ |
| 3323 | -s "x509_verify_cert() returned" \ |
| 3324 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3325 | -s "The certificate has been revoked (is on a CRL)" |
| 3326 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3327 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 3328 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3329 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3330 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3331 | "$P_CLI nbio=2 tickets=0" \ |
| 3332 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3333 | -S "mbedtls_ssl_handshake returned" \ |
| 3334 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3335 | -c "Read from server: .* bytes read" |
| 3336 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3337 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3338 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 3339 | "$P_CLI nbio=2 tickets=0" \ |
| 3340 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3341 | -S "mbedtls_ssl_handshake returned" \ |
| 3342 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3343 | -c "Read from server: .* bytes read" |
| 3344 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3345 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3346 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3347 | "$P_CLI nbio=2 tickets=1" \ |
| 3348 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3349 | -S "mbedtls_ssl_handshake returned" \ |
| 3350 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3351 | -c "Read from server: .* bytes read" |
| 3352 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3353 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3354 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3355 | "$P_CLI nbio=2 tickets=1" \ |
| 3356 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3357 | -S "mbedtls_ssl_handshake returned" \ |
| 3358 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3359 | -c "Read from server: .* bytes read" |
| 3360 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3361 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3362 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3363 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3364 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3365 | -S "mbedtls_ssl_handshake returned" \ |
| 3366 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3367 | -c "Read from server: .* bytes read" |
| 3368 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3369 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3370 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3371 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3372 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3373 | -S "mbedtls_ssl_handshake returned" \ |
| 3374 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3375 | -c "Read from server: .* bytes read" |
| 3376 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3377 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3378 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3379 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 3380 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3381 | -S "mbedtls_ssl_handshake returned" \ |
| 3382 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3383 | -c "Read from server: .* bytes read" |
| 3384 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 3385 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 3386 | |
| 3387 | run_test "Event-driven I/O: basic handshake" \ |
| 3388 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3389 | "$P_CLI event=1 tickets=0" \ |
| 3390 | 0 \ |
| 3391 | -S "mbedtls_ssl_handshake returned" \ |
| 3392 | -C "mbedtls_ssl_handshake returned" \ |
| 3393 | -c "Read from server: .* bytes read" |
| 3394 | |
| 3395 | run_test "Event-driven I/O: client auth" \ |
| 3396 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 3397 | "$P_CLI event=1 tickets=0" \ |
| 3398 | 0 \ |
| 3399 | -S "mbedtls_ssl_handshake returned" \ |
| 3400 | -C "mbedtls_ssl_handshake returned" \ |
| 3401 | -c "Read from server: .* bytes read" |
| 3402 | |
| 3403 | run_test "Event-driven I/O: ticket" \ |
| 3404 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3405 | "$P_CLI event=1 tickets=1" \ |
| 3406 | 0 \ |
| 3407 | -S "mbedtls_ssl_handshake returned" \ |
| 3408 | -C "mbedtls_ssl_handshake returned" \ |
| 3409 | -c "Read from server: .* bytes read" |
| 3410 | |
| 3411 | run_test "Event-driven I/O: ticket + client auth" \ |
| 3412 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3413 | "$P_CLI event=1 tickets=1" \ |
| 3414 | 0 \ |
| 3415 | -S "mbedtls_ssl_handshake returned" \ |
| 3416 | -C "mbedtls_ssl_handshake returned" \ |
| 3417 | -c "Read from server: .* bytes read" |
| 3418 | |
| 3419 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 3420 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3421 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3422 | 0 \ |
| 3423 | -S "mbedtls_ssl_handshake returned" \ |
| 3424 | -C "mbedtls_ssl_handshake returned" \ |
| 3425 | -c "Read from server: .* bytes read" |
| 3426 | |
| 3427 | run_test "Event-driven I/O: ticket + resume" \ |
| 3428 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3429 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3430 | 0 \ |
| 3431 | -S "mbedtls_ssl_handshake returned" \ |
| 3432 | -C "mbedtls_ssl_handshake returned" \ |
| 3433 | -c "Read from server: .* bytes read" |
| 3434 | |
| 3435 | run_test "Event-driven I/O: session-id resume" \ |
| 3436 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3437 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 3438 | 0 \ |
| 3439 | -S "mbedtls_ssl_handshake returned" \ |
| 3440 | -C "mbedtls_ssl_handshake returned" \ |
| 3441 | -c "Read from server: .* bytes read" |
| 3442 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 3443 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 3444 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3445 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3446 | 0 \ |
| 3447 | -c "Read from server: .* bytes read" |
| 3448 | |
| 3449 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 3450 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3451 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3452 | 0 \ |
| 3453 | -c "Read from server: .* bytes read" |
| 3454 | |
| 3455 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 3456 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3457 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3458 | 0 \ |
| 3459 | -c "Read from server: .* bytes read" |
| 3460 | |
| 3461 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 3462 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3463 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3464 | 0 \ |
| 3465 | -c "Read from server: .* bytes read" |
| 3466 | |
| 3467 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 3468 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3469 | "$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] | 3470 | 0 \ |
| 3471 | -c "Read from server: .* bytes read" |
| 3472 | |
| 3473 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 3474 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3475 | "$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] | 3476 | 0 \ |
| 3477 | -c "Read from server: .* bytes read" |
| 3478 | |
| 3479 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 3480 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3481 | "$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] | 3482 | 0 \ |
| 3483 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3484 | |
| 3485 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3486 | # During session resumption, the client will send its ApplicationData record |
| 3487 | # within the same datagram as the Finished messages. In this situation, the |
| 3488 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3489 | # because the ApplicationData request has already been queued internally. |
| 3490 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3491 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3492 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3493 | "$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] | 3494 | 0 \ |
| 3495 | -c "Read from server: .* bytes read" |
| 3496 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3497 | # Tests for version negotiation |
| 3498 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3499 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3500 | "$P_SRV" \ |
| 3501 | "$P_CLI" \ |
| 3502 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3503 | -S "mbedtls_ssl_handshake returned" \ |
| 3504 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3505 | -s "Protocol is TLSv1.2" \ |
| 3506 | -c "Protocol is TLSv1.2" |
| 3507 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3508 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3509 | "$P_SRV" \ |
| 3510 | "$P_CLI max_version=tls1_1" \ |
| 3511 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3512 | -S "mbedtls_ssl_handshake returned" \ |
| 3513 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3514 | -s "Protocol is TLSv1.1" \ |
| 3515 | -c "Protocol is TLSv1.1" |
| 3516 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3517 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3518 | "$P_SRV max_version=tls1_1" \ |
| 3519 | "$P_CLI" \ |
| 3520 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3521 | -S "mbedtls_ssl_handshake returned" \ |
| 3522 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3523 | -s "Protocol is TLSv1.1" \ |
| 3524 | -c "Protocol is TLSv1.1" |
| 3525 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3526 | 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] | 3527 | "$P_SRV max_version=tls1_1" \ |
| 3528 | "$P_CLI max_version=tls1_1" \ |
| 3529 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3530 | -S "mbedtls_ssl_handshake returned" \ |
| 3531 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3532 | -s "Protocol is TLSv1.1" \ |
| 3533 | -c "Protocol is TLSv1.1" |
| 3534 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3535 | 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] | 3536 | "$P_SRV min_version=tls1_1" \ |
| 3537 | "$P_CLI max_version=tls1_1" \ |
| 3538 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3539 | -S "mbedtls_ssl_handshake returned" \ |
| 3540 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3541 | -s "Protocol is TLSv1.1" \ |
| 3542 | -c "Protocol is TLSv1.1" |
| 3543 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3544 | 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] | 3545 | "$P_SRV max_version=tls1_1" \ |
| 3546 | "$P_CLI min_version=tls1_1" \ |
| 3547 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3548 | -S "mbedtls_ssl_handshake returned" \ |
| 3549 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3550 | -s "Protocol is TLSv1.1" \ |
| 3551 | -c "Protocol is TLSv1.1" |
| 3552 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3553 | 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] | 3554 | "$P_SRV max_version=tls1_1" \ |
| 3555 | "$P_CLI min_version=tls1_2" \ |
| 3556 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3557 | -s "mbedtls_ssl_handshake returned" \ |
| 3558 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3559 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3560 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3561 | run_test "Version check: srv min 1.2, cli max 1.1 -> fail" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3562 | "$P_SRV min_version=tls1_2" \ |
| 3563 | "$P_CLI max_version=tls1_1" \ |
| 3564 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3565 | -s "mbedtls_ssl_handshake returned" \ |
| 3566 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3567 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3568 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3569 | # Tests for ALPN extension |
| 3570 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3571 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3572 | "$P_SRV debug_level=3" \ |
| 3573 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3574 | 0 \ |
| 3575 | -C "client hello, adding alpn extension" \ |
| 3576 | -S "found alpn extension" \ |
| 3577 | -C "got an alert message, type: \\[2:120]" \ |
| 3578 | -S "server hello, adding alpn extension" \ |
| 3579 | -C "found alpn extension " \ |
| 3580 | -C "Application Layer Protocol is" \ |
| 3581 | -S "Application Layer Protocol is" |
| 3582 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3583 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3584 | "$P_SRV debug_level=3" \ |
| 3585 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3586 | 0 \ |
| 3587 | -c "client hello, adding alpn extension" \ |
| 3588 | -s "found alpn extension" \ |
| 3589 | -C "got an alert message, type: \\[2:120]" \ |
| 3590 | -S "server hello, adding alpn extension" \ |
| 3591 | -C "found alpn extension " \ |
| 3592 | -c "Application Layer Protocol is (none)" \ |
| 3593 | -S "Application Layer Protocol is" |
| 3594 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3595 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3596 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3597 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3598 | 0 \ |
| 3599 | -C "client hello, adding alpn extension" \ |
| 3600 | -S "found alpn extension" \ |
| 3601 | -C "got an alert message, type: \\[2:120]" \ |
| 3602 | -S "server hello, adding alpn extension" \ |
| 3603 | -C "found alpn extension " \ |
| 3604 | -C "Application Layer Protocol is" \ |
| 3605 | -s "Application Layer Protocol is (none)" |
| 3606 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3607 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3608 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3609 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3610 | 0 \ |
| 3611 | -c "client hello, adding alpn extension" \ |
| 3612 | -s "found alpn extension" \ |
| 3613 | -C "got an alert message, type: \\[2:120]" \ |
| 3614 | -s "server hello, adding alpn extension" \ |
| 3615 | -c "found alpn extension" \ |
| 3616 | -c "Application Layer Protocol is abc" \ |
| 3617 | -s "Application Layer Protocol is abc" |
| 3618 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3619 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3620 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3621 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3622 | 0 \ |
| 3623 | -c "client hello, adding alpn extension" \ |
| 3624 | -s "found alpn extension" \ |
| 3625 | -C "got an alert message, type: \\[2:120]" \ |
| 3626 | -s "server hello, adding alpn extension" \ |
| 3627 | -c "found alpn extension" \ |
| 3628 | -c "Application Layer Protocol is abc" \ |
| 3629 | -s "Application Layer Protocol is abc" |
| 3630 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3631 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3632 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3633 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3634 | 0 \ |
| 3635 | -c "client hello, adding alpn extension" \ |
| 3636 | -s "found alpn extension" \ |
| 3637 | -C "got an alert message, type: \\[2:120]" \ |
| 3638 | -s "server hello, adding alpn extension" \ |
| 3639 | -c "found alpn extension" \ |
| 3640 | -c "Application Layer Protocol is 1234" \ |
| 3641 | -s "Application Layer Protocol is 1234" |
| 3642 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3643 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3644 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 3645 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3646 | 1 \ |
| 3647 | -c "client hello, adding alpn extension" \ |
| 3648 | -s "found alpn extension" \ |
| 3649 | -c "got an alert message, type: \\[2:120]" \ |
| 3650 | -S "server hello, adding alpn extension" \ |
| 3651 | -C "found alpn extension" \ |
| 3652 | -C "Application Layer Protocol is 1234" \ |
| 3653 | -S "Application Layer Protocol is 1234" |
| 3654 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3655 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3656 | # Tests for keyUsage in leaf certificates, part 1: |
| 3657 | # server-side certificate/suite selection |
| 3658 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3659 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3660 | "$P_SRV key_file=data_files/server2.key \ |
| 3661 | crt_file=data_files/server2.ku-ds.crt" \ |
| 3662 | "$P_CLI" \ |
| 3663 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3664 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3665 | |
| 3666 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3667 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3668 | "$P_SRV key_file=data_files/server2.key \ |
| 3669 | crt_file=data_files/server2.ku-ke.crt" \ |
| 3670 | "$P_CLI" \ |
| 3671 | 0 \ |
| 3672 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 3673 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3674 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3675 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3676 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3677 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3678 | 1 \ |
| 3679 | -C "Ciphersuite is " |
| 3680 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3681 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3682 | "$P_SRV key_file=data_files/server5.key \ |
| 3683 | crt_file=data_files/server5.ku-ds.crt" \ |
| 3684 | "$P_CLI" \ |
| 3685 | 0 \ |
| 3686 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 3687 | |
| 3688 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3689 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3690 | "$P_SRV key_file=data_files/server5.key \ |
| 3691 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3692 | "$P_CLI" \ |
| 3693 | 0 \ |
| 3694 | -c "Ciphersuite is TLS-ECDH-" |
| 3695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3696 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3697 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3698 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3699 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3700 | 1 \ |
| 3701 | -C "Ciphersuite is " |
| 3702 | |
| 3703 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3704 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3705 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3706 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3707 | "$O_SRV -key data_files/server2.key \ |
| 3708 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3709 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3710 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3711 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3712 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3713 | -C "Processing of the Certificate handshake message failed" \ |
| 3714 | -c "Ciphersuite is TLS-" |
| 3715 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3716 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3717 | "$O_SRV -key data_files/server2.key \ |
| 3718 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3719 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3720 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3721 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3722 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3723 | -C "Processing of the Certificate handshake message failed" \ |
| 3724 | -c "Ciphersuite is TLS-" |
| 3725 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3726 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3727 | "$O_SRV -key data_files/server2.key \ |
| 3728 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3729 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3730 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3731 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3732 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3733 | -C "Processing of the Certificate handshake message failed" \ |
| 3734 | -c "Ciphersuite is TLS-" |
| 3735 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3736 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3737 | "$O_SRV -key data_files/server2.key \ |
| 3738 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3739 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3740 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3741 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3742 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3743 | -c "Processing of the Certificate handshake message failed" \ |
| 3744 | -C "Ciphersuite is TLS-" |
| 3745 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3746 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3747 | "$O_SRV -key data_files/server2.key \ |
| 3748 | -cert data_files/server2.ku-ke.crt" \ |
| 3749 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3750 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3751 | 0 \ |
| 3752 | -c "bad certificate (usage extensions)" \ |
| 3753 | -C "Processing of the Certificate handshake message failed" \ |
| 3754 | -c "Ciphersuite is TLS-" \ |
| 3755 | -c "! Usage does not match the keyUsage extension" |
| 3756 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3757 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3758 | "$O_SRV -key data_files/server2.key \ |
| 3759 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3760 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3761 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3762 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3763 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3764 | -C "Processing of the Certificate handshake message failed" \ |
| 3765 | -c "Ciphersuite is TLS-" |
| 3766 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3767 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3768 | "$O_SRV -key data_files/server2.key \ |
| 3769 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3770 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3771 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3772 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3773 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3774 | -c "Processing of the Certificate handshake message failed" \ |
| 3775 | -C "Ciphersuite is TLS-" |
| 3776 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3777 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3778 | "$O_SRV -key data_files/server2.key \ |
| 3779 | -cert data_files/server2.ku-ds.crt" \ |
| 3780 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3781 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3782 | 0 \ |
| 3783 | -c "bad certificate (usage extensions)" \ |
| 3784 | -C "Processing of the Certificate handshake message failed" \ |
| 3785 | -c "Ciphersuite is TLS-" \ |
| 3786 | -c "! Usage does not match the keyUsage extension" |
| 3787 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3788 | # Tests for keyUsage in leaf certificates, part 3: |
| 3789 | # server-side checking of client cert |
| 3790 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3791 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3792 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3793 | "$O_CLI -key data_files/server2.key \ |
| 3794 | -cert data_files/server2.ku-ds.crt" \ |
| 3795 | 0 \ |
| 3796 | -S "bad certificate (usage extensions)" \ |
| 3797 | -S "Processing of the Certificate handshake message failed" |
| 3798 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3799 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3800 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3801 | "$O_CLI -key data_files/server2.key \ |
| 3802 | -cert data_files/server2.ku-ke.crt" \ |
| 3803 | 0 \ |
| 3804 | -s "bad certificate (usage extensions)" \ |
| 3805 | -S "Processing of the Certificate handshake message failed" |
| 3806 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3807 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3808 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3809 | "$O_CLI -key data_files/server2.key \ |
| 3810 | -cert data_files/server2.ku-ke.crt" \ |
| 3811 | 1 \ |
| 3812 | -s "bad certificate (usage extensions)" \ |
| 3813 | -s "Processing of the Certificate handshake message failed" |
| 3814 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3815 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3816 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3817 | "$O_CLI -key data_files/server5.key \ |
| 3818 | -cert data_files/server5.ku-ds.crt" \ |
| 3819 | 0 \ |
| 3820 | -S "bad certificate (usage extensions)" \ |
| 3821 | -S "Processing of the Certificate handshake message failed" |
| 3822 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3823 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3824 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3825 | "$O_CLI -key data_files/server5.key \ |
| 3826 | -cert data_files/server5.ku-ka.crt" \ |
| 3827 | 0 \ |
| 3828 | -s "bad certificate (usage extensions)" \ |
| 3829 | -S "Processing of the Certificate handshake message failed" |
| 3830 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3831 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3832 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3833 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3834 | "$P_SRV key_file=data_files/server5.key \ |
| 3835 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3836 | "$P_CLI" \ |
| 3837 | 0 |
| 3838 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3839 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3840 | "$P_SRV key_file=data_files/server5.key \ |
| 3841 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3842 | "$P_CLI" \ |
| 3843 | 0 |
| 3844 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3845 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3846 | "$P_SRV key_file=data_files/server5.key \ |
| 3847 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3848 | "$P_CLI" \ |
| 3849 | 0 |
| 3850 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3851 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3852 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3853 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3854 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3855 | 1 |
| 3856 | |
| 3857 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3858 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3859 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3860 | "$O_SRV -key data_files/server5.key \ |
| 3861 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3862 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3863 | 0 \ |
| 3864 | -C "bad certificate (usage extensions)" \ |
| 3865 | -C "Processing of the Certificate handshake message failed" \ |
| 3866 | -c "Ciphersuite is TLS-" |
| 3867 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3868 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3869 | "$O_SRV -key data_files/server5.key \ |
| 3870 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3871 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3872 | 0 \ |
| 3873 | -C "bad certificate (usage extensions)" \ |
| 3874 | -C "Processing of the Certificate handshake message failed" \ |
| 3875 | -c "Ciphersuite is TLS-" |
| 3876 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3877 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3878 | "$O_SRV -key data_files/server5.key \ |
| 3879 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3880 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3881 | 0 \ |
| 3882 | -C "bad certificate (usage extensions)" \ |
| 3883 | -C "Processing of the Certificate handshake message failed" \ |
| 3884 | -c "Ciphersuite is TLS-" |
| 3885 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3886 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3887 | "$O_SRV -key data_files/server5.key \ |
| 3888 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3889 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3890 | 1 \ |
| 3891 | -c "bad certificate (usage extensions)" \ |
| 3892 | -c "Processing of the Certificate handshake message failed" \ |
| 3893 | -C "Ciphersuite is TLS-" |
| 3894 | |
| 3895 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3896 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3897 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3898 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3899 | "$O_CLI -key data_files/server5.key \ |
| 3900 | -cert data_files/server5.eku-cli.crt" \ |
| 3901 | 0 \ |
| 3902 | -S "bad certificate (usage extensions)" \ |
| 3903 | -S "Processing of the Certificate handshake message failed" |
| 3904 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3905 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3906 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3907 | "$O_CLI -key data_files/server5.key \ |
| 3908 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3909 | 0 \ |
| 3910 | -S "bad certificate (usage extensions)" \ |
| 3911 | -S "Processing of the Certificate handshake message failed" |
| 3912 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3913 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3914 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3915 | "$O_CLI -key data_files/server5.key \ |
| 3916 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3917 | 0 \ |
| 3918 | -S "bad certificate (usage extensions)" \ |
| 3919 | -S "Processing of the Certificate handshake message failed" |
| 3920 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3921 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3922 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3923 | "$O_CLI -key data_files/server5.key \ |
| 3924 | -cert data_files/server5.eku-cs.crt" \ |
| 3925 | 0 \ |
| 3926 | -s "bad certificate (usage extensions)" \ |
| 3927 | -S "Processing of the Certificate handshake message failed" |
| 3928 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3929 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3930 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3931 | "$O_CLI -key data_files/server5.key \ |
| 3932 | -cert data_files/server5.eku-cs.crt" \ |
| 3933 | 1 \ |
| 3934 | -s "bad certificate (usage extensions)" \ |
| 3935 | -s "Processing of the Certificate handshake message failed" |
| 3936 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3937 | # Tests for DHM parameters loading |
| 3938 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3939 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3940 | "$P_SRV" \ |
| 3941 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3942 | debug_level=3" \ |
| 3943 | 0 \ |
| 3944 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3945 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3946 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3947 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3948 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3949 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3950 | debug_level=3" \ |
| 3951 | 0 \ |
| 3952 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 3953 | -c "value of 'DHM: G ' (2 bits)" |
| 3954 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3955 | # Tests for DHM client-side size checking |
| 3956 | |
| 3957 | run_test "DHM size: server default, client default, OK" \ |
| 3958 | "$P_SRV" \ |
| 3959 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3960 | debug_level=1" \ |
| 3961 | 0 \ |
| 3962 | -C "DHM prime too short:" |
| 3963 | |
| 3964 | run_test "DHM size: server default, client 2048, OK" \ |
| 3965 | "$P_SRV" \ |
| 3966 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3967 | debug_level=1 dhmlen=2048" \ |
| 3968 | 0 \ |
| 3969 | -C "DHM prime too short:" |
| 3970 | |
| 3971 | run_test "DHM size: server 1024, client default, OK" \ |
| 3972 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3973 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3974 | debug_level=1" \ |
| 3975 | 0 \ |
| 3976 | -C "DHM prime too short:" |
| 3977 | |
Gilles Peskine | 3e7b61c | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 3978 | run_test "DHM size: server 999, client 999, OK" \ |
| 3979 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 3980 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3981 | debug_level=1 dhmlen=999" \ |
| 3982 | 0 \ |
| 3983 | -C "DHM prime too short:" |
| 3984 | |
| 3985 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 3986 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 3987 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3988 | debug_level=1 dhmlen=1000" \ |
| 3989 | 0 \ |
| 3990 | -C "DHM prime too short:" |
| 3991 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3992 | run_test "DHM size: server 1000, client default, rejected" \ |
| 3993 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 3994 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3995 | debug_level=1" \ |
| 3996 | 1 \ |
| 3997 | -c "DHM prime too short:" |
| 3998 | |
Gilles Peskine | 3e7b61c | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 3999 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 4000 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 4001 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4002 | debug_level=1 dhmlen=1001" \ |
| 4003 | 1 \ |
| 4004 | -c "DHM prime too short:" |
| 4005 | |
| 4006 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 4007 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 4008 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4009 | debug_level=1 dhmlen=1000" \ |
| 4010 | 1 \ |
| 4011 | -c "DHM prime too short:" |
| 4012 | |
| 4013 | run_test "DHM size: server 998, client 999, rejected" \ |
| 4014 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 4015 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4016 | debug_level=1 dhmlen=999" \ |
| 4017 | 1 \ |
| 4018 | -c "DHM prime too short:" |
| 4019 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 4020 | run_test "DHM size: server default, client 2049, rejected" \ |
| 4021 | "$P_SRV" \ |
| 4022 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4023 | debug_level=1 dhmlen=2049" \ |
| 4024 | 1 \ |
| 4025 | -c "DHM prime too short:" |
| 4026 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4027 | # Tests for PSK callback |
| 4028 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4029 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4030 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 4031 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4032 | psk_identity=foo psk=abc123" \ |
| 4033 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4034 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4035 | -S "SSL - Unknown identity received" \ |
| 4036 | -S "SSL - Verification of the message MAC failed" |
| 4037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4038 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4039 | "$P_SRV" \ |
| 4040 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4041 | psk_identity=foo psk=abc123" \ |
| 4042 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4043 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4044 | -S "SSL - Unknown identity received" \ |
| 4045 | -S "SSL - Verification of the message MAC failed" |
| 4046 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4047 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4048 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 4049 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4050 | psk_identity=foo psk=abc123" \ |
| 4051 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4052 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4053 | -s "SSL - Unknown identity received" \ |
| 4054 | -S "SSL - Verification of the message MAC failed" |
| 4055 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4056 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4057 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4058 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4059 | psk_identity=abc psk=dead" \ |
| 4060 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4061 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4062 | -S "SSL - Unknown identity received" \ |
| 4063 | -S "SSL - Verification of the message MAC failed" |
| 4064 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4065 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4066 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4067 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4068 | psk_identity=def psk=beef" \ |
| 4069 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4070 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4071 | -S "SSL - Unknown identity received" \ |
| 4072 | -S "SSL - Verification of the message MAC failed" |
| 4073 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4074 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4075 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4076 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4077 | psk_identity=ghi psk=beef" \ |
| 4078 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4079 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4080 | -s "SSL - Unknown identity received" \ |
| 4081 | -S "SSL - Verification of the message MAC failed" |
| 4082 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4083 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4084 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4085 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4086 | psk_identity=abc psk=beef" \ |
| 4087 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4088 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4089 | -S "SSL - Unknown identity received" \ |
| 4090 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4091 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4092 | # Tests for EC J-PAKE |
| 4093 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4094 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4095 | run_test "ECJPAKE: client not configured" \ |
| 4096 | "$P_SRV debug_level=3" \ |
| 4097 | "$P_CLI debug_level=3" \ |
| 4098 | 0 \ |
| 4099 | -C "add ciphersuite: c0ff" \ |
| 4100 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4101 | -S "found ecjpake kkpp extension" \ |
| 4102 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4103 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4104 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4105 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4106 | -S "None of the common ciphersuites is usable" |
| 4107 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4108 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4109 | run_test "ECJPAKE: server not configured" \ |
| 4110 | "$P_SRV debug_level=3" \ |
| 4111 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4112 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4113 | 1 \ |
| 4114 | -c "add ciphersuite: c0ff" \ |
| 4115 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4116 | -s "found ecjpake kkpp extension" \ |
| 4117 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4118 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4119 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4120 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4121 | -s "None of the common ciphersuites is usable" |
| 4122 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4123 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4124 | run_test "ECJPAKE: working, TLS" \ |
| 4125 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4126 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4127 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 4128 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4129 | -c "add ciphersuite: c0ff" \ |
| 4130 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4131 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4132 | -s "found ecjpake kkpp extension" \ |
| 4133 | -S "skip ecjpake kkpp extension" \ |
| 4134 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4135 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4136 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4137 | -S "None of the common ciphersuites is usable" \ |
| 4138 | -S "SSL - Verification of the message MAC failed" |
| 4139 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4140 | server_needs_more_time 1 |
Dave Rodgman | cee9e92 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 4141 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4142 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 4143 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4144 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 4145 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4146 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4147 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4148 | -s "SSL - Verification of the message MAC failed" |
| 4149 | |
Dave Rodgman | cee9e92 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 4150 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4151 | run_test "ECJPAKE: working, DTLS" \ |
| 4152 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4153 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4154 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4155 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4156 | -c "re-using cached ecjpake parameters" \ |
| 4157 | -S "SSL - Verification of the message MAC failed" |
| 4158 | |
Dave Rodgman | cee9e92 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 4159 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4160 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 4161 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 4162 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4163 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4164 | 0 \ |
| 4165 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4166 | -S "SSL - Verification of the message MAC failed" |
| 4167 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4168 | server_needs_more_time 1 |
Dave Rodgman | cee9e92 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 4169 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4170 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 4171 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4172 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 4173 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4174 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4175 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4176 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4177 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4178 | # for tests with configs/config-thread.h |
Dave Rodgman | cee9e92 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 4179 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4180 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 4181 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 4182 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 4183 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4184 | 0 |
| 4185 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4186 | # Tests for ciphersuites per version |
| 4187 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4188 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4189 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4190 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4191 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4192 | "$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] | 4193 | "$P_CLI force_version=ssl3" \ |
| 4194 | 0 \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4195 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4196 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4197 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 4198 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4199 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4200 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4201 | "$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] | 4202 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4203 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4204 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4205 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4206 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4207 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4208 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4209 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4210 | "$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] | 4211 | "$P_CLI force_version=tls1_1" \ |
| 4212 | 0 \ |
| 4213 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 4214 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4215 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4216 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4217 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4218 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4219 | "$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] | 4220 | "$P_CLI force_version=tls1_2" \ |
| 4221 | 0 \ |
| 4222 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 4223 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4224 | # Test for ClientHello without extensions |
| 4225 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 4226 | requires_gnutls |
Manuel Pégourié-Gonnard | d20ae89 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 4227 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 7c9add2 | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 4228 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4229 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4230 | 0 \ |
| 4231 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4232 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4233 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4234 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4235 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4236 | "$P_SRV" \ |
| 4237 | "$P_CLI request_size=100" \ |
| 4238 | 0 \ |
| 4239 | -s "Read from client: 100 bytes read$" |
| 4240 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4241 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4242 | "$P_SRV" \ |
| 4243 | "$P_CLI request_size=500" \ |
| 4244 | 0 \ |
| 4245 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4246 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4247 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4248 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4249 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4250 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4251 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4252 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4253 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4254 | 0 \ |
| 4255 | -s "Read from client: 1 bytes read" |
| 4256 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4257 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4258 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4259 | "$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] | 4260 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4261 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4262 | 0 \ |
| 4263 | -s "Read from client: 1 bytes read" |
| 4264 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4265 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4266 | "$P_SRV" \ |
| 4267 | "$P_CLI request_size=1 force_version=tls1 \ |
| 4268 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4269 | 0 \ |
| 4270 | -s "Read from client: 1 bytes read" |
| 4271 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4272 | 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] | 4273 | "$P_SRV" \ |
| 4274 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 4275 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4276 | 0 \ |
| 4277 | -s "Read from client: 1 bytes read" |
| 4278 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4279 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4280 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4281 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4282 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4283 | 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] | 4284 | 0 \ |
| 4285 | -s "Read from client: 1 bytes read" |
| 4286 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4287 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4288 | 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] | 4289 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4290 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4291 | 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] | 4292 | 0 \ |
| 4293 | -s "Read from client: 1 bytes read" |
| 4294 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4295 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4296 | "$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] | 4297 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4298 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4299 | 0 \ |
| 4300 | -s "Read from client: 1 bytes read" |
| 4301 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4302 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4303 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4304 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4305 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4306 | 0 \ |
| 4307 | -s "Read from client: 1 bytes read" |
| 4308 | |
| 4309 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4310 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4311 | "$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] | 4312 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4313 | 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] | 4314 | 0 \ |
| 4315 | -s "Read from client: 1 bytes read" |
| 4316 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4317 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4318 | 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] | 4319 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4320 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4321 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4322 | 0 \ |
| 4323 | -s "Read from client: 1 bytes read" |
| 4324 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4325 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4326 | "$P_SRV" \ |
| 4327 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4328 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4329 | 0 \ |
| 4330 | -s "Read from client: 1 bytes read" |
| 4331 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4332 | 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] | 4333 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4334 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4335 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4336 | 0 \ |
| 4337 | -s "Read from client: 1 bytes read" |
| 4338 | |
| 4339 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4340 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4341 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4342 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4343 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4344 | 0 \ |
| 4345 | -s "Read from client: 1 bytes read" |
| 4346 | |
| 4347 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4348 | 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] | 4349 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4350 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4351 | 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] | 4352 | 0 \ |
| 4353 | -s "Read from client: 1 bytes read" |
| 4354 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4355 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4356 | "$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] | 4357 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4358 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4359 | 0 \ |
| 4360 | -s "Read from client: 1 bytes read" |
| 4361 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4362 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4363 | "$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] | 4364 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4365 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4366 | 0 \ |
| 4367 | -s "Read from client: 1 bytes read" |
| 4368 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4369 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4370 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4371 | "$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] | 4372 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4373 | 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] | 4374 | 0 \ |
| 4375 | -s "Read from client: 1 bytes read" |
| 4376 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4377 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4378 | 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] | 4379 | "$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] | 4380 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4381 | 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] | 4382 | 0 \ |
| 4383 | -s "Read from client: 1 bytes read" |
| 4384 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4385 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4386 | "$P_SRV" \ |
| 4387 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4388 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4389 | 0 \ |
| 4390 | -s "Read from client: 1 bytes read" |
| 4391 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4392 | 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] | 4393 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4394 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4395 | 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] | 4396 | 0 \ |
| 4397 | -s "Read from client: 1 bytes read" |
| 4398 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4399 | 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] | 4400 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4401 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4402 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4403 | 0 \ |
| 4404 | -s "Read from client: 1 bytes read" |
| 4405 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4406 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4407 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4408 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4409 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4410 | 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] | 4411 | 0 \ |
| 4412 | -s "Read from client: 1 bytes read" |
| 4413 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4414 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4415 | 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] | 4416 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4417 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4418 | 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] | 4419 | 0 \ |
| 4420 | -s "Read from client: 1 bytes read" |
| 4421 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4422 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4423 | "$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] | 4424 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4425 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4426 | 0 \ |
| 4427 | -s "Read from client: 1 bytes read" |
| 4428 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4429 | 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] | 4430 | "$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] | 4431 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4432 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4433 | 0 \ |
| 4434 | -s "Read from client: 1 bytes read" |
| 4435 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4436 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4437 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4438 | "$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] | 4439 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4440 | 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] | 4441 | 0 \ |
| 4442 | -s "Read from client: 1 bytes read" |
| 4443 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4444 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4445 | 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] | 4446 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4447 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4448 | 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] | 4449 | 0 \ |
| 4450 | -s "Read from client: 1 bytes read" |
| 4451 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4452 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4453 | "$P_SRV" \ |
| 4454 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4455 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4456 | 0 \ |
| 4457 | -s "Read from client: 1 bytes read" |
| 4458 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4459 | 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] | 4460 | "$P_SRV" \ |
| 4461 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4462 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4463 | 0 \ |
| 4464 | -s "Read from client: 1 bytes read" |
| 4465 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4466 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4467 | |
| 4468 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4469 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4470 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 4471 | "$P_CLI dtls=1 request_size=1 \ |
| 4472 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4473 | 0 \ |
| 4474 | -s "Read from client: 1 bytes read" |
| 4475 | |
| 4476 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4477 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4478 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 4479 | "$P_CLI dtls=1 request_size=1 \ |
| 4480 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4481 | 0 \ |
| 4482 | -s "Read from client: 1 bytes read" |
| 4483 | |
| 4484 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4485 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4486 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4487 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 4488 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4489 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4490 | 0 \ |
| 4491 | -s "Read from client: 1 bytes read" |
| 4492 | |
| 4493 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4494 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4495 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4496 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4497 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4498 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4499 | 0 \ |
| 4500 | -s "Read from client: 1 bytes read" |
| 4501 | |
| 4502 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4503 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4504 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 4505 | "$P_CLI dtls=1 request_size=1 \ |
| 4506 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4507 | 0 \ |
| 4508 | -s "Read from client: 1 bytes read" |
| 4509 | |
| 4510 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4511 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4512 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4513 | "$P_CLI dtls=1 request_size=1 \ |
| 4514 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4515 | 0 \ |
| 4516 | -s "Read from client: 1 bytes read" |
| 4517 | |
| 4518 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4519 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4520 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4521 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4522 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4523 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4524 | 0 \ |
| 4525 | -s "Read from client: 1 bytes read" |
| 4526 | |
| 4527 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4528 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4529 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4530 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4531 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4532 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4533 | 0 \ |
| 4534 | -s "Read from client: 1 bytes read" |
| 4535 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4536 | # Tests for small server packets |
| 4537 | |
| 4538 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4539 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 4540 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 4541 | "$P_CLI force_version=ssl3 \ |
| 4542 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4543 | 0 \ |
| 4544 | -c "Read from server: 1 bytes read" |
| 4545 | |
| 4546 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4547 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 4548 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4549 | "$P_CLI force_version=ssl3 \ |
| 4550 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4551 | 0 \ |
| 4552 | -c "Read from server: 1 bytes read" |
| 4553 | |
| 4554 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 4555 | "$P_SRV response_size=1" \ |
| 4556 | "$P_CLI force_version=tls1 \ |
| 4557 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4558 | 0 \ |
| 4559 | -c "Read from server: 1 bytes read" |
| 4560 | |
| 4561 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 4562 | "$P_SRV response_size=1" \ |
| 4563 | "$P_CLI force_version=tls1 etm=0 \ |
| 4564 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4565 | 0 \ |
| 4566 | -c "Read from server: 1 bytes read" |
| 4567 | |
| 4568 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4569 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 4570 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4571 | "$P_CLI force_version=tls1 \ |
| 4572 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4573 | 0 \ |
| 4574 | -c "Read from server: 1 bytes read" |
| 4575 | |
| 4576 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4577 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 4578 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4579 | "$P_CLI force_version=tls1 \ |
| 4580 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4581 | 0 \ |
| 4582 | -c "Read from server: 1 bytes read" |
| 4583 | |
| 4584 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 4585 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4586 | "$P_CLI force_version=tls1 \ |
| 4587 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4588 | 0 \ |
| 4589 | -c "Read from server: 1 bytes read" |
| 4590 | |
| 4591 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 4592 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4593 | "$P_CLI force_version=tls1 \ |
| 4594 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4595 | 0 \ |
| 4596 | -c "Read from server: 1 bytes read" |
| 4597 | |
| 4598 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4599 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 4600 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4601 | "$P_CLI force_version=tls1 \ |
| 4602 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4603 | 0 \ |
| 4604 | -c "Read from server: 1 bytes read" |
| 4605 | |
| 4606 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4607 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 4608 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4609 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4610 | trunc_hmac=1 etm=0" \ |
| 4611 | 0 \ |
| 4612 | -c "Read from server: 1 bytes read" |
| 4613 | |
| 4614 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 4615 | "$P_SRV response_size=1" \ |
| 4616 | "$P_CLI force_version=tls1_1 \ |
| 4617 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4618 | 0 \ |
| 4619 | -c "Read from server: 1 bytes read" |
| 4620 | |
| 4621 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 4622 | "$P_SRV response_size=1" \ |
| 4623 | "$P_CLI force_version=tls1_1 \ |
| 4624 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4625 | 0 \ |
| 4626 | -c "Read from server: 1 bytes read" |
| 4627 | |
| 4628 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4629 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 4630 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4631 | "$P_CLI force_version=tls1_1 \ |
| 4632 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4633 | 0 \ |
| 4634 | -c "Read from server: 1 bytes read" |
| 4635 | |
| 4636 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4637 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 4638 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4639 | "$P_CLI force_version=tls1_1 \ |
| 4640 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4641 | 0 \ |
| 4642 | -c "Read from server: 1 bytes read" |
| 4643 | |
| 4644 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 4645 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4646 | "$P_CLI force_version=tls1_1 \ |
| 4647 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4648 | 0 \ |
| 4649 | -c "Read from server: 1 bytes read" |
| 4650 | |
| 4651 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 4652 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4653 | "$P_CLI force_version=tls1_1 \ |
| 4654 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4655 | 0 \ |
| 4656 | -c "Read from server: 1 bytes read" |
| 4657 | |
| 4658 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4659 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 4660 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4661 | "$P_CLI force_version=tls1_1 \ |
| 4662 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4663 | 0 \ |
| 4664 | -c "Read from server: 1 bytes read" |
| 4665 | |
| 4666 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4667 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 4668 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4669 | "$P_CLI force_version=tls1_1 \ |
| 4670 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4671 | 0 \ |
| 4672 | -c "Read from server: 1 bytes read" |
| 4673 | |
| 4674 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 4675 | "$P_SRV response_size=1" \ |
| 4676 | "$P_CLI force_version=tls1_2 \ |
| 4677 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4678 | 0 \ |
| 4679 | -c "Read from server: 1 bytes read" |
| 4680 | |
| 4681 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 4682 | "$P_SRV response_size=1" \ |
| 4683 | "$P_CLI force_version=tls1_2 \ |
| 4684 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4685 | 0 \ |
| 4686 | -c "Read from server: 1 bytes read" |
| 4687 | |
| 4688 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 4689 | "$P_SRV response_size=1" \ |
| 4690 | "$P_CLI force_version=tls1_2 \ |
| 4691 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 4692 | 0 \ |
| 4693 | -c "Read from server: 1 bytes read" |
| 4694 | |
| 4695 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4696 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 4697 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4698 | "$P_CLI force_version=tls1_2 \ |
| 4699 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4700 | 0 \ |
| 4701 | -c "Read from server: 1 bytes read" |
| 4702 | |
| 4703 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4704 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 4705 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4706 | "$P_CLI force_version=tls1_2 \ |
| 4707 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4708 | 0 \ |
| 4709 | -c "Read from server: 1 bytes read" |
| 4710 | |
| 4711 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 4712 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4713 | "$P_CLI force_version=tls1_2 \ |
| 4714 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4715 | 0 \ |
| 4716 | -c "Read from server: 1 bytes read" |
| 4717 | |
| 4718 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 4719 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4720 | "$P_CLI force_version=tls1_2 \ |
| 4721 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4722 | 0 \ |
| 4723 | -c "Read from server: 1 bytes read" |
| 4724 | |
| 4725 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4726 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 4727 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4728 | "$P_CLI force_version=tls1_2 \ |
| 4729 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4730 | 0 \ |
| 4731 | -c "Read from server: 1 bytes read" |
| 4732 | |
| 4733 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4734 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 4735 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4736 | "$P_CLI force_version=tls1_2 \ |
| 4737 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4738 | 0 \ |
| 4739 | -c "Read from server: 1 bytes read" |
| 4740 | |
| 4741 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 4742 | "$P_SRV response_size=1" \ |
| 4743 | "$P_CLI force_version=tls1_2 \ |
| 4744 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4745 | 0 \ |
| 4746 | -c "Read from server: 1 bytes read" |
| 4747 | |
| 4748 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 4749 | "$P_SRV response_size=1" \ |
| 4750 | "$P_CLI force_version=tls1_2 \ |
| 4751 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4752 | 0 \ |
| 4753 | -c "Read from server: 1 bytes read" |
| 4754 | |
| 4755 | # Tests for small server packets in DTLS |
| 4756 | |
| 4757 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4758 | run_test "Small server packet DTLS 1.0" \ |
| 4759 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 4760 | "$P_CLI dtls=1 \ |
| 4761 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4762 | 0 \ |
| 4763 | -c "Read from server: 1 bytes read" |
| 4764 | |
| 4765 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4766 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 4767 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 4768 | "$P_CLI dtls=1 \ |
| 4769 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4770 | 0 \ |
| 4771 | -c "Read from server: 1 bytes read" |
| 4772 | |
| 4773 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4774 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4775 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 4776 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 4777 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 4778 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4779 | 0 \ |
| 4780 | -c "Read from server: 1 bytes read" |
| 4781 | |
| 4782 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4783 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4784 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 4785 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 4786 | "$P_CLI dtls=1 \ |
| 4787 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4788 | 0 \ |
| 4789 | -c "Read from server: 1 bytes read" |
| 4790 | |
| 4791 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4792 | run_test "Small server packet DTLS 1.2" \ |
| 4793 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 4794 | "$P_CLI dtls=1 \ |
| 4795 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4796 | 0 \ |
| 4797 | -c "Read from server: 1 bytes read" |
| 4798 | |
| 4799 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4800 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 4801 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 4802 | "$P_CLI dtls=1 \ |
| 4803 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4804 | 0 \ |
| 4805 | -c "Read from server: 1 bytes read" |
| 4806 | |
| 4807 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4808 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4809 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 4810 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 4811 | "$P_CLI dtls=1 \ |
| 4812 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4813 | 0 \ |
| 4814 | -c "Read from server: 1 bytes read" |
| 4815 | |
| 4816 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4817 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4818 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 4819 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 4820 | "$P_CLI dtls=1 \ |
| 4821 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4822 | 0 \ |
| 4823 | -c "Read from server: 1 bytes read" |
| 4824 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4825 | # A test for extensions in SSLv3 |
| 4826 | |
| 4827 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4828 | run_test "SSLv3 with extensions, server side" \ |
| 4829 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 4830 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 4831 | 0 \ |
| 4832 | -S "dumping 'client hello extensions'" \ |
| 4833 | -S "server hello, total extension length:" |
| 4834 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4835 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4836 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4837 | # How many fragments do we expect to write $1 bytes? |
| 4838 | fragments_for_write() { |
| 4839 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 4840 | } |
| 4841 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4842 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4843 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4844 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4845 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4846 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4847 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4848 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4849 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4850 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4851 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4852 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4853 | "$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] | 4854 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4855 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4856 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4857 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4858 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4859 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4860 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4861 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4862 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4863 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4864 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4865 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4866 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4867 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4868 | 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] | 4869 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4870 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4871 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4872 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4873 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4874 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4875 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4876 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4877 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4878 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4879 | 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] | 4880 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4881 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4882 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4883 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4884 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4885 | 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] | 4886 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4887 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4888 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4889 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4890 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4891 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4892 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4893 | "$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] | 4894 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4895 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4896 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4897 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4898 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4899 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4900 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4901 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4902 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4903 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4904 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4905 | |
| 4906 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4907 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4908 | "$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] | 4909 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4910 | 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] | 4911 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4912 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4913 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4914 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4915 | 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] | 4916 | "$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] | 4917 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4918 | 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] | 4919 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4920 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4921 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4922 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4923 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4924 | "$P_SRV" \ |
| 4925 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4926 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4927 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4928 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4929 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4930 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4931 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4932 | "$P_SRV" \ |
| 4933 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 4934 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4935 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4936 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4937 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4938 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4939 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4940 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4941 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4942 | 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] | 4943 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4944 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4945 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4946 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4947 | 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] | 4948 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4949 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4950 | 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] | 4951 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4952 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4953 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4954 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4955 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4956 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4957 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4958 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4959 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4960 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4961 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4962 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4963 | "$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] | 4964 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4965 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4966 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4967 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4968 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4969 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4970 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4971 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4972 | "$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] | 4973 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4974 | 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] | 4975 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4976 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4977 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4978 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4979 | 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] | 4980 | "$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] | 4981 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4982 | 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] | 4983 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4984 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4985 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4986 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4987 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4988 | "$P_SRV" \ |
| 4989 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4990 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4991 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4992 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4993 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4994 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4995 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4996 | "$P_SRV" \ |
| 4997 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 4998 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4999 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5000 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5001 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5002 | 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] | 5003 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5004 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5005 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5006 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5007 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5008 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5009 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5010 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5011 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5012 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5013 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5014 | 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] | 5015 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5016 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5017 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5018 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5019 | 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] | 5020 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5021 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5022 | 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] | 5023 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5024 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5025 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5026 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5027 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5028 | "$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] | 5029 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5030 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5031 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5032 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5033 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5034 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5035 | 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] | 5036 | "$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] | 5037 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5038 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5039 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5040 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5041 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5042 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5043 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5044 | "$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] | 5045 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5046 | 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] | 5047 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5048 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5049 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5050 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5051 | 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] | 5052 | "$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] | 5053 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5054 | 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] | 5055 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5056 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5057 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5058 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5059 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5060 | "$P_SRV" \ |
| 5061 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5062 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5063 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5064 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5065 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5066 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5067 | 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] | 5068 | "$P_SRV" \ |
| 5069 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5070 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5071 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5072 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5073 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5074 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5075 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5076 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5077 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 5078 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5079 | "$P_CLI force_version=ssl3 \ |
| 5080 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5081 | 0 \ |
| 5082 | -c "Read from server: 16384 bytes read" |
| 5083 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 5084 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 5085 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5086 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 5087 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 5088 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 5089 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5090 | 0 \ |
| 5091 | -c "Read from server: 1 bytes read"\ |
| 5092 | -c "16383 bytes read"\ |
| 5093 | -C "Read from server: 16384 bytes read" |
| 5094 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5095 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 5096 | "$P_SRV response_size=16384" \ |
| 5097 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5098 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5099 | 0 \ |
| 5100 | -c "Read from server: 1 bytes read"\ |
| 5101 | -c "16383 bytes read"\ |
| 5102 | -C "Read from server: 16384 bytes read" |
| 5103 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5104 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5105 | "$P_SRV response_size=16384" \ |
| 5106 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 5107 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5108 | 0 \ |
| 5109 | -c "Read from server: 1 bytes read"\ |
| 5110 | -c "16383 bytes read"\ |
| 5111 | -C "Read from server: 16384 bytes read" |
| 5112 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5113 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5114 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 5115 | "$P_SRV response_size=16384" \ |
| 5116 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5117 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5118 | trunc_hmac=1" \ |
| 5119 | 0 \ |
| 5120 | -c "Read from server: 1 bytes read"\ |
| 5121 | -c "16383 bytes read"\ |
| 5122 | -C "Read from server: 16384 bytes read" |
| 5123 | |
| 5124 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5125 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 5126 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5127 | "$P_CLI force_version=tls1 \ |
| 5128 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5129 | trunc_hmac=1" \ |
| 5130 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5131 | -s "16384 bytes written in 1 fragments" \ |
| 5132 | -c "Read from server: 16384 bytes read" |
| 5133 | |
| 5134 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 5135 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5136 | "$P_CLI force_version=tls1 \ |
| 5137 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5138 | 0 \ |
| 5139 | -s "16384 bytes written in 1 fragments" \ |
| 5140 | -c "Read from server: 16384 bytes read" |
| 5141 | |
| 5142 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5143 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5144 | "$P_CLI force_version=tls1 \ |
| 5145 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5146 | 0 \ |
| 5147 | -s "16384 bytes written in 1 fragments" \ |
| 5148 | -c "Read from server: 16384 bytes read" |
| 5149 | |
| 5150 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5151 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5152 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5153 | "$P_CLI force_version=tls1 \ |
| 5154 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5155 | 0 \ |
| 5156 | -s "16384 bytes written in 1 fragments" \ |
| 5157 | -c "Read from server: 16384 bytes read" |
| 5158 | |
| 5159 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5160 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5161 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5162 | "$P_CLI force_version=tls1 \ |
| 5163 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5164 | 0 \ |
| 5165 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5166 | -c "Read from server: 16384 bytes read" |
| 5167 | |
| 5168 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 5169 | "$P_SRV response_size=16384" \ |
| 5170 | "$P_CLI force_version=tls1_1 \ |
| 5171 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5172 | 0 \ |
| 5173 | -c "Read from server: 16384 bytes read" |
| 5174 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5175 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5176 | "$P_SRV response_size=16384" \ |
| 5177 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 5178 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5179 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5180 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5181 | -c "Read from server: 16384 bytes read" |
| 5182 | |
| 5183 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5184 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 5185 | "$P_SRV response_size=16384" \ |
| 5186 | "$P_CLI force_version=tls1_1 \ |
| 5187 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5188 | trunc_hmac=1" \ |
| 5189 | 0 \ |
| 5190 | -c "Read from server: 16384 bytes read" |
| 5191 | |
| 5192 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5193 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5194 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5195 | "$P_CLI force_version=tls1_1 \ |
| 5196 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5197 | 0 \ |
| 5198 | -s "16384 bytes written in 1 fragments" \ |
| 5199 | -c "Read from server: 16384 bytes read" |
| 5200 | |
| 5201 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 5202 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5203 | "$P_CLI force_version=tls1_1 \ |
| 5204 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5205 | 0 \ |
| 5206 | -c "Read from server: 16384 bytes read" |
| 5207 | |
| 5208 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5209 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5210 | "$P_CLI force_version=tls1_1 \ |
| 5211 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5212 | 0 \ |
| 5213 | -s "16384 bytes written in 1 fragments" \ |
| 5214 | -c "Read from server: 16384 bytes read" |
| 5215 | |
| 5216 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5217 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 5218 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5219 | "$P_CLI force_version=tls1_1 \ |
| 5220 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5221 | trunc_hmac=1" \ |
| 5222 | 0 \ |
| 5223 | -c "Read from server: 16384 bytes read" |
| 5224 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5225 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5226 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5227 | "$P_CLI force_version=tls1_1 \ |
| 5228 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5229 | 0 \ |
| 5230 | -s "16384 bytes written in 1 fragments" \ |
| 5231 | -c "Read from server: 16384 bytes read" |
| 5232 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5233 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5234 | "$P_SRV response_size=16384" \ |
| 5235 | "$P_CLI force_version=tls1_2 \ |
| 5236 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5237 | 0 \ |
| 5238 | -c "Read from server: 16384 bytes read" |
| 5239 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5240 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5241 | "$P_SRV response_size=16384" \ |
| 5242 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5243 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5244 | 0 \ |
| 5245 | -s "16384 bytes written in 1 fragments" \ |
| 5246 | -c "Read from server: 16384 bytes read" |
| 5247 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5248 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5249 | "$P_SRV response_size=16384" \ |
| 5250 | "$P_CLI force_version=tls1_2 \ |
| 5251 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5252 | 0 \ |
| 5253 | -c "Read from server: 16384 bytes read" |
| 5254 | |
| 5255 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5256 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 5257 | "$P_SRV response_size=16384" \ |
| 5258 | "$P_CLI force_version=tls1_2 \ |
| 5259 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5260 | trunc_hmac=1" \ |
| 5261 | 0 \ |
| 5262 | -c "Read from server: 16384 bytes read" |
| 5263 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5264 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5265 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5266 | "$P_CLI force_version=tls1_2 \ |
| 5267 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5268 | 0 \ |
| 5269 | -s "16384 bytes written in 1 fragments" \ |
| 5270 | -c "Read from server: 16384 bytes read" |
| 5271 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5272 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 5273 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5274 | "$P_CLI force_version=tls1_2 \ |
| 5275 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5276 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5277 | -s "16384 bytes written in 1 fragments" \ |
| 5278 | -c "Read from server: 16384 bytes read" |
| 5279 | |
| 5280 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5281 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5282 | "$P_CLI force_version=tls1_2 \ |
| 5283 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5284 | 0 \ |
| 5285 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5286 | -c "Read from server: 16384 bytes read" |
| 5287 | |
| 5288 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5289 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 5290 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5291 | "$P_CLI force_version=tls1_2 \ |
| 5292 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5293 | trunc_hmac=1" \ |
| 5294 | 0 \ |
| 5295 | -c "Read from server: 16384 bytes read" |
| 5296 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5297 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5298 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5299 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5300 | "$P_CLI force_version=tls1_2 \ |
| 5301 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5302 | 0 \ |
| 5303 | -s "16384 bytes written in 1 fragments" \ |
| 5304 | -c "Read from server: 16384 bytes read" |
| 5305 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5306 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5307 | "$P_SRV response_size=16384" \ |
| 5308 | "$P_CLI force_version=tls1_2 \ |
| 5309 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5310 | 0 \ |
| 5311 | -c "Read from server: 16384 bytes read" |
| 5312 | |
| 5313 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5314 | "$P_SRV response_size=16384" \ |
| 5315 | "$P_CLI force_version=tls1_2 \ |
| 5316 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5317 | 0 \ |
| 5318 | -c "Read from server: 16384 bytes read" |
| 5319 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5320 | # Tests for restartable ECC |
| 5321 | |
| 5322 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5323 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5324 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5325 | "$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] | 5326 | 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] | 5327 | debug_level=1" \ |
| 5328 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5329 | -C "x509_verify_cert.*4b00" \ |
| 5330 | -C "mbedtls_pk_verify.*4b00" \ |
| 5331 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5332 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5333 | |
| 5334 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5335 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5336 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5337 | "$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] | 5338 | 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] | 5339 | debug_level=1 ec_max_ops=0" \ |
| 5340 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5341 | -C "x509_verify_cert.*4b00" \ |
| 5342 | -C "mbedtls_pk_verify.*4b00" \ |
| 5343 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5344 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5345 | |
| 5346 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5347 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5348 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5349 | "$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] | 5350 | 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] | 5351 | debug_level=1 ec_max_ops=65535" \ |
| 5352 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5353 | -C "x509_verify_cert.*4b00" \ |
| 5354 | -C "mbedtls_pk_verify.*4b00" \ |
| 5355 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5356 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5357 | |
| 5358 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5359 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5360 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5361 | "$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] | 5362 | 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] | 5363 | debug_level=1 ec_max_ops=1000" \ |
| 5364 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5365 | -c "x509_verify_cert.*4b00" \ |
| 5366 | -c "mbedtls_pk_verify.*4b00" \ |
| 5367 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5368 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5369 | |
| 5370 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5371 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 5372 | "$P_SRV auth_mode=required \ |
| 5373 | crt_file=data_files/server5-badsign.crt \ |
| 5374 | key_file=data_files/server5.key" \ |
| 5375 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5376 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5377 | debug_level=1 ec_max_ops=1000" \ |
| 5378 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5379 | -c "x509_verify_cert.*4b00" \ |
| 5380 | -C "mbedtls_pk_verify.*4b00" \ |
| 5381 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5382 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5383 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5384 | -c "! mbedtls_ssl_handshake returned" \ |
| 5385 | -c "X509 - Certificate verification failed" |
| 5386 | |
| 5387 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5388 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 5389 | "$P_SRV auth_mode=required \ |
| 5390 | crt_file=data_files/server5-badsign.crt \ |
| 5391 | key_file=data_files/server5.key" \ |
| 5392 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5393 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5394 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5395 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5396 | -c "x509_verify_cert.*4b00" \ |
| 5397 | -c "mbedtls_pk_verify.*4b00" \ |
| 5398 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5399 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5400 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5401 | -C "! mbedtls_ssl_handshake returned" \ |
| 5402 | -C "X509 - Certificate verification failed" |
| 5403 | |
| 5404 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5405 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 5406 | "$P_SRV auth_mode=required \ |
| 5407 | crt_file=data_files/server5-badsign.crt \ |
| 5408 | key_file=data_files/server5.key" \ |
| 5409 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5410 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5411 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 5412 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5413 | -C "x509_verify_cert.*4b00" \ |
| 5414 | -c "mbedtls_pk_verify.*4b00" \ |
| 5415 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5416 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5417 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5418 | -C "! mbedtls_ssl_handshake returned" \ |
| 5419 | -C "X509 - Certificate verification failed" |
| 5420 | |
| 5421 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5422 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5423 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5424 | "$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] | 5425 | 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] | 5426 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 5427 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5428 | -c "x509_verify_cert.*4b00" \ |
| 5429 | -c "mbedtls_pk_verify.*4b00" \ |
| 5430 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5431 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5432 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5433 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5434 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 5435 | "$P_SRV" \ |
| 5436 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5437 | debug_level=1 ec_max_ops=1000" \ |
| 5438 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5439 | -c "x509_verify_cert.*4b00" \ |
| 5440 | -c "mbedtls_pk_verify.*4b00" \ |
| 5441 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5442 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5443 | |
| 5444 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5445 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 5446 | "$P_SRV psk=abc123" \ |
| 5447 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 5448 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 5449 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5450 | -C "x509_verify_cert.*4b00" \ |
| 5451 | -C "mbedtls_pk_verify.*4b00" \ |
| 5452 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5453 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5454 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5455 | # Tests of asynchronous private key support in SSL |
| 5456 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5457 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5458 | run_test "SSL async private: sign, delay=0" \ |
| 5459 | "$P_SRV \ |
| 5460 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5461 | "$P_CLI" \ |
| 5462 | 0 \ |
| 5463 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5464 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5465 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5466 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5467 | run_test "SSL async private: sign, delay=1" \ |
| 5468 | "$P_SRV \ |
| 5469 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5470 | "$P_CLI" \ |
| 5471 | 0 \ |
| 5472 | -s "Async sign callback: using key slot " \ |
| 5473 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5474 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5475 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 5476 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5477 | run_test "SSL async private: sign, delay=2" \ |
| 5478 | "$P_SRV \ |
| 5479 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 5480 | "$P_CLI" \ |
| 5481 | 0 \ |
| 5482 | -s "Async sign callback: using key slot " \ |
| 5483 | -U "Async sign callback: using key slot " \ |
| 5484 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 5485 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5486 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5487 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 5488 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 5489 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 5490 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5492 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 5493 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 5494 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 5495 | "$P_CLI force_version=tls1_1" \ |
| 5496 | 0 \ |
| 5497 | -s "Async sign callback: using key slot " \ |
| 5498 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5499 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5500 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 5501 | run_test "SSL async private: sign, SNI" \ |
| 5502 | "$P_SRV debug_level=3 \ |
| 5503 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 5504 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5505 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5506 | "$P_CLI server_name=polarssl.example" \ |
| 5507 | 0 \ |
| 5508 | -s "Async sign callback: using key slot " \ |
| 5509 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5510 | -s "parse ServerName extension" \ |
| 5511 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5512 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5513 | |
| 5514 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5515 | run_test "SSL async private: decrypt, delay=0" \ |
| 5516 | "$P_SRV \ |
| 5517 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5518 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5519 | 0 \ |
| 5520 | -s "Async decrypt callback: using key slot " \ |
| 5521 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5522 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5523 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5524 | run_test "SSL async private: decrypt, delay=1" \ |
| 5525 | "$P_SRV \ |
| 5526 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5527 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5528 | 0 \ |
| 5529 | -s "Async decrypt callback: using key slot " \ |
| 5530 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5531 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5532 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5533 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5534 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 5535 | "$P_SRV psk=abc123 \ |
| 5536 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5537 | "$P_CLI psk=abc123 \ |
| 5538 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5539 | 0 \ |
| 5540 | -s "Async decrypt callback: using key slot " \ |
| 5541 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5542 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5543 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5544 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 5545 | "$P_SRV psk=abc123 \ |
| 5546 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5547 | "$P_CLI psk=abc123 \ |
| 5548 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5549 | 0 \ |
| 5550 | -s "Async decrypt callback: using key slot " \ |
| 5551 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5552 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5553 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5554 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5555 | run_test "SSL async private: sign callback not present" \ |
| 5556 | "$P_SRV \ |
| 5557 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5558 | "$P_CLI; [ \$? -eq 1 ] && |
| 5559 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5560 | 0 \ |
| 5561 | -S "Async sign callback" \ |
| 5562 | -s "! mbedtls_ssl_handshake returned" \ |
| 5563 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 5564 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 5565 | -s "Successful connection" |
| 5566 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5567 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5568 | run_test "SSL async private: decrypt callback not present" \ |
| 5569 | "$P_SRV debug_level=1 \ |
| 5570 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 5571 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 5572 | [ \$? -eq 1 ] && $P_CLI" \ |
| 5573 | 0 \ |
| 5574 | -S "Async decrypt callback" \ |
| 5575 | -s "! mbedtls_ssl_handshake returned" \ |
| 5576 | -s "got no RSA private key" \ |
| 5577 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5578 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5579 | |
| 5580 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5581 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5582 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5583 | "$P_SRV \ |
| 5584 | async_operations=s async_private_delay1=1 \ |
| 5585 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5586 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5587 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5588 | 0 \ |
| 5589 | -s "Async sign callback: using key slot 0," \ |
| 5590 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5591 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5592 | |
| 5593 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5594 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5595 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5596 | "$P_SRV \ |
| 5597 | async_operations=s async_private_delay2=1 \ |
| 5598 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5599 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5600 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5601 | 0 \ |
| 5602 | -s "Async sign callback: using key slot 0," \ |
| 5603 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5604 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5605 | |
| 5606 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5607 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 5608 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5609 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 5610 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5611 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5612 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5613 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5614 | 0 \ |
| 5615 | -s "Async sign callback: using key slot 1," \ |
| 5616 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5617 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5618 | |
| 5619 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5620 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5621 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5622 | "$P_SRV \ |
| 5623 | async_operations=s async_private_delay1=1 \ |
| 5624 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5625 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5626 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5627 | 0 \ |
| 5628 | -s "Async sign callback: no key matches this certificate." |
| 5629 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5630 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5631 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5632 | "$P_SRV \ |
| 5633 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5634 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5635 | "$P_CLI" \ |
| 5636 | 1 \ |
| 5637 | -s "Async sign callback: injected error" \ |
| 5638 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5639 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5640 | -s "! mbedtls_ssl_handshake returned" |
| 5641 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5642 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5643 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5644 | "$P_SRV \ |
| 5645 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5646 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5647 | "$P_CLI" \ |
| 5648 | 1 \ |
| 5649 | -s "Async sign callback: using key slot " \ |
| 5650 | -S "Async resume" \ |
| 5651 | -s "Async cancel" |
| 5652 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5653 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5654 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5655 | "$P_SRV \ |
| 5656 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5657 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5658 | "$P_CLI" \ |
| 5659 | 1 \ |
| 5660 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5661 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5662 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5663 | -s "! mbedtls_ssl_handshake returned" |
| 5664 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5665 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5666 | run_test "SSL async private: decrypt, error in start" \ |
| 5667 | "$P_SRV \ |
| 5668 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5669 | async_private_error=1" \ |
| 5670 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5671 | 1 \ |
| 5672 | -s "Async decrypt callback: injected error" \ |
| 5673 | -S "Async resume" \ |
| 5674 | -S "Async cancel" \ |
| 5675 | -s "! mbedtls_ssl_handshake returned" |
| 5676 | |
| 5677 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5678 | run_test "SSL async private: decrypt, cancel after start" \ |
| 5679 | "$P_SRV \ |
| 5680 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5681 | async_private_error=2" \ |
| 5682 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5683 | 1 \ |
| 5684 | -s "Async decrypt callback: using key slot " \ |
| 5685 | -S "Async resume" \ |
| 5686 | -s "Async cancel" |
| 5687 | |
| 5688 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5689 | run_test "SSL async private: decrypt, error in resume" \ |
| 5690 | "$P_SRV \ |
| 5691 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5692 | async_private_error=3" \ |
| 5693 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5694 | 1 \ |
| 5695 | -s "Async decrypt callback: using key slot " \ |
| 5696 | -s "Async resume callback: decrypt done but injected error" \ |
| 5697 | -S "Async cancel" \ |
| 5698 | -s "! mbedtls_ssl_handshake returned" |
| 5699 | |
| 5700 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5701 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5702 | "$P_SRV \ |
| 5703 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5704 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5705 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5706 | 0 \ |
| 5707 | -s "Async cancel" \ |
| 5708 | -s "! mbedtls_ssl_handshake returned" \ |
| 5709 | -s "Async resume" \ |
| 5710 | -s "Successful connection" |
| 5711 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5712 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5713 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5714 | "$P_SRV \ |
| 5715 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5716 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5717 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5718 | 0 \ |
| 5719 | -s "! mbedtls_ssl_handshake returned" \ |
| 5720 | -s "Async resume" \ |
| 5721 | -s "Successful connection" |
| 5722 | |
| 5723 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5724 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5725 | 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] | 5726 | "$P_SRV \ |
| 5727 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 5728 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5729 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5730 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5731 | [ \$? -eq 1 ] && |
| 5732 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5733 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 5734 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5735 | -S "Async resume" \ |
| 5736 | -s "Async cancel" \ |
| 5737 | -s "! mbedtls_ssl_handshake returned" \ |
| 5738 | -s "Async sign callback: no key matches this certificate." \ |
| 5739 | -s "Successful connection" |
| 5740 | |
| 5741 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5742 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5743 | 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] | 5744 | "$P_SRV \ |
| 5745 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 5746 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5747 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5748 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5749 | [ \$? -eq 1 ] && |
| 5750 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5751 | 0 \ |
| 5752 | -s "Async resume" \ |
| 5753 | -s "! mbedtls_ssl_handshake returned" \ |
| 5754 | -s "Async sign callback: no key matches this certificate." \ |
| 5755 | -s "Successful connection" |
| 5756 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5757 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5758 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5759 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 5760 | "$P_SRV \ |
| 5761 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5762 | exchanges=2 renegotiation=1" \ |
| 5763 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5764 | 0 \ |
| 5765 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5766 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5767 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5768 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5770 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 5771 | "$P_SRV \ |
| 5772 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5773 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5774 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 5775 | 0 \ |
| 5776 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5777 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5778 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5779 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5780 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5781 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 5782 | "$P_SRV \ |
| 5783 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5784 | exchanges=2 renegotiation=1" \ |
| 5785 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5786 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5787 | 0 \ |
| 5788 | -s "Async decrypt callback: using key slot " \ |
| 5789 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5790 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5791 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5792 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5793 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 5794 | "$P_SRV \ |
| 5795 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5796 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5797 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 5798 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5799 | 0 \ |
| 5800 | -s "Async decrypt callback: using key slot " \ |
| 5801 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5802 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5803 | # Tests for ECC extensions (rfc 4492) |
| 5804 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5805 | requires_config_enabled MBEDTLS_AES_C |
| 5806 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5807 | requires_config_enabled MBEDTLS_SHA256_C |
| 5808 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5809 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 5810 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5811 | "$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] | 5812 | 0 \ |
| 5813 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 5814 | -C "client hello, adding supported_point_formats extension" \ |
| 5815 | -S "found supported elliptic curves extension" \ |
| 5816 | -S "found supported point formats extension" |
| 5817 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5818 | requires_config_enabled MBEDTLS_AES_C |
| 5819 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5820 | requires_config_enabled MBEDTLS_SHA256_C |
| 5821 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5822 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5823 | "$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] | 5824 | "$P_CLI debug_level=3" \ |
| 5825 | 0 \ |
| 5826 | -C "found supported_point_formats extension" \ |
| 5827 | -S "server hello, supported_point_formats extension" |
| 5828 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5829 | requires_config_enabled MBEDTLS_AES_C |
| 5830 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5831 | requires_config_enabled MBEDTLS_SHA256_C |
| 5832 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5833 | run_test "Force an ECC ciphersuite in the client side" \ |
| 5834 | "$P_SRV debug_level=3" \ |
| 5835 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5836 | 0 \ |
| 5837 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 5838 | -c "client hello, adding supported_point_formats extension" \ |
| 5839 | -s "found supported elliptic curves extension" \ |
| 5840 | -s "found supported point formats extension" |
| 5841 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5842 | requires_config_enabled MBEDTLS_AES_C |
| 5843 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5844 | requires_config_enabled MBEDTLS_SHA256_C |
| 5845 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5846 | run_test "Force an ECC ciphersuite in the server side" \ |
| 5847 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5848 | "$P_CLI debug_level=3" \ |
| 5849 | 0 \ |
| 5850 | -c "found supported_point_formats extension" \ |
| 5851 | -s "server hello, supported_point_formats extension" |
| 5852 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5853 | # Tests for DTLS HelloVerifyRequest |
| 5854 | |
| 5855 | run_test "DTLS cookie: enabled" \ |
| 5856 | "$P_SRV dtls=1 debug_level=2" \ |
| 5857 | "$P_CLI dtls=1 debug_level=2" \ |
| 5858 | 0 \ |
| 5859 | -s "cookie verification failed" \ |
| 5860 | -s "cookie verification passed" \ |
| 5861 | -S "cookie verification skipped" \ |
| 5862 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5863 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5864 | -S "SSL - The requested feature is not available" |
| 5865 | |
| 5866 | run_test "DTLS cookie: disabled" \ |
| 5867 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 5868 | "$P_CLI dtls=1 debug_level=2" \ |
| 5869 | 0 \ |
| 5870 | -S "cookie verification failed" \ |
| 5871 | -S "cookie verification passed" \ |
| 5872 | -s "cookie verification skipped" \ |
| 5873 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5874 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5875 | -S "SSL - The requested feature is not available" |
| 5876 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5877 | run_test "DTLS cookie: default (failing)" \ |
| 5878 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 5879 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 5880 | 1 \ |
| 5881 | -s "cookie verification failed" \ |
| 5882 | -S "cookie verification passed" \ |
| 5883 | -S "cookie verification skipped" \ |
| 5884 | -C "received hello verify request" \ |
| 5885 | -S "hello verification requested" \ |
| 5886 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5887 | |
| 5888 | requires_ipv6 |
| 5889 | run_test "DTLS cookie: enabled, IPv6" \ |
| 5890 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 5891 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 5892 | 0 \ |
| 5893 | -s "cookie verification failed" \ |
| 5894 | -s "cookie verification passed" \ |
| 5895 | -S "cookie verification skipped" \ |
| 5896 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5897 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5898 | -S "SSL - The requested feature is not available" |
| 5899 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5900 | run_test "DTLS cookie: enabled, nbio" \ |
| 5901 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 5902 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 5903 | 0 \ |
| 5904 | -s "cookie verification failed" \ |
| 5905 | -s "cookie verification passed" \ |
| 5906 | -S "cookie verification skipped" \ |
| 5907 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5908 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5909 | -S "SSL - The requested feature is not available" |
| 5910 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5911 | # Tests for client reconnecting from the same port with DTLS |
| 5912 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5913 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5914 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 5915 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 5916 | "$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] | 5917 | 0 \ |
| 5918 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5919 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5920 | -S "Client initiated reconnection from same port" |
| 5921 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5922 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5923 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 5924 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 5925 | "$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] | 5926 | 0 \ |
| 5927 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5928 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5929 | -s "Client initiated reconnection from same port" |
| 5930 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 5931 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 5932 | 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] | 5933 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 5934 | "$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] | 5935 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5936 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5937 | -s "Client initiated reconnection from same port" |
| 5938 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 5939 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 5940 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 5941 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 5942 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 5943 | 0 \ |
| 5944 | -S "The operation timed out" \ |
| 5945 | -s "Client initiated reconnection from same port" |
| 5946 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5947 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 5948 | "$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] | 5949 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 5950 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5951 | -s "The operation timed out" \ |
| 5952 | -S "Client initiated reconnection from same port" |
| 5953 | |
Manuel Pégourié-Gonnard | b85ce9e | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 5954 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 5955 | -p "$P_PXY inject_clihlo=1" \ |
| 5956 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 5957 | "$P_CLI dtls=1 exchanges=2" \ |
| 5958 | 0 \ |
| 5959 | -s "possible client reconnect from the same port" \ |
| 5960 | -S "Client initiated reconnection from same port" |
| 5961 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5962 | # Tests for various cases of client authentication with DTLS |
| 5963 | # (focused on handshake flows and message parsing) |
| 5964 | |
| 5965 | run_test "DTLS client auth: required" \ |
| 5966 | "$P_SRV dtls=1 auth_mode=required" \ |
| 5967 | "$P_CLI dtls=1" \ |
| 5968 | 0 \ |
| 5969 | -s "Verifying peer X.509 certificate... ok" |
| 5970 | |
| 5971 | run_test "DTLS client auth: optional, client has no cert" \ |
| 5972 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 5973 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 5974 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5975 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5976 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5977 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5978 | "$P_SRV dtls=1 auth_mode=none" \ |
| 5979 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 5980 | 0 \ |
| 5981 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5982 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5983 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 5984 | run_test "DTLS wrong PSK: badmac alert" \ |
| 5985 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 5986 | "$P_CLI dtls=1 psk=abc124" \ |
| 5987 | 1 \ |
| 5988 | -s "SSL - Verification of the message MAC failed" \ |
| 5989 | -c "SSL - A fatal alert message was received from our peer" |
| 5990 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 5991 | # Tests for receiving fragmented handshake messages with DTLS |
| 5992 | |
| 5993 | requires_gnutls |
| 5994 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 5995 | "$G_SRV -u --mtu 2048 -a" \ |
| 5996 | "$P_CLI dtls=1 debug_level=2" \ |
| 5997 | 0 \ |
| 5998 | -C "found fragmented DTLS handshake message" \ |
| 5999 | -C "error" |
| 6000 | |
| 6001 | requires_gnutls |
| 6002 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6003 | "$G_SRV -u --mtu 512" \ |
| 6004 | "$P_CLI dtls=1 debug_level=2" \ |
| 6005 | 0 \ |
| 6006 | -c "found fragmented DTLS handshake message" \ |
| 6007 | -C "error" |
| 6008 | |
| 6009 | requires_gnutls |
| 6010 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6011 | "$G_SRV -u --mtu 128" \ |
| 6012 | "$P_CLI dtls=1 debug_level=2" \ |
| 6013 | 0 \ |
| 6014 | -c "found fragmented DTLS handshake message" \ |
| 6015 | -C "error" |
| 6016 | |
| 6017 | requires_gnutls |
| 6018 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6019 | "$G_SRV -u --mtu 128" \ |
| 6020 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6021 | 0 \ |
| 6022 | -c "found fragmented DTLS handshake message" \ |
| 6023 | -C "error" |
| 6024 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6025 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6026 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6027 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6028 | "$G_SRV -u --mtu 256" \ |
| 6029 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6030 | 0 \ |
| 6031 | -c "found fragmented DTLS handshake message" \ |
| 6032 | -c "client hello, adding renegotiation extension" \ |
| 6033 | -c "found renegotiation extension" \ |
| 6034 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6035 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6036 | -C "error" \ |
| 6037 | -s "Extra-header:" |
| 6038 | |
| 6039 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6040 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6041 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6042 | "$G_SRV -u --mtu 256" \ |
| 6043 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6044 | 0 \ |
| 6045 | -c "found fragmented DTLS handshake message" \ |
| 6046 | -c "client hello, adding renegotiation extension" \ |
| 6047 | -c "found renegotiation extension" \ |
| 6048 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6049 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6050 | -C "error" \ |
| 6051 | -s "Extra-header:" |
| 6052 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6053 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6054 | "$O_SRV -dtls1 -mtu 2048" \ |
| 6055 | "$P_CLI dtls=1 debug_level=2" \ |
| 6056 | 0 \ |
| 6057 | -C "found fragmented DTLS handshake message" \ |
| 6058 | -C "error" |
| 6059 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6060 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6061 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6062 | "$P_CLI dtls=1 debug_level=2" \ |
| 6063 | 0 \ |
| 6064 | -c "found fragmented DTLS handshake message" \ |
| 6065 | -C "error" |
| 6066 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6067 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6068 | "$O_SRV -dtls1 -mtu 256" \ |
| 6069 | "$P_CLI dtls=1 debug_level=2" \ |
| 6070 | 0 \ |
| 6071 | -c "found fragmented DTLS handshake message" \ |
| 6072 | -C "error" |
| 6073 | |
| 6074 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6075 | "$O_SRV -dtls1 -mtu 256" \ |
| 6076 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6077 | 0 \ |
| 6078 | -c "found fragmented DTLS handshake message" \ |
| 6079 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6080 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6081 | # Tests for sending fragmented handshake messages with DTLS |
| 6082 | # |
| 6083 | # Use client auth when we need the client to send large messages, |
| 6084 | # and use large cert chains on both sides too (the long chains we have all use |
| 6085 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6086 | # Sizes reached (UDP payload): |
| 6087 | # - 2037B for server certificate |
| 6088 | # - 1542B for client certificate |
| 6089 | # - 1013B for newsessionticket |
| 6090 | # - all others below 512B |
| 6091 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6092 | |
| 6093 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6094 | requires_config_enabled MBEDTLS_RSA_C |
| 6095 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6096 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6097 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6098 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6099 | crt_file=data_files/server7_int-ca.crt \ |
| 6100 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6101 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6102 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6103 | "$P_CLI dtls=1 debug_level=2 \ |
| 6104 | crt_file=data_files/server8_int-ca2.crt \ |
| 6105 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6106 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6107 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6108 | 0 \ |
| 6109 | -S "found fragmented DTLS handshake message" \ |
| 6110 | -C "found fragmented DTLS handshake message" \ |
| 6111 | -C "error" |
| 6112 | |
| 6113 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6114 | requires_config_enabled MBEDTLS_RSA_C |
| 6115 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6116 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6117 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6118 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6119 | crt_file=data_files/server7_int-ca.crt \ |
| 6120 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6121 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6122 | max_frag_len=1024" \ |
| 6123 | "$P_CLI dtls=1 debug_level=2 \ |
| 6124 | crt_file=data_files/server8_int-ca2.crt \ |
| 6125 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6126 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6127 | max_frag_len=2048" \ |
| 6128 | 0 \ |
| 6129 | -S "found fragmented DTLS handshake message" \ |
| 6130 | -c "found fragmented DTLS handshake message" \ |
| 6131 | -C "error" |
| 6132 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6133 | # With the MFL extension, the server has no way of forcing |
| 6134 | # the client to not exceed a certain MTU; hence, the following |
| 6135 | # test can't be replicated with an MTU proxy such as the one |
| 6136 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6137 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6138 | requires_config_enabled MBEDTLS_RSA_C |
| 6139 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6140 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6141 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6142 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6143 | crt_file=data_files/server7_int-ca.crt \ |
| 6144 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6145 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6146 | max_frag_len=512" \ |
| 6147 | "$P_CLI dtls=1 debug_level=2 \ |
| 6148 | crt_file=data_files/server8_int-ca2.crt \ |
| 6149 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6150 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6151 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6152 | 0 \ |
| 6153 | -S "found fragmented DTLS handshake message" \ |
| 6154 | -c "found fragmented DTLS handshake message" \ |
| 6155 | -C "error" |
| 6156 | |
| 6157 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6158 | requires_config_enabled MBEDTLS_RSA_C |
| 6159 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6160 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6161 | 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] | 6162 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6163 | crt_file=data_files/server7_int-ca.crt \ |
| 6164 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6165 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6166 | max_frag_len=2048" \ |
| 6167 | "$P_CLI dtls=1 debug_level=2 \ |
| 6168 | crt_file=data_files/server8_int-ca2.crt \ |
| 6169 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6170 | hs_timeout=2500-60000 \ |
| 6171 | max_frag_len=1024" \ |
| 6172 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6173 | -S "found fragmented DTLS handshake message" \ |
| 6174 | -c "found fragmented DTLS handshake message" \ |
| 6175 | -C "error" |
| 6176 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6177 | # While not required by the standard defining the MFL extension |
| 6178 | # (according to which it only applies to records, not to datagrams), |
| 6179 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6180 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6181 | # to the peer. |
| 6182 | # The next test checks that no datagrams significantly larger than the |
| 6183 | # negotiated MFL are sent. |
| 6184 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6185 | requires_config_enabled MBEDTLS_RSA_C |
| 6186 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6187 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6188 | 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] | 6189 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6190 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6191 | crt_file=data_files/server7_int-ca.crt \ |
| 6192 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6193 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6194 | max_frag_len=2048" \ |
| 6195 | "$P_CLI dtls=1 debug_level=2 \ |
| 6196 | crt_file=data_files/server8_int-ca2.crt \ |
| 6197 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6198 | hs_timeout=2500-60000 \ |
| 6199 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6200 | 0 \ |
| 6201 | -S "found fragmented DTLS handshake message" \ |
| 6202 | -c "found fragmented DTLS handshake message" \ |
| 6203 | -C "error" |
| 6204 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6205 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6206 | requires_config_enabled MBEDTLS_RSA_C |
| 6207 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6208 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6209 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6210 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6211 | crt_file=data_files/server7_int-ca.crt \ |
| 6212 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6213 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6214 | max_frag_len=2048" \ |
| 6215 | "$P_CLI dtls=1 debug_level=2 \ |
| 6216 | crt_file=data_files/server8_int-ca2.crt \ |
| 6217 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6218 | hs_timeout=2500-60000 \ |
| 6219 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6220 | 0 \ |
| 6221 | -s "found fragmented DTLS handshake message" \ |
| 6222 | -c "found fragmented DTLS handshake message" \ |
| 6223 | -C "error" |
| 6224 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6225 | # While not required by the standard defining the MFL extension |
| 6226 | # (according to which it only applies to records, not to datagrams), |
| 6227 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6228 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6229 | # to the peer. |
| 6230 | # The next test checks that no datagrams significantly larger than the |
| 6231 | # negotiated MFL are sent. |
| 6232 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6233 | requires_config_enabled MBEDTLS_RSA_C |
| 6234 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6235 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6236 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6237 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6238 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6239 | crt_file=data_files/server7_int-ca.crt \ |
| 6240 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6241 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6242 | max_frag_len=2048" \ |
| 6243 | "$P_CLI dtls=1 debug_level=2 \ |
| 6244 | crt_file=data_files/server8_int-ca2.crt \ |
| 6245 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6246 | hs_timeout=2500-60000 \ |
| 6247 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6248 | 0 \ |
| 6249 | -s "found fragmented DTLS handshake message" \ |
| 6250 | -c "found fragmented DTLS handshake message" \ |
| 6251 | -C "error" |
| 6252 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6253 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6254 | requires_config_enabled MBEDTLS_RSA_C |
| 6255 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6256 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6257 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6258 | crt_file=data_files/server7_int-ca.crt \ |
| 6259 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6260 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6261 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6262 | "$P_CLI dtls=1 debug_level=2 \ |
| 6263 | crt_file=data_files/server8_int-ca2.crt \ |
| 6264 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6265 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6266 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6267 | 0 \ |
| 6268 | -S "found fragmented DTLS handshake message" \ |
| 6269 | -C "found fragmented DTLS handshake message" \ |
| 6270 | -C "error" |
| 6271 | |
| 6272 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6273 | requires_config_enabled MBEDTLS_RSA_C |
| 6274 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6275 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6276 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6277 | crt_file=data_files/server7_int-ca.crt \ |
| 6278 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6279 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6280 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6281 | "$P_CLI dtls=1 debug_level=2 \ |
| 6282 | crt_file=data_files/server8_int-ca2.crt \ |
| 6283 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6284 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6285 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6286 | 0 \ |
| 6287 | -s "found fragmented DTLS handshake message" \ |
| 6288 | -C "found fragmented DTLS handshake message" \ |
| 6289 | -C "error" |
| 6290 | |
| 6291 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6292 | requires_config_enabled MBEDTLS_RSA_C |
| 6293 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6294 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6295 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6296 | crt_file=data_files/server7_int-ca.crt \ |
| 6297 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6298 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6299 | mtu=512" \ |
| 6300 | "$P_CLI dtls=1 debug_level=2 \ |
| 6301 | crt_file=data_files/server8_int-ca2.crt \ |
| 6302 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6303 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6304 | mtu=2048" \ |
| 6305 | 0 \ |
| 6306 | -S "found fragmented DTLS handshake message" \ |
| 6307 | -c "found fragmented DTLS handshake message" \ |
| 6308 | -C "error" |
| 6309 | |
| 6310 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6311 | requires_config_enabled MBEDTLS_RSA_C |
| 6312 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6313 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6314 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6315 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6316 | crt_file=data_files/server7_int-ca.crt \ |
| 6317 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6318 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6319 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6320 | "$P_CLI dtls=1 debug_level=2 \ |
| 6321 | crt_file=data_files/server8_int-ca2.crt \ |
| 6322 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6323 | hs_timeout=2500-60000 \ |
| 6324 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6325 | 0 \ |
| 6326 | -s "found fragmented DTLS handshake message" \ |
| 6327 | -c "found fragmented DTLS handshake message" \ |
| 6328 | -C "error" |
| 6329 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6330 | # 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] | 6331 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6332 | requires_config_enabled MBEDTLS_RSA_C |
| 6333 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6334 | requires_config_enabled MBEDTLS_SHA256_C |
| 6335 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6336 | requires_config_enabled MBEDTLS_AES_C |
| 6337 | requires_config_enabled MBEDTLS_GCM_C |
| 6338 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6339 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6340 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6341 | crt_file=data_files/server7_int-ca.crt \ |
| 6342 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6343 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6344 | mtu=512" \ |
| 6345 | "$P_CLI dtls=1 debug_level=2 \ |
| 6346 | crt_file=data_files/server8_int-ca2.crt \ |
| 6347 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6348 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6349 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6350 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6351 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6352 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6353 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6354 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6355 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6356 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6357 | # 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] | 6358 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 6359 | # retransmissions, but in some cases (like both the server and client using |
| 6360 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 6361 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 6362 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6363 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6364 | requires_config_enabled MBEDTLS_RSA_C |
| 6365 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6366 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6367 | requires_config_enabled MBEDTLS_AES_C |
| 6368 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6369 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6370 | -p "$P_PXY mtu=508" \ |
| 6371 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6372 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6373 | key_file=data_files/server7.key \ |
| 6374 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6375 | "$P_CLI dtls=1 debug_level=2 \ |
| 6376 | crt_file=data_files/server8_int-ca2.crt \ |
| 6377 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6378 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6379 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6380 | 0 \ |
| 6381 | -s "found fragmented DTLS handshake message" \ |
| 6382 | -c "found fragmented DTLS handshake message" \ |
| 6383 | -C "error" |
| 6384 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6385 | # 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] | 6386 | only_with_valgrind |
| 6387 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6388 | requires_config_enabled MBEDTLS_RSA_C |
| 6389 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6390 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6391 | requires_config_enabled MBEDTLS_AES_C |
| 6392 | requires_config_enabled MBEDTLS_GCM_C |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6393 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6394 | -p "$P_PXY mtu=508" \ |
| 6395 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6396 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6397 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6398 | hs_timeout=250-10000" \ |
| 6399 | "$P_CLI dtls=1 debug_level=2 \ |
| 6400 | crt_file=data_files/server8_int-ca2.crt \ |
| 6401 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6402 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6403 | hs_timeout=250-10000" \ |
| 6404 | 0 \ |
| 6405 | -s "found fragmented DTLS handshake message" \ |
| 6406 | -c "found fragmented DTLS handshake message" \ |
| 6407 | -C "error" |
| 6408 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6409 | # 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] | 6410 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6411 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6412 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6413 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6414 | requires_config_enabled MBEDTLS_RSA_C |
| 6415 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6416 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6417 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6418 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6419 | crt_file=data_files/server7_int-ca.crt \ |
| 6420 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6421 | hs_timeout=10000-60000 \ |
| 6422 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6423 | "$P_CLI dtls=1 debug_level=2 \ |
| 6424 | crt_file=data_files/server8_int-ca2.crt \ |
| 6425 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6426 | hs_timeout=10000-60000 \ |
| 6427 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6428 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6429 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6430 | -s "found fragmented DTLS handshake message" \ |
| 6431 | -c "found fragmented DTLS handshake message" \ |
| 6432 | -C "error" |
| 6433 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6434 | # 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] | 6435 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 6436 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6437 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6438 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6439 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6440 | requires_config_enabled MBEDTLS_RSA_C |
| 6441 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6442 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6443 | requires_config_enabled MBEDTLS_AES_C |
| 6444 | requires_config_enabled MBEDTLS_GCM_C |
| 6445 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6446 | -p "$P_PXY mtu=512" \ |
| 6447 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6448 | crt_file=data_files/server7_int-ca.crt \ |
| 6449 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6450 | hs_timeout=10000-60000 \ |
| 6451 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6452 | "$P_CLI dtls=1 debug_level=2 \ |
| 6453 | crt_file=data_files/server8_int-ca2.crt \ |
| 6454 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6455 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6456 | hs_timeout=10000-60000 \ |
| 6457 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6458 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6459 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6460 | -s "found fragmented DTLS handshake message" \ |
| 6461 | -c "found fragmented DTLS handshake message" \ |
| 6462 | -C "error" |
| 6463 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6464 | not_with_valgrind # spurious autoreduction due to timeout |
| 6465 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6466 | requires_config_enabled MBEDTLS_RSA_C |
| 6467 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6468 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6469 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6470 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6471 | crt_file=data_files/server7_int-ca.crt \ |
| 6472 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6473 | hs_timeout=10000-60000 \ |
| 6474 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6475 | "$P_CLI dtls=1 debug_level=2 \ |
| 6476 | crt_file=data_files/server8_int-ca2.crt \ |
| 6477 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6478 | hs_timeout=10000-60000 \ |
| 6479 | mtu=1024 nbio=2" \ |
| 6480 | 0 \ |
| 6481 | -S "autoreduction" \ |
| 6482 | -s "found fragmented DTLS handshake message" \ |
| 6483 | -c "found fragmented DTLS handshake message" \ |
| 6484 | -C "error" |
| 6485 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6486 | # 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] | 6487 | not_with_valgrind # spurious autoreduction due to timeout |
| 6488 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6489 | requires_config_enabled MBEDTLS_RSA_C |
| 6490 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6491 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6492 | requires_config_enabled MBEDTLS_AES_C |
| 6493 | requires_config_enabled MBEDTLS_GCM_C |
| 6494 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 6495 | -p "$P_PXY mtu=512" \ |
| 6496 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6497 | crt_file=data_files/server7_int-ca.crt \ |
| 6498 | key_file=data_files/server7.key \ |
| 6499 | hs_timeout=10000-60000 \ |
| 6500 | mtu=512 nbio=2" \ |
| 6501 | "$P_CLI dtls=1 debug_level=2 \ |
| 6502 | crt_file=data_files/server8_int-ca2.crt \ |
| 6503 | key_file=data_files/server8.key \ |
| 6504 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6505 | hs_timeout=10000-60000 \ |
| 6506 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6507 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6508 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6509 | -s "found fragmented DTLS handshake message" \ |
| 6510 | -c "found fragmented DTLS handshake message" \ |
| 6511 | -C "error" |
| 6512 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6513 | # 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] | 6514 | # This ensures things still work after session_reset(). |
| 6515 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6516 | # Since we don't support reading fragmented ClientHello yet, |
| 6517 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 6518 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6519 | # An autoreduction on the client-side might happen if the server is |
| 6520 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6521 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6522 | # resumed listening, which would result in a spurious autoreduction. |
| 6523 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6524 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6525 | requires_config_enabled MBEDTLS_RSA_C |
| 6526 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6527 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6528 | requires_config_enabled MBEDTLS_AES_C |
| 6529 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6530 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 6531 | -p "$P_PXY mtu=1450" \ |
| 6532 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6533 | crt_file=data_files/server7_int-ca.crt \ |
| 6534 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6535 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6536 | mtu=1450" \ |
| 6537 | "$P_CLI dtls=1 debug_level=2 \ |
| 6538 | crt_file=data_files/server8_int-ca2.crt \ |
| 6539 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6540 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6541 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 6542 | 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] | 6543 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6544 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6545 | -s "found fragmented DTLS handshake message" \ |
| 6546 | -c "found fragmented DTLS handshake message" \ |
| 6547 | -C "error" |
| 6548 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6549 | # An autoreduction on the client-side might happen if the server is |
| 6550 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6551 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6552 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6553 | requires_config_enabled MBEDTLS_RSA_C |
| 6554 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6555 | requires_config_enabled MBEDTLS_SHA256_C |
| 6556 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6557 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6558 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 6559 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 6560 | -p "$P_PXY mtu=512" \ |
| 6561 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6562 | crt_file=data_files/server7_int-ca.crt \ |
| 6563 | key_file=data_files/server7.key \ |
| 6564 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6565 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6566 | mtu=512" \ |
| 6567 | "$P_CLI dtls=1 debug_level=2 \ |
| 6568 | crt_file=data_files/server8_int-ca2.crt \ |
| 6569 | key_file=data_files/server8.key \ |
| 6570 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6571 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6572 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6573 | mtu=512" \ |
| 6574 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6575 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6576 | -s "found fragmented DTLS handshake message" \ |
| 6577 | -c "found fragmented DTLS handshake message" \ |
| 6578 | -C "error" |
| 6579 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6580 | # An autoreduction on the client-side might happen if the server is |
| 6581 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6582 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6583 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6584 | requires_config_enabled MBEDTLS_RSA_C |
| 6585 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6586 | requires_config_enabled MBEDTLS_SHA256_C |
| 6587 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6588 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6589 | requires_config_enabled MBEDTLS_AES_C |
| 6590 | requires_config_enabled MBEDTLS_GCM_C |
| 6591 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 6592 | -p "$P_PXY mtu=512" \ |
| 6593 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6594 | crt_file=data_files/server7_int-ca.crt \ |
| 6595 | key_file=data_files/server7.key \ |
| 6596 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6597 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6598 | mtu=512" \ |
| 6599 | "$P_CLI dtls=1 debug_level=2 \ |
| 6600 | crt_file=data_files/server8_int-ca2.crt \ |
| 6601 | key_file=data_files/server8.key \ |
| 6602 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6603 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6604 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6605 | mtu=512" \ |
| 6606 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6607 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6608 | -s "found fragmented DTLS handshake message" \ |
| 6609 | -c "found fragmented DTLS handshake message" \ |
| 6610 | -C "error" |
| 6611 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6612 | # An autoreduction on the client-side might happen if the server is |
| 6613 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6614 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6615 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6616 | requires_config_enabled MBEDTLS_RSA_C |
| 6617 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6618 | requires_config_enabled MBEDTLS_SHA256_C |
| 6619 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6620 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6621 | requires_config_enabled MBEDTLS_AES_C |
| 6622 | requires_config_enabled MBEDTLS_CCM_C |
| 6623 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6624 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6625 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6626 | crt_file=data_files/server7_int-ca.crt \ |
| 6627 | key_file=data_files/server7.key \ |
| 6628 | exchanges=2 renegotiation=1 \ |
| 6629 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6630 | hs_timeout=10000-60000 \ |
| 6631 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6632 | "$P_CLI dtls=1 debug_level=2 \ |
| 6633 | crt_file=data_files/server8_int-ca2.crt \ |
| 6634 | key_file=data_files/server8.key \ |
| 6635 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6636 | hs_timeout=10000-60000 \ |
| 6637 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6638 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6639 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6640 | -s "found fragmented DTLS handshake message" \ |
| 6641 | -c "found fragmented DTLS handshake message" \ |
| 6642 | -C "error" |
| 6643 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6644 | # An autoreduction on the client-side might happen if the server is |
| 6645 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6646 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6647 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6648 | requires_config_enabled MBEDTLS_RSA_C |
| 6649 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6650 | requires_config_enabled MBEDTLS_SHA256_C |
| 6651 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6652 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6653 | requires_config_enabled MBEDTLS_AES_C |
| 6654 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6655 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 6656 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6657 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6658 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6659 | crt_file=data_files/server7_int-ca.crt \ |
| 6660 | key_file=data_files/server7.key \ |
| 6661 | exchanges=2 renegotiation=1 \ |
| 6662 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6663 | hs_timeout=10000-60000 \ |
| 6664 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6665 | "$P_CLI dtls=1 debug_level=2 \ |
| 6666 | crt_file=data_files/server8_int-ca2.crt \ |
| 6667 | key_file=data_files/server8.key \ |
| 6668 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6669 | hs_timeout=10000-60000 \ |
| 6670 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6671 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6672 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6673 | -s "found fragmented DTLS handshake message" \ |
| 6674 | -c "found fragmented DTLS handshake message" \ |
| 6675 | -C "error" |
| 6676 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6677 | # An autoreduction on the client-side might happen if the server is |
| 6678 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6679 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6680 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6681 | requires_config_enabled MBEDTLS_RSA_C |
| 6682 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6683 | requires_config_enabled MBEDTLS_SHA256_C |
| 6684 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6685 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6686 | requires_config_enabled MBEDTLS_AES_C |
| 6687 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6688 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6689 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6690 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6691 | crt_file=data_files/server7_int-ca.crt \ |
| 6692 | key_file=data_files/server7.key \ |
| 6693 | exchanges=2 renegotiation=1 \ |
| 6694 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6695 | hs_timeout=10000-60000 \ |
| 6696 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6697 | "$P_CLI dtls=1 debug_level=2 \ |
| 6698 | crt_file=data_files/server8_int-ca2.crt \ |
| 6699 | key_file=data_files/server8.key \ |
| 6700 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6701 | hs_timeout=10000-60000 \ |
| 6702 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6703 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6704 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6705 | -s "found fragmented DTLS handshake message" \ |
| 6706 | -c "found fragmented DTLS handshake message" \ |
| 6707 | -C "error" |
| 6708 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6709 | # 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] | 6710 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6711 | requires_config_enabled MBEDTLS_RSA_C |
| 6712 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6713 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6714 | requires_config_enabled MBEDTLS_AES_C |
| 6715 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6716 | client_needs_more_time 2 |
| 6717 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 6718 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6719 | "$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] | 6720 | crt_file=data_files/server7_int-ca.crt \ |
| 6721 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6722 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6723 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6724 | crt_file=data_files/server8_int-ca2.crt \ |
| 6725 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6726 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6727 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6728 | 0 \ |
| 6729 | -s "found fragmented DTLS handshake message" \ |
| 6730 | -c "found fragmented DTLS handshake message" \ |
| 6731 | -C "error" |
| 6732 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6733 | # 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] | 6734 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6735 | requires_config_enabled MBEDTLS_RSA_C |
| 6736 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6737 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6738 | requires_config_enabled MBEDTLS_AES_C |
| 6739 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6740 | client_needs_more_time 2 |
| 6741 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 6742 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 6743 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6744 | crt_file=data_files/server7_int-ca.crt \ |
| 6745 | key_file=data_files/server7.key \ |
| 6746 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6747 | "$P_CLI dtls=1 debug_level=2 \ |
| 6748 | crt_file=data_files/server8_int-ca2.crt \ |
| 6749 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6750 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6751 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6752 | 0 \ |
| 6753 | -s "found fragmented DTLS handshake message" \ |
| 6754 | -c "found fragmented DTLS handshake message" \ |
| 6755 | -C "error" |
| 6756 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6757 | # interop tests for DTLS fragmentating with reliable connection |
| 6758 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6759 | # here and below we just want to test that the we fragment in a way that |
| 6760 | # pleases other implementations, so we don't need the peer to fragment |
| 6761 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6762 | requires_config_enabled MBEDTLS_RSA_C |
| 6763 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6764 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6765 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6766 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 6767 | "$G_SRV -u" \ |
| 6768 | "$P_CLI dtls=1 debug_level=2 \ |
| 6769 | crt_file=data_files/server8_int-ca2.crt \ |
| 6770 | key_file=data_files/server8.key \ |
| 6771 | mtu=512 force_version=dtls1_2" \ |
| 6772 | 0 \ |
| 6773 | -c "fragmenting handshake message" \ |
| 6774 | -C "error" |
| 6775 | |
| 6776 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6777 | requires_config_enabled MBEDTLS_RSA_C |
| 6778 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6779 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6780 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6781 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 6782 | "$G_SRV -u" \ |
| 6783 | "$P_CLI dtls=1 debug_level=2 \ |
| 6784 | crt_file=data_files/server8_int-ca2.crt \ |
| 6785 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6786 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6787 | 0 \ |
| 6788 | -c "fragmenting handshake message" \ |
| 6789 | -C "error" |
| 6790 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6791 | # We use --insecure for the GnuTLS client because it expects |
| 6792 | # the hostname / IP it connects to to be the name used in the |
| 6793 | # certificate obtained from the server. Here, however, it |
| 6794 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 6795 | # as the server name in the certificate. This will make the |
| 6796 | # certifiate validation fail, but passing --insecure makes |
| 6797 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6798 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6799 | requires_config_enabled MBEDTLS_RSA_C |
| 6800 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6801 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6802 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6803 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6804 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6805 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6806 | crt_file=data_files/server7_int-ca.crt \ |
| 6807 | key_file=data_files/server7.key \ |
| 6808 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6809 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6810 | 0 \ |
| 6811 | -s "fragmenting handshake message" |
| 6812 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6813 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6814 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6815 | requires_config_enabled MBEDTLS_RSA_C |
| 6816 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6817 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6818 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6819 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6820 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6821 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6822 | crt_file=data_files/server7_int-ca.crt \ |
| 6823 | key_file=data_files/server7.key \ |
| 6824 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6825 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6826 | 0 \ |
| 6827 | -s "fragmenting handshake message" |
| 6828 | |
| 6829 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6830 | requires_config_enabled MBEDTLS_RSA_C |
| 6831 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6832 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6833 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 6834 | "$O_SRV -dtls1_2 -verify 10" \ |
| 6835 | "$P_CLI dtls=1 debug_level=2 \ |
| 6836 | crt_file=data_files/server8_int-ca2.crt \ |
| 6837 | key_file=data_files/server8.key \ |
| 6838 | mtu=512 force_version=dtls1_2" \ |
| 6839 | 0 \ |
| 6840 | -c "fragmenting handshake message" \ |
| 6841 | -C "error" |
| 6842 | |
| 6843 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6844 | requires_config_enabled MBEDTLS_RSA_C |
| 6845 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6846 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6847 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 6848 | "$O_SRV -dtls1 -verify 10" \ |
| 6849 | "$P_CLI dtls=1 debug_level=2 \ |
| 6850 | crt_file=data_files/server8_int-ca2.crt \ |
| 6851 | key_file=data_files/server8.key \ |
| 6852 | mtu=512 force_version=dtls1" \ |
| 6853 | 0 \ |
| 6854 | -c "fragmenting handshake message" \ |
| 6855 | -C "error" |
| 6856 | |
| 6857 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6858 | requires_config_enabled MBEDTLS_RSA_C |
| 6859 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6860 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6861 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 6862 | "$P_SRV dtls=1 debug_level=2 \ |
| 6863 | crt_file=data_files/server7_int-ca.crt \ |
| 6864 | key_file=data_files/server7.key \ |
| 6865 | mtu=512 force_version=dtls1_2" \ |
| 6866 | "$O_CLI -dtls1_2" \ |
| 6867 | 0 \ |
| 6868 | -s "fragmenting handshake message" |
| 6869 | |
| 6870 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6871 | requires_config_enabled MBEDTLS_RSA_C |
| 6872 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6873 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6874 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 6875 | "$P_SRV dtls=1 debug_level=2 \ |
| 6876 | crt_file=data_files/server7_int-ca.crt \ |
| 6877 | key_file=data_files/server7.key \ |
| 6878 | mtu=512 force_version=dtls1" \ |
| 6879 | "$O_CLI -dtls1" \ |
| 6880 | 0 \ |
| 6881 | -s "fragmenting handshake message" |
| 6882 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6883 | # interop tests for DTLS fragmentating with unreliable connection |
| 6884 | # |
| 6885 | # again we just want to test that the we fragment in a way that |
| 6886 | # pleases other implementations, so we don't need the peer to fragment |
| 6887 | requires_gnutls_next |
| 6888 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6889 | requires_config_enabled MBEDTLS_RSA_C |
| 6890 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6891 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6892 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6893 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 6894 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6895 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6896 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6897 | crt_file=data_files/server8_int-ca2.crt \ |
| 6898 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6899 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6900 | 0 \ |
| 6901 | -c "fragmenting handshake message" \ |
| 6902 | -C "error" |
| 6903 | |
| 6904 | requires_gnutls_next |
| 6905 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6906 | requires_config_enabled MBEDTLS_RSA_C |
| 6907 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6908 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6909 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6910 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 6911 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6912 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6913 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6914 | crt_file=data_files/server8_int-ca2.crt \ |
| 6915 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6916 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6917 | 0 \ |
| 6918 | -c "fragmenting handshake message" \ |
| 6919 | -C "error" |
| 6920 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6921 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6922 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6923 | requires_config_enabled MBEDTLS_RSA_C |
| 6924 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6925 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6926 | client_needs_more_time 4 |
| 6927 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 6928 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6929 | "$P_SRV dtls=1 debug_level=2 \ |
| 6930 | crt_file=data_files/server7_int-ca.crt \ |
| 6931 | key_file=data_files/server7.key \ |
| 6932 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6933 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6934 | 0 \ |
| 6935 | -s "fragmenting handshake message" |
| 6936 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6937 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6938 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6939 | requires_config_enabled MBEDTLS_RSA_C |
| 6940 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6941 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6942 | client_needs_more_time 4 |
| 6943 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 6944 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6945 | "$P_SRV dtls=1 debug_level=2 \ |
| 6946 | crt_file=data_files/server7_int-ca.crt \ |
| 6947 | key_file=data_files/server7.key \ |
| 6948 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6949 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6950 | 0 \ |
| 6951 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6952 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6953 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 6954 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6955 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6956 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 6957 | ## (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] | 6958 | skip_next_test |
| 6959 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6960 | requires_config_enabled MBEDTLS_RSA_C |
| 6961 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6963 | client_needs_more_time 4 |
| 6964 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 6965 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6966 | "$O_SRV -dtls1_2 -verify 10" \ |
| 6967 | "$P_CLI dtls=1 debug_level=2 \ |
| 6968 | crt_file=data_files/server8_int-ca2.crt \ |
| 6969 | key_file=data_files/server8.key \ |
| 6970 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 6971 | 0 \ |
| 6972 | -c "fragmenting handshake message" \ |
| 6973 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6974 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6975 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6976 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6977 | requires_config_enabled MBEDTLS_RSA_C |
| 6978 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6979 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6980 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6981 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 6982 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6983 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6984 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6985 | crt_file=data_files/server8_int-ca2.crt \ |
| 6986 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6987 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6988 | 0 \ |
| 6989 | -c "fragmenting handshake message" \ |
| 6990 | -C "error" |
| 6991 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6992 | skip_next_test |
| 6993 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6994 | requires_config_enabled MBEDTLS_RSA_C |
| 6995 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6996 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6997 | client_needs_more_time 4 |
| 6998 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 6999 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7000 | "$P_SRV dtls=1 debug_level=2 \ |
| 7001 | crt_file=data_files/server7_int-ca.crt \ |
| 7002 | key_file=data_files/server7.key \ |
| 7003 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7004 | "$O_CLI -dtls1_2" \ |
| 7005 | 0 \ |
| 7006 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7007 | |
| 7008 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 7009 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7010 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7011 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7012 | requires_config_enabled MBEDTLS_RSA_C |
| 7013 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7014 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7015 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7016 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 7017 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7018 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7019 | crt_file=data_files/server7_int-ca.crt \ |
| 7020 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7021 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7022 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7023 | 0 \ |
| 7024 | -s "fragmenting handshake message" |
| 7025 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7026 | # Tests for specific things with "unreliable" UDP connection |
| 7027 | |
| 7028 | not_with_valgrind # spurious resend due to timeout |
| 7029 | run_test "DTLS proxy: reference" \ |
| 7030 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7031 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 7032 | "$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] | 7033 | 0 \ |
| 7034 | -C "replayed record" \ |
| 7035 | -S "replayed record" \ |
| 7036 | -C "record from another epoch" \ |
| 7037 | -S "record from another epoch" \ |
| 7038 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7039 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7040 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7041 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7042 | -c "HTTP/1.0 200 OK" |
| 7043 | |
| 7044 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7045 | run_test "DTLS proxy: duplicate every packet" \ |
| 7046 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7047 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 7048 | "$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] | 7049 | 0 \ |
| 7050 | -c "replayed record" \ |
| 7051 | -s "replayed record" \ |
| 7052 | -c "record from another epoch" \ |
| 7053 | -s "record from another epoch" \ |
| 7054 | -S "resend" \ |
| 7055 | -s "Extra-header:" \ |
| 7056 | -c "HTTP/1.0 200 OK" |
| 7057 | |
| 7058 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 7059 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7060 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 7061 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7062 | 0 \ |
| 7063 | -c "replayed record" \ |
| 7064 | -S "replayed record" \ |
| 7065 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7066 | -s "record from another epoch" \ |
| 7067 | -c "resend" \ |
| 7068 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7069 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7070 | -c "HTTP/1.0 200 OK" |
| 7071 | |
| 7072 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 7073 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7074 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7075 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7076 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7077 | -c "next record in same datagram" \ |
| 7078 | -s "next record in same datagram" |
| 7079 | |
| 7080 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 7081 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7082 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7083 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7084 | 0 \ |
| 7085 | -c "next record in same datagram" \ |
| 7086 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7087 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7088 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 7089 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7090 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 7091 | "$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] | 7092 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7093 | -c "discarding invalid record (mac)" \ |
| 7094 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7095 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7096 | -c "HTTP/1.0 200 OK" \ |
| 7097 | -S "too many records with bad MAC" \ |
| 7098 | -S "Verification of the message MAC failed" |
| 7099 | |
| 7100 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 7101 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7102 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 7103 | "$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] | 7104 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7105 | -C "discarding invalid record (mac)" \ |
| 7106 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7107 | -S "Extra-header:" \ |
| 7108 | -C "HTTP/1.0 200 OK" \ |
| 7109 | -s "too many records with bad MAC" \ |
| 7110 | -s "Verification of the message MAC failed" |
| 7111 | |
| 7112 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 7113 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7114 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 7115 | "$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] | 7116 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7117 | -c "discarding invalid record (mac)" \ |
| 7118 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7119 | -s "Extra-header:" \ |
| 7120 | -c "HTTP/1.0 200 OK" \ |
| 7121 | -S "too many records with bad MAC" \ |
| 7122 | -S "Verification of the message MAC failed" |
| 7123 | |
| 7124 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 7125 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7126 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 7127 | "$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] | 7128 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7129 | -c "discarding invalid record (mac)" \ |
| 7130 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7131 | -s "Extra-header:" \ |
| 7132 | -c "HTTP/1.0 200 OK" \ |
| 7133 | -s "too many records with bad MAC" \ |
| 7134 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7135 | |
| 7136 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 7137 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 7138 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 7139 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7140 | 0 \ |
| 7141 | -c "record from another epoch" \ |
| 7142 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7143 | -s "Extra-header:" \ |
| 7144 | -c "HTTP/1.0 200 OK" |
| 7145 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7146 | # Tests for reordering support with DTLS |
| 7147 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7148 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 7149 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7150 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7151 | hs_timeout=2500-60000" \ |
| 7152 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7153 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7154 | 0 \ |
| 7155 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7156 | -c "Next handshake message has been buffered - load"\ |
| 7157 | -S "Buffering HS message" \ |
| 7158 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7159 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7160 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7161 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7162 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7163 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7164 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 7165 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7166 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7167 | hs_timeout=2500-60000" \ |
| 7168 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7169 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7170 | 0 \ |
| 7171 | -c "Buffering HS message" \ |
| 7172 | -c "found fragmented DTLS handshake message"\ |
| 7173 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 7174 | -c "Next handshake message has been buffered - load"\ |
| 7175 | -S "Buffering HS message" \ |
| 7176 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7177 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7178 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7179 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7180 | -S "Remember CCS message" |
| 7181 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7182 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 7183 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 7184 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 7185 | # while keeping the ServerKeyExchange. |
| 7186 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 7187 | 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] | 7188 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7189 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7190 | hs_timeout=2500-60000" \ |
| 7191 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7192 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7193 | 0 \ |
| 7194 | -c "Buffering HS message" \ |
| 7195 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7196 | -C "attempt to make space by freeing buffered messages" \ |
| 7197 | -S "Buffering HS message" \ |
| 7198 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7199 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7200 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7201 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7202 | -S "Remember CCS message" |
| 7203 | |
| 7204 | # The size constraints ensure that the delayed certificate message can't |
| 7205 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 7206 | # when dropping it first. |
| 7207 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 7208 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 7209 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 7210 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7211 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7212 | hs_timeout=2500-60000" \ |
| 7213 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7214 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7215 | 0 \ |
| 7216 | -c "Buffering HS message" \ |
| 7217 | -c "attempt to make space by freeing buffered future messages" \ |
| 7218 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7219 | -S "Buffering HS message" \ |
| 7220 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7221 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7222 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7223 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7224 | -S "Remember CCS message" |
| 7225 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7226 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 7227 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7228 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 7229 | hs_timeout=2500-60000" \ |
| 7230 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7231 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7232 | 0 \ |
| 7233 | -C "Buffering HS message" \ |
| 7234 | -C "Next handshake message has been buffered - load"\ |
| 7235 | -s "Buffering HS message" \ |
| 7236 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7237 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7238 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7239 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7240 | -S "Remember CCS message" |
| 7241 | |
| 7242 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 7243 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7244 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7245 | hs_timeout=2500-60000" \ |
| 7246 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7247 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7248 | 0 \ |
| 7249 | -C "Buffering HS message" \ |
| 7250 | -C "Next handshake message has been buffered - load"\ |
| 7251 | -S "Buffering HS message" \ |
| 7252 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7253 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7254 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7255 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7256 | -S "Remember CCS message" |
| 7257 | |
| 7258 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 7259 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7260 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7261 | hs_timeout=2500-60000" \ |
| 7262 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7263 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7264 | 0 \ |
| 7265 | -C "Buffering HS message" \ |
| 7266 | -C "Next handshake message has been buffered - load"\ |
| 7267 | -S "Buffering HS message" \ |
| 7268 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7269 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7270 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7271 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7272 | -s "Remember CCS message" |
| 7273 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7274 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7275 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7276 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7277 | hs_timeout=2500-60000" \ |
| 7278 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7279 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 7280 | 0 \ |
| 7281 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7282 | -s "Found buffered record from current epoch - load" \ |
| 7283 | -c "Buffer record from epoch 1" \ |
| 7284 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7285 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7286 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 7287 | # from the server are delayed, so that the encrypted Finished message |
| 7288 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 7289 | # in afterwards, the encrypted Finished message must be freed in order |
| 7290 | # to make space for the NewSessionTicket to be reassembled. |
| 7291 | # This works only in very particular circumstances: |
| 7292 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 7293 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 7294 | # the encrypted Finished message. |
| 7295 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 7296 | # needs to be fragmented. |
| 7297 | # - All messages sent by the server must be small enough to be either sent |
| 7298 | # without fragmentation or be reassembled within the bounds of |
| 7299 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 7300 | # handshake, omitting CRTs. |
| 7301 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 |
| 7302 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 |
| 7303 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 7304 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
| 7305 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 7306 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 7307 | 0 \ |
| 7308 | -s "Buffer record from epoch 1" \ |
| 7309 | -s "Found buffered record from current epoch - load" \ |
| 7310 | -c "Buffer record from epoch 1" \ |
| 7311 | -C "Found buffered record from current epoch - load" \ |
| 7312 | -c "Enough space available after freeing future epoch record" |
| 7313 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 7314 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 7315 | |
| 7316 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7317 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 7318 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7319 | "$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] | 7320 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7321 | "$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] | 7322 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7323 | 0 \ |
| 7324 | -s "Extra-header:" \ |
| 7325 | -c "HTTP/1.0 200 OK" |
| 7326 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7327 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7328 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 7329 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7330 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7331 | "$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] | 7332 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7333 | 0 \ |
| 7334 | -s "Extra-header:" \ |
| 7335 | -c "HTTP/1.0 200 OK" |
| 7336 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7337 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7338 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 7339 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7340 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7341 | "$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] | 7342 | 0 \ |
| 7343 | -s "Extra-header:" \ |
| 7344 | -c "HTTP/1.0 200 OK" |
| 7345 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7346 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7347 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 7348 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7349 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 7350 | "$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] | 7351 | 0 \ |
| 7352 | -s "Extra-header:" \ |
| 7353 | -c "HTTP/1.0 200 OK" |
| 7354 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7355 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7356 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 7357 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7358 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 7359 | "$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] | 7360 | 0 \ |
| 7361 | -s "Extra-header:" \ |
| 7362 | -c "HTTP/1.0 200 OK" |
| 7363 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7364 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7365 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 7366 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7367 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 7368 | "$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] | 7369 | 0 \ |
| 7370 | -s "Extra-header:" \ |
| 7371 | -c "HTTP/1.0 200 OK" |
| 7372 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7373 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7374 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 7375 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7376 | "$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] | 7377 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7378 | "$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] | 7379 | 0 \ |
| 7380 | -s "Extra-header:" \ |
| 7381 | -c "HTTP/1.0 200 OK" |
| 7382 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7383 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 7384 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 7385 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7386 | "$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] | 7387 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7388 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7389 | 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] | 7390 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7391 | 0 \ |
| 7392 | -s "a session has been resumed" \ |
| 7393 | -c "a session has been resumed" \ |
| 7394 | -s "Extra-header:" \ |
| 7395 | -c "HTTP/1.0 200 OK" |
| 7396 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7397 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 7398 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 7399 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7400 | "$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] | 7401 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7402 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7403 | 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] | 7404 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 7405 | 0 \ |
| 7406 | -s "a session has been resumed" \ |
| 7407 | -c "a session has been resumed" \ |
| 7408 | -s "Extra-header:" \ |
| 7409 | -c "HTTP/1.0 200 OK" |
| 7410 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7411 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7412 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7413 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7414 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7415 | "$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] | 7416 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7417 | "$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] | 7418 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7419 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7420 | 0 \ |
| 7421 | -c "=> renegotiate" \ |
| 7422 | -s "=> renegotiate" \ |
| 7423 | -s "Extra-header:" \ |
| 7424 | -c "HTTP/1.0 200 OK" |
| 7425 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7426 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7427 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7428 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 7429 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7430 | "$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] | 7431 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7432 | "$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] | 7433 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7434 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7435 | 0 \ |
| 7436 | -c "=> renegotiate" \ |
| 7437 | -s "=> renegotiate" \ |
| 7438 | -s "Extra-header:" \ |
| 7439 | -c "HTTP/1.0 200 OK" |
| 7440 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7441 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7442 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7443 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 7444 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7445 | "$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] | 7446 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7447 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7448 | "$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] | 7449 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7450 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7451 | 0 \ |
| 7452 | -c "=> renegotiate" \ |
| 7453 | -s "=> renegotiate" \ |
| 7454 | -s "Extra-header:" \ |
| 7455 | -c "HTTP/1.0 200 OK" |
| 7456 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7457 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7458 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7459 | 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] | 7460 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7461 | "$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] | 7462 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7463 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7464 | "$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] | 7465 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7466 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7467 | 0 \ |
| 7468 | -c "=> renegotiate" \ |
| 7469 | -s "=> renegotiate" \ |
| 7470 | -s "Extra-header:" \ |
| 7471 | -c "HTTP/1.0 200 OK" |
| 7472 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7473 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 7474 | ## all versions installed on the CI machines), reported here: |
| 7475 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 7476 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7477 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 7478 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7479 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7480 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7481 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7482 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7483 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7484 | "$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] | 7485 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7486 | -c "HTTP/1.0 200 OK" |
| 7487 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7488 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7489 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7490 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7491 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 7492 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7493 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7494 | "$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] | 7495 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7496 | -c "HTTP/1.0 200 OK" |
| 7497 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7498 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7499 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7500 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7501 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 7502 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7503 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7504 | "$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] | 7505 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7506 | -c "HTTP/1.0 200 OK" |
| 7507 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 7508 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7509 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7510 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7511 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 7512 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 7513 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7514 | "$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] | 7515 | 0 \ |
| 7516 | -s "Extra-header:" \ |
| 7517 | -c "Extra-header:" |
| 7518 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7519 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7520 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7521 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7522 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 7523 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7524 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7525 | "$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] | 7526 | 0 \ |
| 7527 | -s "Extra-header:" \ |
| 7528 | -c "Extra-header:" |
| 7529 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7530 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7531 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7532 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7533 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 7534 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7535 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7536 | "$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] | 7537 | 0 \ |
| 7538 | -s "Extra-header:" \ |
| 7539 | -c "Extra-header:" |
| 7540 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 7541 | # Final report |
| 7542 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7543 | echo "------------------------------------------------------------------------" |
| 7544 | |
| 7545 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7546 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7547 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7548 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7549 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 7550 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 7551 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7552 | |
| 7553 | exit $FAILS |