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 | |
Paul Elliott | 19f1f78 | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 96 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 97 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 98 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 99 | else |
| 100 | O_NEXT_SRV=false |
| 101 | O_NEXT_CLI=false |
| 102 | fi |
| 103 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 104 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 105 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 106 | else |
| 107 | G_NEXT_SRV=false |
| 108 | fi |
| 109 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 110 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 111 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 112 | else |
| 113 | G_NEXT_CLI=false |
| 114 | fi |
| 115 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 116 | TESTS=0 |
| 117 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 118 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 119 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 120 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 121 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 122 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 123 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 124 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 125 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 126 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 127 | RUN_TEST_NUMBER='' |
| 128 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 129 | PRESERVE_LOGS=0 |
| 130 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 131 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 132 | # port which is this plus 10000. Each port number may be independently |
| 133 | # overridden by a command line option. |
| 134 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 135 | PXY_PORT=$((SRV_PORT + 10000)) |
| 136 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 137 | print_usage() { |
| 138 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 139 | printf " -h|--help\tPrint this help.\n" |
| 140 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | b7bb068b | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 141 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 142 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 143 | 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] | 144 | 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] | 145 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 146 | printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n" |
| 147 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 148 | 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] | 149 | } |
| 150 | |
| 151 | get_options() { |
| 152 | while [ $# -gt 0 ]; do |
| 153 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 154 | -f|--filter) |
| 155 | shift; FILTER=$1 |
| 156 | ;; |
| 157 | -e|--exclude) |
| 158 | shift; EXCLUDE=$1 |
| 159 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 160 | -m|--memcheck) |
| 161 | MEMCHECK=1 |
| 162 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 163 | -n|--number) |
| 164 | shift; RUN_TEST_NUMBER=$1 |
| 165 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 166 | -s|--show-numbers) |
| 167 | SHOW_TEST_NUMBER=1 |
| 168 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 169 | -p|--preserve-logs) |
| 170 | PRESERVE_LOGS=1 |
| 171 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 172 | --port) |
| 173 | shift; SRV_PORT=$1 |
| 174 | ;; |
| 175 | --proxy-port) |
| 176 | shift; PXY_PORT=$1 |
| 177 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 178 | --seed) |
| 179 | shift; SEED="$1" |
| 180 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 181 | -h|--help) |
| 182 | print_usage |
| 183 | exit 0 |
| 184 | ;; |
| 185 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 186 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 187 | print_usage |
| 188 | exit 1 |
| 189 | ;; |
| 190 | esac |
| 191 | shift |
| 192 | done |
| 193 | } |
| 194 | |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 195 | # Read boolean configuration options from config.h for easy and quick |
| 196 | # testing. Skip non-boolean options (with something other than spaces |
| 197 | # and a comment after "#define SYMBOL"). The variable contains a |
| 198 | # space-separated list of symbols. |
| 199 | CONFIGS_ENABLED=" $(<"$CONFIG_H" \ |
| 200 | sed -n 's!^ *#define *\([A-Za-z][0-9A-Z_a-z]*\) *\(/*\)*!\1!p' | |
| 201 | tr '\n' ' ')" |
| 202 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 203 | # Skip next test; use this macro to skip tests which are legitimate |
| 204 | # in theory and expected to be re-introduced at some point, but |
| 205 | # aren't expected to succeed at the moment due to problems outside |
| 206 | # our control (such as bugs in other TLS implementations). |
| 207 | skip_next_test() { |
| 208 | SKIP_NEXT="YES" |
| 209 | } |
| 210 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 211 | # skip next test if the flag is not enabled in config.h |
| 212 | requires_config_enabled() { |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 213 | case $CONFIGS_ENABLED in |
| 214 | *" $1 "*) :;; |
| 215 | *) SKIP_NEXT="YES";; |
| 216 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 217 | } |
| 218 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 219 | # skip next test if the flag is enabled in config.h |
| 220 | requires_config_disabled() { |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 221 | case $CONFIGS_ENABLED in |
| 222 | *" $1 "*) SKIP_NEXT="YES";; |
| 223 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 224 | } |
| 225 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 226 | get_config_value_or_default() { |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 227 | # This function uses the query_config command line option to query the |
| 228 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 229 | # program. The command will always return a success value if the |
| 230 | # configuration is defined and the value will be printed to stdout. |
| 231 | # |
| 232 | # Note that if the configuration is not defined or is defined to nothing, |
| 233 | # the output of this function will be an empty string. |
| 234 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 235 | } |
| 236 | |
| 237 | requires_config_value_at_least() { |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 238 | VAL="$( get_config_value_or_default "$1" )" |
| 239 | if [ -z "$VAL" ]; then |
| 240 | # Should never happen |
| 241 | echo "Mbed TLS configuration $1 is not defined" |
| 242 | exit 1 |
| 243 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 244 | SKIP_NEXT="YES" |
| 245 | fi |
| 246 | } |
| 247 | |
| 248 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 249 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 250 | if [ -z "$VAL" ]; then |
| 251 | # Should never happen |
| 252 | echo "Mbed TLS configuration $1 is not defined" |
| 253 | exit 1 |
| 254 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 255 | SKIP_NEXT="YES" |
| 256 | fi |
| 257 | } |
| 258 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 259 | requires_config_value_equals() { |
| 260 | VAL=$( get_config_value_or_default "$1" ) |
| 261 | if [ -z "$VAL" ]; then |
| 262 | # Should never happen |
| 263 | echo "Mbed TLS configuration $1 is not defined" |
| 264 | exit 1 |
| 265 | elif [ "$VAL" -ne "$2" ]; then |
| 266 | SKIP_NEXT="YES" |
| 267 | fi |
| 268 | } |
| 269 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 270 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 271 | requires_openssl_with_fallback_scsv() { |
| 272 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 273 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 274 | then |
| 275 | OPENSSL_HAS_FBSCSV="YES" |
| 276 | else |
| 277 | OPENSSL_HAS_FBSCSV="NO" |
| 278 | fi |
| 279 | fi |
| 280 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 281 | SKIP_NEXT="YES" |
| 282 | fi |
| 283 | } |
| 284 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 285 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 286 | requires_max_content_len() { |
| 287 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 288 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 289 | } |
| 290 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 291 | # skip next test if GnuTLS isn't available |
| 292 | requires_gnutls() { |
| 293 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 294 | 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] | 295 | GNUTLS_AVAILABLE="YES" |
| 296 | else |
| 297 | GNUTLS_AVAILABLE="NO" |
| 298 | fi |
| 299 | fi |
| 300 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 301 | SKIP_NEXT="YES" |
| 302 | fi |
| 303 | } |
| 304 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 305 | # skip next test if GnuTLS-next isn't available |
| 306 | requires_gnutls_next() { |
| 307 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 308 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 309 | GNUTLS_NEXT_AVAILABLE="YES" |
| 310 | else |
| 311 | GNUTLS_NEXT_AVAILABLE="NO" |
| 312 | fi |
| 313 | fi |
| 314 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 315 | SKIP_NEXT="YES" |
| 316 | fi |
| 317 | } |
| 318 | |
| 319 | # skip next test if OpenSSL-legacy isn't available |
| 320 | requires_openssl_legacy() { |
| 321 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 322 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 323 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 324 | else |
| 325 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 326 | fi |
| 327 | fi |
| 328 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 329 | SKIP_NEXT="YES" |
| 330 | fi |
| 331 | } |
| 332 | |
Paul Elliott | 19f1f78 | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 333 | requires_openssl_next() { |
| 334 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 335 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 336 | OPENSSL_NEXT_AVAILABLE="YES" |
| 337 | else |
| 338 | OPENSSL_NEXT_AVAILABLE="NO" |
| 339 | fi |
| 340 | fi |
| 341 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 342 | SKIP_NEXT="YES" |
| 343 | fi |
| 344 | } |
| 345 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 346 | # skip next test if IPv6 isn't available on this host |
| 347 | requires_ipv6() { |
| 348 | if [ -z "${HAS_IPV6:-}" ]; then |
| 349 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 350 | SRV_PID=$! |
| 351 | sleep 1 |
| 352 | kill $SRV_PID >/dev/null 2>&1 |
| 353 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 354 | HAS_IPV6="NO" |
| 355 | else |
| 356 | HAS_IPV6="YES" |
| 357 | fi |
| 358 | rm -r $SRV_OUT |
| 359 | fi |
| 360 | |
| 361 | if [ "$HAS_IPV6" = "NO" ]; then |
| 362 | SKIP_NEXT="YES" |
| 363 | fi |
| 364 | } |
| 365 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 366 | # skip next test if it's i686 or uname is not available |
| 367 | requires_not_i686() { |
| 368 | if [ -z "${IS_I686:-}" ]; then |
| 369 | IS_I686="YES" |
| 370 | if which "uname" >/dev/null 2>&1; then |
| 371 | if [ -z "$(uname -a | grep i686)" ]; then |
| 372 | IS_I686="NO" |
| 373 | fi |
| 374 | fi |
| 375 | fi |
| 376 | if [ "$IS_I686" = "YES" ]; then |
| 377 | SKIP_NEXT="YES" |
| 378 | fi |
| 379 | } |
| 380 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 381 | # Calculate the input & output maximum content lengths set in the config |
Yuto Takano | bbf657a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 382 | MAX_CONTENT_LEN=$( get_config_value_or_default "MBEDTLS_SSL_MAX_CONTENT_LEN" ) |
| 383 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 384 | 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] | 385 | |
Yuto Takano | 2e580ce | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 386 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 387 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 388 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 389 | fi |
| 390 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 391 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 392 | fi |
| 393 | |
| 394 | # skip the next test if the SSL output buffer is less than 16KB |
| 395 | requires_full_size_output_buffer() { |
| 396 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 397 | SKIP_NEXT="YES" |
| 398 | fi |
| 399 | } |
| 400 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 401 | # skip the next test if valgrind is in use |
| 402 | not_with_valgrind() { |
| 403 | if [ "$MEMCHECK" -gt 0 ]; then |
| 404 | SKIP_NEXT="YES" |
| 405 | fi |
| 406 | } |
| 407 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 408 | # skip the next test if valgrind is NOT in use |
| 409 | only_with_valgrind() { |
| 410 | if [ "$MEMCHECK" -eq 0 ]; then |
| 411 | SKIP_NEXT="YES" |
| 412 | fi |
| 413 | } |
| 414 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 415 | # 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] | 416 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 417 | CLI_DELAY_FACTOR=$1 |
| 418 | } |
| 419 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 420 | # wait for the given seconds after the client finished in the next test |
| 421 | server_needs_more_time() { |
| 422 | SRV_DELAY_SECONDS=$1 |
| 423 | } |
| 424 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 425 | # print_name <name> |
| 426 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 427 | TESTS=$(( $TESTS + 1 )) |
| 428 | LINE="" |
| 429 | |
| 430 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 431 | LINE="$TESTS " |
| 432 | fi |
| 433 | |
| 434 | LINE="$LINE$1" |
Gilles Peskine | ffdcadf | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 435 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 436 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 437 | for i in `seq 1 $LEN`; do printf '.'; done |
| 438 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 439 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 440 | } |
| 441 | |
| 442 | # fail <message> |
| 443 | fail() { |
| 444 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 445 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 446 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 447 | mv $SRV_OUT o-srv-${TESTS}.log |
| 448 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 449 | if [ -n "$PXY_CMD" ]; then |
| 450 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 451 | fi |
| 452 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 453 | |
Manuel Pégourié-Gonnard | e63fc6d | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 454 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 455 | echo " ! server output:" |
| 456 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 457 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 458 | echo " ! client output:" |
| 459 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 460 | if [ -n "$PXY_CMD" ]; then |
| 461 | echo " ! ========================================================" |
| 462 | echo " ! proxy output:" |
| 463 | cat o-pxy-${TESTS}.log |
| 464 | fi |
| 465 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 466 | fi |
| 467 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 468 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 469 | } |
| 470 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 471 | # is_polar <cmd_line> |
| 472 | is_polar() { |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 473 | case "$1" in |
| 474 | *ssl_client2*) true;; |
| 475 | *ssl_server2*) true;; |
| 476 | *) false;; |
| 477 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 478 | } |
| 479 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 480 | # openssl s_server doesn't have -www with DTLS |
| 481 | check_osrv_dtls() { |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 482 | case "$SRV_CMD" in |
| 483 | *s_server*-dtls*) |
| 484 | NEEDS_INPUT=1 |
| 485 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 486 | *) NEEDS_INPUT=0;; |
| 487 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 488 | } |
| 489 | |
| 490 | # provide input to commands that need it |
| 491 | provide_input() { |
| 492 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 493 | return |
| 494 | fi |
| 495 | |
| 496 | while true; do |
| 497 | echo "HTTP/1.0 200 OK" |
| 498 | sleep 1 |
| 499 | done |
| 500 | } |
| 501 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 502 | # has_mem_err <log_file_name> |
| 503 | has_mem_err() { |
| 504 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 505 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 506 | then |
| 507 | return 1 # false: does not have errors |
| 508 | else |
| 509 | return 0 # true: has errors |
| 510 | fi |
| 511 | } |
| 512 | |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 513 | # 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] | 514 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 515 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 516 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 517 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 518 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 519 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 520 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 521 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 522 | # Make a tight loop, server normally takes less than 1s to start. |
Paul Elliott | 355a1f4 | 2021-10-19 17:56:39 +0100 | [diff] [blame^] | 523 | while true; do |
| 524 | SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p | cut -c2-) |
| 525 | SERVER_FOUND=false |
| 526 | # When proxies are used, more than one PID can be listening on |
| 527 | # the same port. Each PID will be on its own line. |
| 528 | while read -r PID; do |
| 529 | if [[ $PID == $2 ]]; then |
| 530 | SERVER_FOUND=true |
| 531 | break |
| 532 | fi |
| 533 | done <<< "$SERVER_PIDS" |
| 534 | |
| 535 | if ($SERVER_FOUND == true); then |
| 536 | break |
| 537 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 538 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 539 | echo "$3 START TIMEOUT" |
| 540 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 541 | break |
| 542 | fi |
| 543 | # Linux and *BSD support decimal arguments to sleep. On other |
| 544 | # OSes this may be a tight loop. |
| 545 | sleep 0.1 2>/dev/null || true |
| 546 | done |
| 547 | } |
| 548 | else |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 549 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 550 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 551 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 552 | } |
| 553 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 554 | |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 555 | # Wait for server process $2 to be listening on port $1. |
| 556 | wait_server_start() { |
| 557 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 558 | } |
| 559 | |
| 560 | # Wait for proxy process $2 to be listening on port $1. |
| 561 | wait_proxy_start() { |
| 562 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 563 | } |
| 564 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 565 | # 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] | 566 | # 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] | 567 | # acceptable bounds |
| 568 | check_server_hello_time() { |
| 569 | # 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] | 570 | 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] | 571 | # Get the Unix timestamp for now |
| 572 | CUR_TIME=$(date +'%s') |
| 573 | THRESHOLD_IN_SECS=300 |
| 574 | |
| 575 | # Check if the ServerHello time was printed |
| 576 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 577 | return 1 |
| 578 | fi |
| 579 | |
| 580 | # Check the time in ServerHello is within acceptable bounds |
| 581 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 582 | # The time in ServerHello is at least 5 minutes before now |
| 583 | return 1 |
| 584 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 585 | # 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] | 586 | return 1 |
| 587 | else |
| 588 | return 0 |
| 589 | fi |
| 590 | } |
| 591 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 592 | # wait for client to terminate and set CLI_EXIT |
| 593 | # must be called right after starting the client |
| 594 | wait_client_done() { |
| 595 | CLI_PID=$! |
| 596 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 597 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 598 | CLI_DELAY_FACTOR=1 |
| 599 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 600 | ( 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] | 601 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 602 | |
| 603 | wait $CLI_PID |
| 604 | CLI_EXIT=$? |
| 605 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 606 | kill $DOG_PID >/dev/null 2>&1 |
| 607 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 608 | |
| 609 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 610 | |
| 611 | sleep $SRV_DELAY_SECONDS |
| 612 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 613 | } |
| 614 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 615 | # check if the given command uses dtls and sets global variable DTLS |
| 616 | detect_dtls() { |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 617 | case "$1" in |
Paul Elliott | 316a6aa | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 618 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 619 | *) DTLS=0;; |
| 620 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 621 | } |
| 622 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 623 | # 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] | 624 | # Options: -s pattern pattern that must be present in server output |
| 625 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 626 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 627 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 628 | # -S pattern pattern that must be absent in server output |
| 629 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 630 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 631 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 632 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 633 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 634 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 635 | |
Gilles Peskine | b7bb068b | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 636 | if is_excluded "$NAME"; then |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 637 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 638 | return |
| 639 | fi |
| 640 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 641 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 642 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 643 | # Do we only run numbered tests? |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 644 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 645 | case ",$RUN_TEST_NUMBER," in |
| 646 | *",$TESTS,"*) :;; |
| 647 | *) SKIP_NEXT="YES";; |
| 648 | esac |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 649 | fi |
| 650 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 651 | # should we skip? |
| 652 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 653 | SKIP_NEXT="NO" |
| 654 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 655 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 656 | return |
| 657 | fi |
| 658 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 659 | # does this test use a proxy? |
| 660 | if [ "X$1" = "X-p" ]; then |
| 661 | PXY_CMD="$2" |
| 662 | shift 2 |
| 663 | else |
| 664 | PXY_CMD="" |
| 665 | fi |
| 666 | |
| 667 | # get commands and client output |
| 668 | SRV_CMD="$1" |
| 669 | CLI_CMD="$2" |
| 670 | CLI_EXPECT="$3" |
| 671 | shift 3 |
| 672 | |
Hanno Becker | 7a11e72 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 673 | # Check if test uses files |
Gilles Peskine | 5bf15b6 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 674 | case "$SRV_CMD $CLI_CMD" in |
| 675 | *data_files/*) |
| 676 | requires_config_enabled MBEDTLS_FS_IO;; |
| 677 | esac |
Hanno Becker | 7a11e72 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 678 | |
| 679 | # should we skip? |
| 680 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 681 | SKIP_NEXT="NO" |
| 682 | echo "SKIP" |
| 683 | SKIPS=$(( $SKIPS + 1 )) |
| 684 | return |
| 685 | fi |
| 686 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 687 | # update DTLS variable |
| 688 | detect_dtls "$SRV_CMD" |
| 689 | |
Manuel Pégourié-Gonnard | fcf6c16 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 690 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 691 | # 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] | 692 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | fcf6c16 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 693 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 7442f84 | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 694 | case " $SRV_CMD " in |
| 695 | *' server_addr=::1 '*) |
| 696 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 697 | esac |
Manuel Pégourié-Gonnard | fcf6c16 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 698 | fi |
| 699 | |
Manuel Pégourié-Gonnard | bedcb3e | 2020-06-25 09:52:54 +0200 | [diff] [blame] | 700 | # fix client port |
| 701 | if [ -n "$PXY_CMD" ]; then |
| 702 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 703 | else |
| 704 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 705 | fi |
| 706 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 707 | # prepend valgrind to our commands if active |
| 708 | if [ "$MEMCHECK" -gt 0 ]; then |
| 709 | if is_polar "$SRV_CMD"; then |
| 710 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 711 | fi |
| 712 | if is_polar "$CLI_CMD"; then |
| 713 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 714 | fi |
| 715 | fi |
| 716 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 717 | TIMES_LEFT=2 |
| 718 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 719 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 720 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 721 | # run the commands |
| 722 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a1919ad | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 723 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 724 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 725 | PXY_PID=$! |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 726 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 727 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 728 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 729 | check_osrv_dtls |
Gilles Peskine | ffdcadf | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 730 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 731 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 732 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 733 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 734 | |
Gilles Peskine | ffdcadf | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 735 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 736 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 737 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 738 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 739 | sleep 0.05 |
| 740 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 741 | # terminate the server (and the proxy) |
| 742 | kill $SRV_PID |
| 743 | wait $SRV_PID |
Gilles Peskine | 634fe27 | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 744 | SRV_RET=$? |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 745 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 746 | if [ -n "$PXY_CMD" ]; then |
| 747 | kill $PXY_PID >/dev/null 2>&1 |
| 748 | wait $PXY_PID |
| 749 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 750 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 751 | # retry only on timeouts |
| 752 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 753 | printf "RETRY " |
| 754 | else |
| 755 | TIMES_LEFT=0 |
| 756 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 757 | done |
| 758 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 759 | # 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] | 760 | # (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] | 761 | # expected client exit to incorrectly succeed in case of catastrophic |
| 762 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 763 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 764 | 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] | 765 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 766 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 767 | return |
| 768 | fi |
| 769 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 770 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 771 | 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] | 772 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 773 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 774 | return |
| 775 | fi |
| 776 | fi |
| 777 | |
Gilles Peskine | 2cf44b6 | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 778 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 779 | # exit with status 0 when interrupted by a signal, and we don't really |
| 780 | # care anyway), in case e.g. the server reports a memory leak. |
| 781 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 634fe27 | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 782 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 783 | return |
| 784 | fi |
| 785 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 786 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 787 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 788 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 789 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 790 | 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] | 791 | return |
| 792 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 793 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 794 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 795 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 796 | # 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] | 797 | while [ $# -gt 0 ] |
| 798 | do |
| 799 | case $1 in |
| 800 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 801 | 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] | 802 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 803 | return |
| 804 | fi |
| 805 | ;; |
| 806 | |
| 807 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 808 | 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] | 809 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 810 | return |
| 811 | fi |
| 812 | ;; |
| 813 | |
| 814 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 815 | 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] | 816 | 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] | 817 | return |
| 818 | fi |
| 819 | ;; |
| 820 | |
| 821 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 822 | 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] | 823 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 824 | return |
| 825 | fi |
| 826 | ;; |
| 827 | |
| 828 | # The filtering in the following two options (-u and -U) do the following |
| 829 | # - ignore valgrind output |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 830 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 831 | # - keep one of each non-unique line |
| 832 | # - count how many lines remain |
| 833 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 834 | # if there were no duplicates. |
| 835 | "-U") |
| 836 | 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 |
| 837 | fail "lines following pattern '$2' must be unique in Server output" |
| 838 | return |
| 839 | fi |
| 840 | ;; |
| 841 | |
| 842 | "-u") |
| 843 | 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 |
| 844 | 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] | 845 | return |
| 846 | fi |
| 847 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 848 | "-F") |
| 849 | if ! $2 "$SRV_OUT"; then |
| 850 | fail "function call to '$2' failed on Server output" |
| 851 | return |
| 852 | fi |
| 853 | ;; |
| 854 | "-f") |
| 855 | if ! $2 "$CLI_OUT"; then |
| 856 | fail "function call to '$2' failed on Client output" |
| 857 | return |
| 858 | fi |
| 859 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 860 | |
| 861 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 862 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 863 | exit 1 |
| 864 | esac |
| 865 | shift 2 |
| 866 | done |
| 867 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 868 | # check valgrind's results |
| 869 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 870 | 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] | 871 | fail "Server has memory errors" |
| 872 | return |
| 873 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 874 | 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] | 875 | fail "Client has memory errors" |
| 876 | return |
| 877 | fi |
| 878 | fi |
| 879 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 880 | # if we're here, everything is ok |
| 881 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 882 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 883 | mv $SRV_OUT o-srv-${TESTS}.log |
| 884 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 885 | if [ -n "$PXY_CMD" ]; then |
| 886 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 887 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 888 | fi |
| 889 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 890 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 891 | } |
| 892 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 893 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 894 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 895 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 896 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 897 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 898 | 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] | 899 | exit 1 |
| 900 | } |
| 901 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 902 | # |
| 903 | # MAIN |
| 904 | # |
| 905 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 906 | get_options "$@" |
| 907 | |
Gilles Peskine | b7bb068b | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 908 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 909 | # patterns rather than regular expressions, use a case statement instead |
| 910 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 911 | # detects simple cases: plain substring, everything, nothing. |
| 912 | # |
| 913 | # As an exception, the character '.' is treated as an ordinary character |
| 914 | # if it is the only special character in the string. This is because it's |
| 915 | # rare to need "any one character", but needing a literal '.' is common |
| 916 | # (e.g. '-f "DTLS 1.2"'). |
| 917 | need_grep= |
| 918 | case "$FILTER" in |
| 919 | '^$') simple_filter=;; |
| 920 | '.*') simple_filter='*';; |
Gilles Peskine | c5714bb | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 921 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | b7bb068b | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 922 | need_grep=1;; |
| 923 | *) # No regexp or shell-pattern special character |
| 924 | simple_filter="*$FILTER*";; |
| 925 | esac |
| 926 | case "$EXCLUDE" in |
| 927 | '^$') simple_exclude=;; |
| 928 | '.*') simple_exclude='*';; |
Gilles Peskine | c5714bb | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 929 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | b7bb068b | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 930 | need_grep=1;; |
| 931 | *) # No regexp or shell-pattern special character |
| 932 | simple_exclude="*$EXCLUDE*";; |
| 933 | esac |
| 934 | if [ -n "$need_grep" ]; then |
| 935 | is_excluded () { |
| 936 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 937 | } |
| 938 | else |
| 939 | is_excluded () { |
| 940 | case "$1" in |
| 941 | $simple_exclude) true;; |
| 942 | $simple_filter) false;; |
| 943 | *) true;; |
| 944 | esac |
| 945 | } |
| 946 | fi |
| 947 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 948 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 949 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 950 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 951 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 952 | if [ ! -x "$P_SRV_BIN" ]; then |
| 953 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 954 | exit 1 |
| 955 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 956 | if [ ! -x "$P_CLI_BIN" ]; then |
| 957 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 958 | exit 1 |
| 959 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 960 | if [ ! -x "$P_PXY_BIN" ]; then |
| 961 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 962 | exit 1 |
| 963 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 964 | if [ "$MEMCHECK" -gt 0 ]; then |
| 965 | if which valgrind >/dev/null 2>&1; then :; else |
| 966 | echo "Memcheck not possible. Valgrind not found" |
| 967 | exit 1 |
| 968 | fi |
| 969 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 970 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 971 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 972 | exit 1 |
| 973 | fi |
| 974 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 975 | # used by watchdog |
| 976 | MAIN_PID="$$" |
| 977 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 978 | # We use somewhat arbitrary delays for tests: |
| 979 | # - how long do we wait for the server to start (when lsof not available)? |
| 980 | # - how long do we allow for the client to finish? |
| 981 | # (not to check performance, just to avoid waiting indefinitely) |
| 982 | # Things are slower with valgrind, so give extra time here. |
| 983 | # |
| 984 | # Note: without lsof, there is a trade-off between the running time of this |
| 985 | # script and the risk of spurious errors because we didn't wait long enough. |
| 986 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 987 | # 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] | 988 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 989 | START_DELAY=6 |
| 990 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 991 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 992 | START_DELAY=2 |
| 993 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 994 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 995 | |
| 996 | # some particular tests need more time: |
| 997 | # - for the client, we multiply the usual watchdog limit by a factor |
| 998 | # - for the server, we sleep for a number of seconds after the client exits |
| 999 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1000 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1001 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1002 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1003 | # 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] | 1004 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Paul Elliott | 0ab7941 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1005 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1006 | # machines that will resolve to ::1, and we don't want ipv6 here. |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1007 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1008 | 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] | 1009 | 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] | 1010 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0ab7941 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1011 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1012 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1013 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1014 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1015 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1016 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Paul Elliott | 0ab7941 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1017 | O_LEGACY_CLI="$O_LEGACY_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1018 | fi |
| 1019 | |
Paul Elliott | 19f1f78 | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 1020 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1021 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Paul Elliott | 0ab7941 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1022 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
Paul Elliott | 19f1f78 | 2021-10-13 18:31:07 +0100 | [diff] [blame] | 1023 | fi |
| 1024 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1025 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1026 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1027 | fi |
| 1028 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1029 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1030 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1031 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1032 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1033 | # Allow SHA-1, because many of our test certificates use it |
| 1034 | P_SRV="$P_SRV allow_sha1=1" |
| 1035 | P_CLI="$P_CLI allow_sha1=1" |
| 1036 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1037 | # Also pick a unique name for intermediate files |
| 1038 | SRV_OUT="srv_out.$$" |
| 1039 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1040 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1041 | SESSION="session.$$" |
| 1042 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1043 | SKIP_NEXT="NO" |
| 1044 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1045 | trap cleanup INT TERM HUP |
| 1046 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1047 | # Basic test |
| 1048 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1049 | # Checks that: |
| 1050 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 1051 | # - the expected (highest security) parameters are selected |
| 1052 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1053 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1054 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1055 | "$P_CLI" \ |
| 1056 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1057 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1058 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1059 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 1060 | -s "ECDHE curve: secp521r1" \ |
| 1061 | -S "error" \ |
| 1062 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1063 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1064 | run_test "Default, DTLS" \ |
| 1065 | "$P_SRV dtls=1" \ |
| 1066 | "$P_CLI dtls=1" \ |
| 1067 | 0 \ |
| 1068 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1069 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1070 | |
Manuel Pégourié-Gonnard | 95a17fb | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1071 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 1072 | run_test "Default (compression enabled)" \ |
| 1073 | "$P_SRV debug_level=3" \ |
| 1074 | "$P_CLI debug_level=3" \ |
| 1075 | 0 \ |
| 1076 | -s "Allocating compression buffer" \ |
| 1077 | -c "Allocating compression buffer" \ |
| 1078 | -s "Record expansion is unknown (compression)" \ |
| 1079 | -c "Record expansion is unknown (compression)" \ |
| 1080 | -S "error" \ |
| 1081 | -C "error" |
| 1082 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1083 | # Test current time in ServerHello |
| 1084 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1085 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1086 | "$P_SRV debug_level=3" \ |
| 1087 | "$P_CLI debug_level=3" \ |
| 1088 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1089 | -f "check_server_hello_time" \ |
| 1090 | -F "check_server_hello_time" |
| 1091 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1092 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1093 | run_test "Unique IV in GCM" \ |
| 1094 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1095 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1096 | 0 \ |
| 1097 | -u "IV used" \ |
| 1098 | -U "IV used" |
| 1099 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1100 | # Tests for rc4 option |
| 1101 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1102 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1103 | run_test "RC4: server disabled, client enabled" \ |
| 1104 | "$P_SRV" \ |
| 1105 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1106 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1107 | -s "SSL - The server has no ciphersuites in common" |
| 1108 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1109 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1110 | run_test "RC4: server half, client enabled" \ |
| 1111 | "$P_SRV arc4=1" \ |
| 1112 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1113 | 1 \ |
| 1114 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1115 | |
| 1116 | run_test "RC4: server enabled, client disabled" \ |
| 1117 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1118 | "$P_CLI" \ |
| 1119 | 1 \ |
| 1120 | -s "SSL - The server has no ciphersuites in common" |
| 1121 | |
| 1122 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1123 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1124 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1125 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1126 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1127 | -S "SSL - The server has no ciphersuites in common" |
| 1128 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1129 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1130 | |
| 1131 | requires_gnutls |
| 1132 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1133 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1134 | "$G_SRV"\ |
| 1135 | "$P_CLI force_version=tls1_1" \ |
| 1136 | 0 |
| 1137 | |
| 1138 | requires_gnutls |
| 1139 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1140 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1141 | "$G_SRV"\ |
| 1142 | "$P_CLI force_version=tls1" \ |
| 1143 | 0 |
| 1144 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1145 | # Tests for SHA-1 support |
| 1146 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1147 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1148 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1149 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1150 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1151 | 1 \ |
| 1152 | -c "The certificate is signed with an unacceptable hash" |
| 1153 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1154 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1155 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1156 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1157 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1158 | 0 |
| 1159 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1160 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1161 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1162 | "$P_CLI allow_sha1=1" \ |
| 1163 | 0 |
| 1164 | |
| 1165 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1166 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1167 | "$P_CLI allow_sha1=0" \ |
| 1168 | 0 |
| 1169 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1170 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1171 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1172 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1173 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1174 | 1 \ |
| 1175 | -s "The certificate is signed with an unacceptable hash" |
| 1176 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1177 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1178 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1179 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1180 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1181 | 0 |
| 1182 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1183 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1184 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1185 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1186 | 0 |
| 1187 | |
| 1188 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1189 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1190 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1191 | 0 |
| 1192 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1193 | # Tests for datagram packing |
| 1194 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1195 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1196 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1197 | 0 \ |
| 1198 | -c "next record in same datagram" \ |
| 1199 | -s "next record in same datagram" |
| 1200 | |
| 1201 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1202 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1203 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1204 | 0 \ |
| 1205 | -s "next record in same datagram" \ |
| 1206 | -C "next record in same datagram" |
| 1207 | |
| 1208 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1209 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1210 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1211 | 0 \ |
| 1212 | -S "next record in same datagram" \ |
| 1213 | -c "next record in same datagram" |
| 1214 | |
| 1215 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1216 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1217 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1218 | 0 \ |
| 1219 | -S "next record in same datagram" \ |
| 1220 | -C "next record in same datagram" |
| 1221 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1222 | # Tests for Truncated HMAC extension |
| 1223 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1224 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1225 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1226 | "$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] | 1227 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1228 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1229 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1230 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1231 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1232 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1233 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1234 | "$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] | 1235 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1236 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1237 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1238 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1239 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1240 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1241 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1242 | "$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] | 1243 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1244 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1245 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1246 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1247 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1248 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1249 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1250 | "$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] | 1251 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1252 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1253 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1254 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1255 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1256 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1257 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1258 | "$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] | 1259 | 0 \ |
| 1260 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1261 | -S "dumping 'expected mac' (10 bytes)" |
| 1262 | |
| 1263 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1264 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1265 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1266 | "$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] | 1267 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1268 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1269 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1270 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1271 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1272 | "$P_SRV dtls=1 debug_level=4" \ |
| 1273 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1274 | 0 \ |
| 1275 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1276 | -S "dumping 'expected mac' (10 bytes)" |
| 1277 | |
| 1278 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1279 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1280 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1281 | "$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] | 1282 | 0 \ |
| 1283 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1284 | -S "dumping 'expected mac' (10 bytes)" |
| 1285 | |
| 1286 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1287 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1288 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1289 | "$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] | 1290 | 0 \ |
| 1291 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1292 | -S "dumping 'expected mac' (10 bytes)" |
| 1293 | |
| 1294 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1295 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1296 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1297 | "$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] | 1298 | 0 \ |
| 1299 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1300 | -S "dumping 'expected mac' (10 bytes)" |
| 1301 | |
| 1302 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1303 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1304 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1305 | "$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] | 1306 | 0 \ |
| 1307 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1308 | -S "dumping 'expected mac' (10 bytes)" |
| 1309 | |
| 1310 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1311 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1312 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1313 | "$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] | 1314 | 0 \ |
| 1315 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1316 | -s "dumping 'expected mac' (10 bytes)" |
| 1317 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1318 | # Tests for Encrypt-then-MAC extension |
| 1319 | |
| 1320 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1321 | "$P_SRV debug_level=3 \ |
| 1322 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1323 | "$P_CLI debug_level=3" \ |
| 1324 | 0 \ |
| 1325 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1326 | -s "found encrypt then mac extension" \ |
| 1327 | -s "server hello, adding encrypt then mac extension" \ |
| 1328 | -c "found encrypt_then_mac extension" \ |
| 1329 | -c "using encrypt then mac" \ |
| 1330 | -s "using encrypt then mac" |
| 1331 | |
| 1332 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1333 | "$P_SRV debug_level=3 etm=0 \ |
| 1334 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1335 | "$P_CLI debug_level=3 etm=1" \ |
| 1336 | 0 \ |
| 1337 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1338 | -s "found encrypt then mac extension" \ |
| 1339 | -S "server hello, adding encrypt then mac extension" \ |
| 1340 | -C "found encrypt_then_mac extension" \ |
| 1341 | -C "using encrypt then mac" \ |
| 1342 | -S "using encrypt then mac" |
| 1343 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1344 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1345 | "$P_SRV debug_level=3 etm=1 \ |
| 1346 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1347 | "$P_CLI debug_level=3 etm=1" \ |
| 1348 | 0 \ |
| 1349 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1350 | -s "found encrypt then mac extension" \ |
| 1351 | -S "server hello, adding encrypt then mac extension" \ |
| 1352 | -C "found encrypt_then_mac extension" \ |
| 1353 | -C "using encrypt then mac" \ |
| 1354 | -S "using encrypt then mac" |
| 1355 | |
| 1356 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1357 | "$P_SRV debug_level=3 etm=1 \ |
| 1358 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1359 | "$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] | 1360 | 0 \ |
| 1361 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1362 | -s "found encrypt then mac extension" \ |
| 1363 | -S "server hello, adding encrypt then mac extension" \ |
| 1364 | -C "found encrypt_then_mac extension" \ |
| 1365 | -C "using encrypt then mac" \ |
| 1366 | -S "using encrypt then mac" |
| 1367 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1368 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1369 | "$P_SRV debug_level=3 etm=1 \ |
| 1370 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1371 | "$P_CLI debug_level=3 etm=0" \ |
| 1372 | 0 \ |
| 1373 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1374 | -S "found encrypt then mac extension" \ |
| 1375 | -S "server hello, adding encrypt then mac extension" \ |
| 1376 | -C "found encrypt_then_mac extension" \ |
| 1377 | -C "using encrypt then mac" \ |
| 1378 | -S "using encrypt then mac" |
| 1379 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1380 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1381 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1382 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1383 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1384 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1385 | 0 \ |
| 1386 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1387 | -S "found encrypt then mac extension" \ |
| 1388 | -S "server hello, adding encrypt then mac extension" \ |
| 1389 | -C "found encrypt_then_mac extension" \ |
| 1390 | -C "using encrypt then mac" \ |
| 1391 | -S "using encrypt then mac" |
| 1392 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1393 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1394 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1395 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1396 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1397 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1398 | 0 \ |
| 1399 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1400 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1401 | -S "server hello, adding encrypt then mac extension" \ |
| 1402 | -C "found encrypt_then_mac extension" \ |
| 1403 | -C "using encrypt then mac" \ |
| 1404 | -S "using encrypt then mac" |
| 1405 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1406 | # Tests for Extended Master Secret extension |
| 1407 | |
| 1408 | run_test "Extended Master Secret: default" \ |
| 1409 | "$P_SRV debug_level=3" \ |
| 1410 | "$P_CLI debug_level=3" \ |
| 1411 | 0 \ |
| 1412 | -c "client hello, adding extended_master_secret extension" \ |
| 1413 | -s "found extended master secret extension" \ |
| 1414 | -s "server hello, adding extended master secret extension" \ |
| 1415 | -c "found extended_master_secret extension" \ |
| 1416 | -c "using extended master secret" \ |
| 1417 | -s "using extended master secret" |
| 1418 | |
| 1419 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1420 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1421 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1422 | 0 \ |
| 1423 | -c "client hello, adding extended_master_secret extension" \ |
| 1424 | -s "found extended master secret extension" \ |
| 1425 | -S "server hello, adding extended master secret extension" \ |
| 1426 | -C "found extended_master_secret extension" \ |
| 1427 | -C "using extended master secret" \ |
| 1428 | -S "using extended master secret" |
| 1429 | |
| 1430 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1431 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1432 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1433 | 0 \ |
| 1434 | -C "client hello, adding extended_master_secret extension" \ |
| 1435 | -S "found extended master secret extension" \ |
| 1436 | -S "server hello, adding extended master secret extension" \ |
| 1437 | -C "found extended_master_secret extension" \ |
| 1438 | -C "using extended master secret" \ |
| 1439 | -S "using extended master secret" |
| 1440 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1441 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1442 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1443 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1444 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1445 | 0 \ |
| 1446 | -C "client hello, adding extended_master_secret extension" \ |
| 1447 | -S "found extended master secret extension" \ |
| 1448 | -S "server hello, adding extended master secret extension" \ |
| 1449 | -C "found extended_master_secret extension" \ |
| 1450 | -C "using extended master secret" \ |
| 1451 | -S "using extended master secret" |
| 1452 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1453 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1454 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1455 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1456 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1457 | 0 \ |
| 1458 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1459 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1460 | -S "server hello, adding extended master secret extension" \ |
| 1461 | -C "found extended_master_secret extension" \ |
| 1462 | -C "using extended master secret" \ |
| 1463 | -S "using extended master secret" |
| 1464 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1465 | # Tests for FALLBACK_SCSV |
| 1466 | |
| 1467 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1468 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1469 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1470 | 0 \ |
| 1471 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1472 | -S "received FALLBACK_SCSV" \ |
| 1473 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1474 | -C "is a fatal alert message (msg 86)" |
| 1475 | |
| 1476 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1477 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1478 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1479 | 0 \ |
| 1480 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1481 | -S "received FALLBACK_SCSV" \ |
| 1482 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1483 | -C "is a fatal alert message (msg 86)" |
| 1484 | |
| 1485 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1486 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1487 | "$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] | 1488 | 1 \ |
| 1489 | -c "adding FALLBACK_SCSV" \ |
| 1490 | -s "received FALLBACK_SCSV" \ |
| 1491 | -s "inapropriate fallback" \ |
| 1492 | -c "is a fatal alert message (msg 86)" |
| 1493 | |
| 1494 | run_test "Fallback SCSV: enabled, max version" \ |
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 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1497 | 0 \ |
| 1498 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1499 | -s "received FALLBACK_SCSV" \ |
| 1500 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1501 | -C "is a fatal alert message (msg 86)" |
| 1502 | |
| 1503 | requires_openssl_with_fallback_scsv |
| 1504 | run_test "Fallback SCSV: default, openssl server" \ |
| 1505 | "$O_SRV" \ |
| 1506 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1507 | 0 \ |
| 1508 | -C "adding FALLBACK_SCSV" \ |
| 1509 | -C "is a fatal alert message (msg 86)" |
| 1510 | |
| 1511 | requires_openssl_with_fallback_scsv |
| 1512 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1513 | "$O_SRV" \ |
| 1514 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1515 | 1 \ |
| 1516 | -c "adding FALLBACK_SCSV" \ |
| 1517 | -c "is a fatal alert message (msg 86)" |
| 1518 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1519 | requires_openssl_with_fallback_scsv |
| 1520 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1521 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1522 | "$O_CLI -tls1_1" \ |
| 1523 | 0 \ |
| 1524 | -S "received FALLBACK_SCSV" \ |
| 1525 | -S "inapropriate fallback" |
| 1526 | |
| 1527 | requires_openssl_with_fallback_scsv |
| 1528 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1529 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1530 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1531 | 1 \ |
| 1532 | -s "received FALLBACK_SCSV" \ |
| 1533 | -s "inapropriate fallback" |
| 1534 | |
| 1535 | requires_openssl_with_fallback_scsv |
| 1536 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1537 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1538 | "$O_CLI -fallback_scsv" \ |
| 1539 | 0 \ |
| 1540 | -s "received FALLBACK_SCSV" \ |
| 1541 | -S "inapropriate fallback" |
| 1542 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1543 | # Test sending and receiving empty application data records |
| 1544 | |
| 1545 | run_test "Encrypt then MAC: empty application data record" \ |
| 1546 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1547 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1548 | 0 \ |
| 1549 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1550 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1551 | -c "0 bytes written in 1 fragments" |
| 1552 | |
Manuel Pégourié-Gonnard | 98a879a | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 1553 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1554 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1555 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1556 | 0 \ |
| 1557 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1558 | -c "0 bytes written in 1 fragments" |
| 1559 | |
| 1560 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1561 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1562 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1563 | 0 \ |
| 1564 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1565 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1566 | -c "0 bytes written in 1 fragments" |
| 1567 | |
Manuel Pégourié-Gonnard | 98a879a | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 1568 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1569 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1570 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1571 | 0 \ |
| 1572 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1573 | -c "0 bytes written in 1 fragments" |
| 1574 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1575 | ## ClientHello generated with |
| 1576 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1577 | ## then manually twiddling the ciphersuite list. |
| 1578 | ## The ClientHello content is spelled out below as a hex string as |
| 1579 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1580 | ## The expected response is an inappropriate_fallback alert. |
| 1581 | requires_openssl_with_fallback_scsv |
| 1582 | run_test "Fallback SCSV: beginning of list" \ |
| 1583 | "$P_SRV debug_level=2" \ |
| 1584 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1585 | 0 \ |
| 1586 | -s "received FALLBACK_SCSV" \ |
| 1587 | -s "inapropriate fallback" |
| 1588 | |
| 1589 | requires_openssl_with_fallback_scsv |
| 1590 | run_test "Fallback SCSV: end of list" \ |
| 1591 | "$P_SRV debug_level=2" \ |
| 1592 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1593 | 0 \ |
| 1594 | -s "received FALLBACK_SCSV" \ |
| 1595 | -s "inapropriate fallback" |
| 1596 | |
| 1597 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1598 | requires_openssl_with_fallback_scsv |
| 1599 | run_test "Fallback SCSV: not in list" \ |
| 1600 | "$P_SRV debug_level=2" \ |
| 1601 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1602 | 0 \ |
| 1603 | -S "received FALLBACK_SCSV" \ |
| 1604 | -S "inapropriate fallback" |
| 1605 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1606 | # Tests for CBC 1/n-1 record splitting |
| 1607 | |
| 1608 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1609 | "$P_SRV" \ |
| 1610 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1611 | request_size=123 force_version=tls1_2" \ |
| 1612 | 0 \ |
| 1613 | -s "Read from client: 123 bytes read" \ |
| 1614 | -S "Read from client: 1 bytes read" \ |
| 1615 | -S "122 bytes read" |
| 1616 | |
| 1617 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1618 | "$P_SRV" \ |
| 1619 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1620 | request_size=123 force_version=tls1_1" \ |
| 1621 | 0 \ |
| 1622 | -s "Read from client: 123 bytes read" \ |
| 1623 | -S "Read from client: 1 bytes read" \ |
| 1624 | -S "122 bytes read" |
| 1625 | |
| 1626 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1627 | "$P_SRV" \ |
| 1628 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1629 | request_size=123 force_version=tls1" \ |
| 1630 | 0 \ |
| 1631 | -S "Read from client: 123 bytes read" \ |
| 1632 | -s "Read from client: 1 bytes read" \ |
| 1633 | -s "122 bytes read" |
| 1634 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1635 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1636 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1637 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1638 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1639 | request_size=123 force_version=ssl3" \ |
| 1640 | 0 \ |
| 1641 | -S "Read from client: 123 bytes read" \ |
| 1642 | -s "Read from client: 1 bytes read" \ |
| 1643 | -s "122 bytes read" |
| 1644 | |
| 1645 | 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] | 1646 | "$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] | 1647 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1648 | request_size=123 force_version=tls1" \ |
| 1649 | 0 \ |
| 1650 | -s "Read from client: 123 bytes read" \ |
| 1651 | -S "Read from client: 1 bytes read" \ |
| 1652 | -S "122 bytes read" |
| 1653 | |
| 1654 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1655 | "$P_SRV" \ |
| 1656 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1657 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1658 | 0 \ |
| 1659 | -s "Read from client: 123 bytes read" \ |
| 1660 | -S "Read from client: 1 bytes read" \ |
| 1661 | -S "122 bytes read" |
| 1662 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1663 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1664 | "$P_SRV nbio=2" \ |
| 1665 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1666 | request_size=123 force_version=tls1" \ |
| 1667 | 0 \ |
| 1668 | -S "Read from client: 123 bytes read" \ |
| 1669 | -s "Read from client: 1 bytes read" \ |
| 1670 | -s "122 bytes read" |
| 1671 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1672 | # Tests for Session Tickets |
| 1673 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1674 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1675 | "$P_SRV debug_level=3 tickets=1" \ |
| 1676 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1677 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1678 | -c "client hello, adding session ticket extension" \ |
| 1679 | -s "found session ticket extension" \ |
| 1680 | -s "server hello, adding session ticket extension" \ |
| 1681 | -c "found session_ticket extension" \ |
| 1682 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1683 | -S "session successfully restored from cache" \ |
| 1684 | -s "session successfully restored from ticket" \ |
| 1685 | -s "a session has been resumed" \ |
| 1686 | -c "a session has been resumed" |
| 1687 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1688 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1689 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1690 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1691 | 0 \ |
| 1692 | -c "client hello, adding session ticket extension" \ |
| 1693 | -s "found session ticket extension" \ |
| 1694 | -s "server hello, adding session ticket extension" \ |
| 1695 | -c "found session_ticket extension" \ |
| 1696 | -c "parse new session ticket" \ |
| 1697 | -S "session successfully restored from cache" \ |
| 1698 | -s "session successfully restored from ticket" \ |
| 1699 | -s "a session has been resumed" \ |
| 1700 | -c "a session has been resumed" |
| 1701 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1702 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1703 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1704 | "$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] | 1705 | 0 \ |
| 1706 | -c "client hello, adding session ticket extension" \ |
| 1707 | -s "found session ticket extension" \ |
| 1708 | -s "server hello, adding session ticket extension" \ |
| 1709 | -c "found session_ticket extension" \ |
| 1710 | -c "parse new session ticket" \ |
| 1711 | -S "session successfully restored from cache" \ |
| 1712 | -S "session successfully restored from ticket" \ |
| 1713 | -S "a session has been resumed" \ |
| 1714 | -C "a session has been resumed" |
| 1715 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1716 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1717 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1718 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1719 | 0 \ |
| 1720 | -c "client hello, adding session ticket extension" \ |
| 1721 | -c "found session_ticket extension" \ |
| 1722 | -c "parse new session ticket" \ |
| 1723 | -c "a session has been resumed" |
| 1724 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1725 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1726 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1727 | "( $O_CLI -sess_out $SESSION; \ |
| 1728 | $O_CLI -sess_in $SESSION; \ |
| 1729 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1730 | 0 \ |
| 1731 | -s "found session ticket extension" \ |
| 1732 | -s "server hello, adding session ticket extension" \ |
| 1733 | -S "session successfully restored from cache" \ |
| 1734 | -s "session successfully restored from ticket" \ |
| 1735 | -s "a session has been resumed" |
| 1736 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1737 | # Tests for Session Tickets with DTLS |
| 1738 | |
| 1739 | run_test "Session resume using tickets, DTLS: basic" \ |
| 1740 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1741 | "$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] | 1742 | 0 \ |
| 1743 | -c "client hello, adding session ticket extension" \ |
| 1744 | -s "found session ticket extension" \ |
| 1745 | -s "server hello, adding session ticket extension" \ |
| 1746 | -c "found session_ticket extension" \ |
| 1747 | -c "parse new session ticket" \ |
| 1748 | -S "session successfully restored from cache" \ |
| 1749 | -s "session successfully restored from ticket" \ |
| 1750 | -s "a session has been resumed" \ |
| 1751 | -c "a session has been resumed" |
| 1752 | |
| 1753 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 1754 | "$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] | 1755 | "$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] | 1756 | 0 \ |
| 1757 | -c "client hello, adding session ticket extension" \ |
| 1758 | -s "found session ticket extension" \ |
| 1759 | -s "server hello, adding session ticket extension" \ |
| 1760 | -c "found session_ticket extension" \ |
| 1761 | -c "parse new session ticket" \ |
| 1762 | -S "session successfully restored from cache" \ |
| 1763 | -s "session successfully restored from ticket" \ |
| 1764 | -s "a session has been resumed" \ |
| 1765 | -c "a session has been resumed" |
| 1766 | |
| 1767 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 1768 | "$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] | 1769 | "$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] | 1770 | 0 \ |
| 1771 | -c "client hello, adding session ticket extension" \ |
| 1772 | -s "found session ticket extension" \ |
| 1773 | -s "server hello, adding session ticket extension" \ |
| 1774 | -c "found session_ticket extension" \ |
| 1775 | -c "parse new session ticket" \ |
| 1776 | -S "session successfully restored from cache" \ |
| 1777 | -S "session successfully restored from ticket" \ |
| 1778 | -S "a session has been resumed" \ |
| 1779 | -C "a session has been resumed" |
| 1780 | |
| 1781 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 1782 | "$O_SRV -dtls1" \ |
| 1783 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1784 | 0 \ |
| 1785 | -c "client hello, adding session ticket extension" \ |
| 1786 | -c "found session_ticket extension" \ |
| 1787 | -c "parse new session ticket" \ |
| 1788 | -c "a session has been resumed" |
| 1789 | |
Manuel Pégourié-Gonnard | a470075 | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 1790 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 6c64983 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 1791 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | a470075 | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 1792 | requires_openssl_next |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1793 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 1794 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | a470075 | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 1795 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 1796 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1797 | rm -f $SESSION )" \ |
| 1798 | 0 \ |
| 1799 | -s "found session ticket extension" \ |
| 1800 | -s "server hello, adding session ticket extension" \ |
| 1801 | -S "session successfully restored from cache" \ |
| 1802 | -s "session successfully restored from ticket" \ |
| 1803 | -s "a session has been resumed" |
| 1804 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1805 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1806 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1807 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1808 | "$P_SRV debug_level=3 tickets=0" \ |
| 1809 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1810 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1811 | -c "client hello, adding session ticket extension" \ |
| 1812 | -s "found session ticket extension" \ |
| 1813 | -S "server hello, adding session ticket extension" \ |
| 1814 | -C "found session_ticket extension" \ |
| 1815 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1816 | -s "session successfully restored from cache" \ |
| 1817 | -S "session successfully restored from ticket" \ |
| 1818 | -s "a session has been resumed" \ |
| 1819 | -c "a session has been resumed" |
| 1820 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1821 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1822 | "$P_SRV debug_level=3 tickets=1" \ |
| 1823 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1824 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1825 | -C "client hello, adding session ticket extension" \ |
| 1826 | -S "found session ticket extension" \ |
| 1827 | -S "server hello, adding session ticket extension" \ |
| 1828 | -C "found session_ticket extension" \ |
| 1829 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 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" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1834 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1835 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1836 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1837 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1838 | 0 \ |
| 1839 | -S "session successfully restored from cache" \ |
| 1840 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1841 | -S "a session has been resumed" \ |
| 1842 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1843 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1844 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1845 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1846 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1847 | 0 \ |
| 1848 | -s "session successfully restored from cache" \ |
| 1849 | -S "session successfully restored from ticket" \ |
| 1850 | -s "a session has been resumed" \ |
| 1851 | -c "a session has been resumed" |
| 1852 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1853 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1854 | "$P_SRV debug_level=3 tickets=0" \ |
| 1855 | "$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] | 1856 | 0 \ |
| 1857 | -s "session successfully restored from cache" \ |
| 1858 | -S "session successfully restored from ticket" \ |
| 1859 | -s "a session has been resumed" \ |
| 1860 | -c "a session has been resumed" |
| 1861 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1862 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1863 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1864 | "$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] | 1865 | 0 \ |
| 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 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1871 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1872 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1873 | "$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] | 1874 | 0 \ |
| 1875 | -s "session successfully restored from cache" \ |
| 1876 | -S "session successfully restored from ticket" \ |
| 1877 | -s "a session has been resumed" \ |
| 1878 | -c "a session has been resumed" |
| 1879 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1880 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1881 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1882 | "( $O_CLI -sess_out $SESSION; \ |
| 1883 | $O_CLI -sess_in $SESSION; \ |
| 1884 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1885 | 0 \ |
| 1886 | -s "found session ticket extension" \ |
| 1887 | -S "server hello, adding session ticket extension" \ |
| 1888 | -s "session successfully restored from cache" \ |
| 1889 | -S "session successfully restored from ticket" \ |
| 1890 | -s "a session has been resumed" |
| 1891 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1892 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1893 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1894 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1895 | 0 \ |
| 1896 | -C "found session_ticket extension" \ |
| 1897 | -C "parse new session ticket" \ |
| 1898 | -c "a session has been resumed" |
| 1899 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1900 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 1901 | |
| 1902 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 1903 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1904 | "$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] | 1905 | 0 \ |
| 1906 | -c "client hello, adding session ticket extension" \ |
| 1907 | -s "found session ticket extension" \ |
| 1908 | -S "server hello, adding session ticket extension" \ |
| 1909 | -C "found session_ticket extension" \ |
| 1910 | -C "parse new session ticket" \ |
| 1911 | -s "session successfully restored from cache" \ |
| 1912 | -S "session successfully restored from ticket" \ |
| 1913 | -s "a session has been resumed" \ |
| 1914 | -c "a session has been resumed" |
| 1915 | |
| 1916 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 1917 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1918 | "$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] | 1919 | 0 \ |
| 1920 | -C "client hello, adding session ticket extension" \ |
| 1921 | -S "found session ticket extension" \ |
| 1922 | -S "server hello, adding session ticket extension" \ |
| 1923 | -C "found session_ticket extension" \ |
| 1924 | -C "parse new session ticket" \ |
| 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: cache_max=0" \ |
| 1931 | "$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] | 1932 | "$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] | 1933 | 0 \ |
| 1934 | -S "session successfully restored from cache" \ |
| 1935 | -S "session successfully restored from ticket" \ |
| 1936 | -S "a session has been resumed" \ |
| 1937 | -C "a session has been resumed" |
| 1938 | |
| 1939 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 1940 | "$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] | 1941 | "$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] | 1942 | 0 \ |
| 1943 | -s "session successfully restored from cache" \ |
| 1944 | -S "session successfully restored from ticket" \ |
| 1945 | -s "a session has been resumed" \ |
| 1946 | -c "a session has been resumed" |
| 1947 | |
| 1948 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 1949 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1950 | "$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] | 1951 | 0 \ |
| 1952 | -s "session successfully restored from cache" \ |
| 1953 | -S "session successfully restored from ticket" \ |
| 1954 | -s "a session has been resumed" \ |
| 1955 | -c "a session has been resumed" |
| 1956 | |
| 1957 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 1958 | "$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] | 1959 | "$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] | 1960 | 0 \ |
| 1961 | -S "session successfully restored from cache" \ |
| 1962 | -S "session successfully restored from ticket" \ |
| 1963 | -S "a session has been resumed" \ |
| 1964 | -C "a session has been resumed" |
| 1965 | |
| 1966 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 1967 | "$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] | 1968 | "$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] | 1969 | 0 \ |
| 1970 | -s "session successfully restored from cache" \ |
| 1971 | -S "session successfully restored from ticket" \ |
| 1972 | -s "a session has been resumed" \ |
| 1973 | -c "a session has been resumed" |
| 1974 | |
Manuel Pégourié-Gonnard | a470075 | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 1975 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 6c64983 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 1976 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | a470075 | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 1977 | requires_openssl_next |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1978 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 1979 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | a470075 | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 1980 | "( $O_NEXT_CLI -dtls1 -sess_out $SESSION; \ |
| 1981 | $O_NEXT_CLI -dtls1 -sess_in $SESSION; \ |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1982 | rm -f $SESSION )" \ |
| 1983 | 0 \ |
| 1984 | -s "found session ticket extension" \ |
| 1985 | -S "server hello, adding session ticket extension" \ |
| 1986 | -s "session successfully restored from cache" \ |
| 1987 | -S "session successfully restored from ticket" \ |
| 1988 | -s "a session has been resumed" |
| 1989 | |
| 1990 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 1991 | "$O_SRV -dtls1" \ |
| 1992 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1993 | 0 \ |
| 1994 | -C "found session_ticket extension" \ |
| 1995 | -C "parse new session ticket" \ |
| 1996 | -c "a session has been resumed" |
| 1997 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1998 | # Tests for Max Fragment Length extension |
| 1999 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2000 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2001 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2002 | "$P_SRV debug_level=3" \ |
| 2003 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2004 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2005 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2006 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2007 | -C "client hello, adding max_fragment_length extension" \ |
| 2008 | -S "found max fragment length extension" \ |
| 2009 | -S "server hello, max_fragment_length extension" \ |
| 2010 | -C "found max_fragment_length extension" |
| 2011 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2012 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2013 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2014 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2015 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2016 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2017 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2018 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2019 | -C "client hello, adding max_fragment_length extension" \ |
| 2020 | -S "found max fragment length extension" \ |
| 2021 | -S "server hello, max_fragment_length extension" \ |
| 2022 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2023 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2024 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2025 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2026 | |
| 2027 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2028 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2029 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2030 | "$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] | 2031 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2032 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 2033 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2034 | -C "client hello, adding max_fragment_length extension" \ |
| 2035 | -S "found max fragment length extension" \ |
| 2036 | -S "server hello, max_fragment_length extension" \ |
| 2037 | -C "found max_fragment_length extension" \ |
| 2038 | -c "fragment larger than.*maximum " |
| 2039 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2040 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2041 | # (session fragment length will be 16384 regardless of mbedtls |
| 2042 | # content length configuration.) |
| 2043 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2044 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2045 | run_test "Max fragment length: disabled, larger message" \ |
| 2046 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2047 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2048 | 0 \ |
| 2049 | -C "Maximum fragment length is 16384" \ |
| 2050 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2051 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2052 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2053 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2054 | |
| 2055 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 2e580ce | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2056 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2057 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2058 | "$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] | 2059 | 1 \ |
| 2060 | -C "Maximum fragment length is 16384" \ |
| 2061 | -S "Maximum fragment length is 16384" \ |
| 2062 | -c "fragment larger than.*maximum " |
| 2063 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2064 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2065 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2066 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2067 | "$P_SRV debug_level=3" \ |
| 2068 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2069 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2070 | -c "Maximum fragment length is 4096" \ |
| 2071 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2072 | -c "client hello, adding max_fragment_length extension" \ |
| 2073 | -s "found max fragment length extension" \ |
| 2074 | -s "server hello, max_fragment_length extension" \ |
| 2075 | -c "found max_fragment_length extension" |
| 2076 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2077 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2078 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2079 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2080 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2081 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2082 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2083 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2084 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2085 | -C "client hello, adding max_fragment_length extension" \ |
| 2086 | -S "found max fragment length extension" \ |
| 2087 | -S "server hello, max_fragment_length extension" \ |
| 2088 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2089 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2090 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2091 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2092 | requires_gnutls |
| 2093 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2094 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2095 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2096 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2097 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 2098 | -c "client hello, adding max_fragment_length extension" \ |
| 2099 | -c "found max_fragment_length extension" |
| 2100 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2101 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2102 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2103 | run_test "Max fragment length: client, message just fits" \ |
| 2104 | "$P_SRV debug_level=3" \ |
| 2105 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 2106 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2107 | -c "Maximum fragment length is 2048" \ |
| 2108 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2109 | -c "client hello, adding max_fragment_length extension" \ |
| 2110 | -s "found max fragment length extension" \ |
| 2111 | -s "server hello, max_fragment_length extension" \ |
| 2112 | -c "found max_fragment_length extension" \ |
| 2113 | -c "2048 bytes written in 1 fragments" \ |
| 2114 | -s "2048 bytes read" |
| 2115 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2116 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2117 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2118 | run_test "Max fragment length: client, larger message" \ |
| 2119 | "$P_SRV debug_level=3" \ |
| 2120 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 2121 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2122 | -c "Maximum fragment length is 2048" \ |
| 2123 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2124 | -c "client hello, adding max_fragment_length extension" \ |
| 2125 | -s "found max fragment length extension" \ |
| 2126 | -s "server hello, max_fragment_length extension" \ |
| 2127 | -c "found max_fragment_length extension" \ |
| 2128 | -c "2345 bytes written in 2 fragments" \ |
| 2129 | -s "2048 bytes read" \ |
| 2130 | -s "297 bytes read" |
| 2131 | |
Yuto Takano | 0807e1d | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2132 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2133 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 2134 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2135 | "$P_SRV debug_level=3 dtls=1" \ |
| 2136 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 2137 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2138 | -c "Maximum fragment length is 2048" \ |
| 2139 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2140 | -c "client hello, adding max_fragment_length extension" \ |
| 2141 | -s "found max fragment length extension" \ |
| 2142 | -s "server hello, max_fragment_length extension" \ |
| 2143 | -c "found max_fragment_length extension" \ |
| 2144 | -c "fragment larger than.*maximum" |
| 2145 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2146 | # Tests for renegotiation |
| 2147 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2148 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2149 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2150 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2151 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2152 | 0 \ |
| 2153 | -C "client hello, adding renegotiation extension" \ |
| 2154 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2155 | -S "found renegotiation extension" \ |
| 2156 | -s "server hello, secure renegotiation extension" \ |
| 2157 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2158 | -C "=> renegotiate" \ |
| 2159 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2160 | -S "write hello request" |
| 2161 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2162 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2163 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2164 | "$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] | 2165 | "$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] | 2166 | 0 \ |
| 2167 | -c "client hello, adding renegotiation extension" \ |
| 2168 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2169 | -s "found renegotiation extension" \ |
| 2170 | -s "server hello, secure renegotiation extension" \ |
| 2171 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2172 | -c "=> renegotiate" \ |
| 2173 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2174 | -S "write hello request" |
| 2175 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2176 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2177 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2178 | "$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] | 2179 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2180 | 0 \ |
| 2181 | -c "client hello, adding renegotiation extension" \ |
| 2182 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2183 | -s "found renegotiation extension" \ |
| 2184 | -s "server hello, secure renegotiation extension" \ |
| 2185 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2186 | -c "=> renegotiate" \ |
| 2187 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2188 | -s "write hello request" |
| 2189 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2190 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2191 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2192 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2193 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2194 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 2195 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 2196 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2197 | 0 \ |
| 2198 | -c "client hello, adding renegotiation extension" \ |
| 2199 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2200 | -s "found renegotiation extension" \ |
| 2201 | -s "server hello, secure renegotiation extension" \ |
| 2202 | -c "found renegotiation extension" \ |
| 2203 | -c "=> renegotiate" \ |
| 2204 | -s "=> renegotiate" \ |
| 2205 | -S "write hello request" \ |
| 2206 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2207 | |
| 2208 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2209 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2210 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2211 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2212 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 2213 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 2214 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2215 | 0 \ |
| 2216 | -c "client hello, adding renegotiation extension" \ |
| 2217 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2218 | -s "found renegotiation extension" \ |
| 2219 | -s "server hello, secure renegotiation extension" \ |
| 2220 | -c "found renegotiation extension" \ |
| 2221 | -c "=> renegotiate" \ |
| 2222 | -s "=> renegotiate" \ |
| 2223 | -s "write hello request" \ |
| 2224 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2225 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2226 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2227 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2228 | "$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] | 2229 | "$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] | 2230 | 0 \ |
| 2231 | -c "client hello, adding renegotiation extension" \ |
| 2232 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2233 | -s "found renegotiation extension" \ |
| 2234 | -s "server hello, secure renegotiation extension" \ |
| 2235 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2236 | -c "=> renegotiate" \ |
| 2237 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2238 | -s "write hello request" |
| 2239 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2240 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2241 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2242 | "$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] | 2243 | "$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] | 2244 | 1 \ |
| 2245 | -c "client hello, adding renegotiation extension" \ |
| 2246 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2247 | -S "found renegotiation extension" \ |
| 2248 | -s "server hello, secure renegotiation extension" \ |
| 2249 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2250 | -c "=> renegotiate" \ |
| 2251 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2252 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 2253 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2254 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2255 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2256 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2257 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2258 | "$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] | 2259 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2260 | 0 \ |
| 2261 | -C "client hello, adding renegotiation extension" \ |
| 2262 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2263 | -S "found renegotiation extension" \ |
| 2264 | -s "server hello, secure renegotiation extension" \ |
| 2265 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2266 | -C "=> renegotiate" \ |
| 2267 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2268 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 2269 | -S "SSL - An unexpected message was received from our peer" \ |
| 2270 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2271 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2272 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2273 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2274 | "$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] | 2275 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2276 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2277 | 0 \ |
| 2278 | -C "client hello, adding renegotiation extension" \ |
| 2279 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2280 | -S "found renegotiation extension" \ |
| 2281 | -s "server hello, secure renegotiation extension" \ |
| 2282 | -c "found renegotiation extension" \ |
| 2283 | -C "=> renegotiate" \ |
| 2284 | -S "=> renegotiate" \ |
| 2285 | -s "write hello request" \ |
| 2286 | -S "SSL - An unexpected message was received from our peer" \ |
| 2287 | -S "failed" |
| 2288 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2289 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2290 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2291 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2292 | "$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] | 2293 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2294 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2295 | 0 \ |
| 2296 | -C "client hello, adding renegotiation extension" \ |
| 2297 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2298 | -S "found renegotiation extension" \ |
| 2299 | -s "server hello, secure renegotiation extension" \ |
| 2300 | -c "found renegotiation extension" \ |
| 2301 | -C "=> renegotiate" \ |
| 2302 | -S "=> renegotiate" \ |
| 2303 | -s "write hello request" \ |
| 2304 | -S "SSL - An unexpected message was received from our peer" \ |
| 2305 | -S "failed" |
| 2306 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2307 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2308 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2309 | "$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] | 2310 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2311 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2312 | 0 \ |
| 2313 | -C "client hello, adding renegotiation extension" \ |
| 2314 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2315 | -S "found renegotiation extension" \ |
| 2316 | -s "server hello, secure renegotiation extension" \ |
| 2317 | -c "found renegotiation extension" \ |
| 2318 | -C "=> renegotiate" \ |
| 2319 | -S "=> renegotiate" \ |
| 2320 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2321 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2322 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2323 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2324 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2325 | "$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] | 2326 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2327 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2328 | 0 \ |
| 2329 | -c "client hello, adding renegotiation extension" \ |
| 2330 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2331 | -s "found renegotiation extension" \ |
| 2332 | -s "server hello, secure renegotiation extension" \ |
| 2333 | -c "found renegotiation extension" \ |
| 2334 | -c "=> renegotiate" \ |
| 2335 | -s "=> renegotiate" \ |
| 2336 | -s "write hello request" \ |
| 2337 | -S "SSL - An unexpected message was received from our peer" \ |
| 2338 | -S "failed" |
| 2339 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2340 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2341 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2342 | "$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] | 2343 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2344 | 0 \ |
| 2345 | -C "client hello, adding renegotiation extension" \ |
| 2346 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2347 | -S "found renegotiation extension" \ |
| 2348 | -s "server hello, secure renegotiation extension" \ |
| 2349 | -c "found renegotiation extension" \ |
| 2350 | -S "record counter limit reached: renegotiate" \ |
| 2351 | -C "=> renegotiate" \ |
| 2352 | -S "=> renegotiate" \ |
| 2353 | -S "write hello request" \ |
| 2354 | -S "SSL - An unexpected message was received from our peer" \ |
| 2355 | -S "failed" |
| 2356 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 2357 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2358 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2359 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2360 | "$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] | 2361 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2362 | 0 \ |
| 2363 | -c "client hello, adding renegotiation extension" \ |
| 2364 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2365 | -s "found renegotiation extension" \ |
| 2366 | -s "server hello, secure renegotiation extension" \ |
| 2367 | -c "found renegotiation extension" \ |
| 2368 | -s "record counter limit reached: renegotiate" \ |
| 2369 | -c "=> renegotiate" \ |
| 2370 | -s "=> renegotiate" \ |
| 2371 | -s "write hello request" \ |
| 2372 | -S "SSL - An unexpected message was received from our peer" \ |
| 2373 | -S "failed" |
| 2374 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2375 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2376 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2377 | "$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] | 2378 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [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 | -s "record counter limit reached: renegotiate" \ |
| 2386 | -c "=> renegotiate" \ |
| 2387 | -s "=> renegotiate" \ |
| 2388 | -s "write hello request" \ |
| 2389 | -S "SSL - An unexpected message was received from our peer" \ |
| 2390 | -S "failed" |
| 2391 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2392 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2393 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2394 | "$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] | 2395 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 2396 | 0 \ |
| 2397 | -C "client hello, adding renegotiation extension" \ |
| 2398 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2399 | -S "found renegotiation extension" \ |
| 2400 | -s "server hello, secure renegotiation extension" \ |
| 2401 | -c "found renegotiation extension" \ |
| 2402 | -S "record counter limit reached: renegotiate" \ |
| 2403 | -C "=> renegotiate" \ |
| 2404 | -S "=> renegotiate" \ |
| 2405 | -S "write hello request" \ |
| 2406 | -S "SSL - An unexpected message was received from our peer" \ |
| 2407 | -S "failed" |
| 2408 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2409 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2410 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2411 | "$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] | 2412 | "$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] | 2413 | 0 \ |
| 2414 | -c "client hello, adding renegotiation extension" \ |
| 2415 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2416 | -s "found renegotiation extension" \ |
| 2417 | -s "server hello, secure renegotiation extension" \ |
| 2418 | -c "found renegotiation extension" \ |
| 2419 | -c "=> renegotiate" \ |
| 2420 | -s "=> renegotiate" \ |
| 2421 | -S "write hello request" |
| 2422 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2423 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2424 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2425 | "$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] | 2426 | "$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] | 2427 | 0 \ |
| 2428 | -c "client hello, adding renegotiation extension" \ |
| 2429 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2430 | -s "found renegotiation extension" \ |
| 2431 | -s "server hello, secure renegotiation extension" \ |
| 2432 | -c "found renegotiation extension" \ |
| 2433 | -c "=> renegotiate" \ |
| 2434 | -s "=> renegotiate" \ |
| 2435 | -s "write hello request" |
| 2436 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2437 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2438 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2439 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2440 | "$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] | 2441 | 0 \ |
| 2442 | -c "client hello, adding renegotiation extension" \ |
| 2443 | -c "found renegotiation extension" \ |
| 2444 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2445 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2446 | -C "error" \ |
| 2447 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2448 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2449 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2450 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2451 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 2452 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2453 | "$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] | 2454 | 0 \ |
| 2455 | -c "client hello, adding renegotiation extension" \ |
| 2456 | -c "found renegotiation extension" \ |
| 2457 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2458 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2459 | -C "error" \ |
| 2460 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2461 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2462 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2463 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2464 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 2465 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2466 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2467 | 1 \ |
| 2468 | -c "client hello, adding renegotiation extension" \ |
| 2469 | -C "found renegotiation extension" \ |
| 2470 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2471 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2472 | -c "error" \ |
| 2473 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2474 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2475 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2476 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2477 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 2478 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2479 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2480 | allow_legacy=0" \ |
| 2481 | 1 \ |
| 2482 | -c "client hello, adding renegotiation extension" \ |
| 2483 | -C "found renegotiation extension" \ |
| 2484 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2485 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2486 | -c "error" \ |
| 2487 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2488 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2489 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2490 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2491 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 2492 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2493 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2494 | allow_legacy=1" \ |
| 2495 | 0 \ |
| 2496 | -c "client hello, adding renegotiation extension" \ |
| 2497 | -C "found renegotiation extension" \ |
| 2498 | -c "=> renegotiate" \ |
| 2499 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2500 | -C "error" \ |
| 2501 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2502 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2503 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2504 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 2505 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 2506 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2507 | 0 \ |
| 2508 | -c "client hello, adding renegotiation extension" \ |
| 2509 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2510 | -s "found renegotiation extension" \ |
| 2511 | -s "server hello, secure renegotiation extension" \ |
| 2512 | -c "found renegotiation extension" \ |
| 2513 | -c "=> renegotiate" \ |
| 2514 | -s "=> renegotiate" \ |
| 2515 | -S "write hello request" |
| 2516 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2517 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2518 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 2519 | "$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] | 2520 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 2521 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2522 | 0 \ |
| 2523 | -c "client hello, adding renegotiation extension" \ |
| 2524 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2525 | -s "found renegotiation extension" \ |
| 2526 | -s "server hello, secure renegotiation extension" \ |
| 2527 | -c "found renegotiation extension" \ |
| 2528 | -c "=> renegotiate" \ |
| 2529 | -s "=> renegotiate" \ |
| 2530 | -s "write hello request" |
| 2531 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2532 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2533 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2534 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2535 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2536 | 0 \ |
| 2537 | -c "client hello, adding renegotiation extension" \ |
| 2538 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2539 | -s "found renegotiation extension" \ |
| 2540 | -s "server hello, secure renegotiation extension" \ |
| 2541 | -s "record counter limit reached: renegotiate" \ |
| 2542 | -c "=> renegotiate" \ |
| 2543 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2544 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2545 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2546 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2547 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2548 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2549 | "$G_SRV -u --mtu 4096" \ |
| 2550 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2551 | 0 \ |
| 2552 | -c "client hello, adding renegotiation extension" \ |
| 2553 | -c "found renegotiation extension" \ |
| 2554 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2555 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2556 | -C "error" \ |
| 2557 | -s "Extra-header:" |
| 2558 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2559 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2560 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2561 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2562 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2563 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2564 | "$P_CLI debug_level=3" \ |
| 2565 | 0 \ |
| 2566 | -c "found renegotiation extension" \ |
| 2567 | -C "error" \ |
| 2568 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2569 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2570 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2571 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2572 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2573 | "$P_CLI debug_level=3" \ |
| 2574 | 0 \ |
| 2575 | -C "found renegotiation extension" \ |
| 2576 | -C "error" \ |
| 2577 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2578 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2579 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2580 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2581 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2582 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2583 | 1 \ |
| 2584 | -C "found renegotiation extension" \ |
| 2585 | -c "error" \ |
| 2586 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2587 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2588 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2589 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2590 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2591 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2592 | 0 \ |
| 2593 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2594 | -s "server hello, secure renegotiation extension" |
| 2595 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2596 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2597 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2598 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2599 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2600 | 0 \ |
| 2601 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2602 | -S "server hello, secure renegotiation extension" |
| 2603 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2604 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2605 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2606 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2607 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2608 | 1 \ |
| 2609 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2610 | -S "server hello, secure renegotiation extension" |
| 2611 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2612 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2613 | |
| 2614 | requires_gnutls |
| 2615 | run_test "DER format: no trailing bytes" \ |
| 2616 | "$P_SRV crt_file=data_files/server5-der0.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 | |
| 2622 | requires_gnutls |
| 2623 | run_test "DER format: with a trailing zero byte" \ |
| 2624 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2625 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2626 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2627 | 0 \ |
| 2628 | -c "Handshake was completed" \ |
| 2629 | |
| 2630 | requires_gnutls |
| 2631 | run_test "DER format: with a trailing random byte" \ |
| 2632 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2633 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2634 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2635 | 0 \ |
| 2636 | -c "Handshake was completed" \ |
| 2637 | |
| 2638 | requires_gnutls |
| 2639 | run_test "DER format: with 2 trailing random bytes" \ |
| 2640 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2641 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2642 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2643 | 0 \ |
| 2644 | -c "Handshake was completed" \ |
| 2645 | |
| 2646 | requires_gnutls |
| 2647 | run_test "DER format: with 4 trailing random bytes" \ |
| 2648 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2649 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2650 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2651 | 0 \ |
| 2652 | -c "Handshake was completed" \ |
| 2653 | |
| 2654 | requires_gnutls |
| 2655 | run_test "DER format: with 8 trailing random bytes" \ |
| 2656 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2657 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2658 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2659 | 0 \ |
| 2660 | -c "Handshake was completed" \ |
| 2661 | |
| 2662 | requires_gnutls |
| 2663 | run_test "DER format: with 9 trailing random bytes" \ |
| 2664 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2665 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2666 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2667 | 0 \ |
| 2668 | -c "Handshake was completed" \ |
| 2669 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2670 | # Tests for auth_mode |
| 2671 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2672 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2673 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2674 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2675 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2676 | 1 \ |
| 2677 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2678 | -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] | 2679 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2680 | -c "X509 - Certificate verification failed" |
| 2681 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2682 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2683 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2684 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2685 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2686 | 0 \ |
| 2687 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2688 | -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] | 2689 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2690 | -C "X509 - Certificate verification failed" |
| 2691 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2692 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2693 | "$P_SRV" \ |
| 2694 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2695 | 0 \ |
| 2696 | -c "x509_verify_cert() returned" \ |
| 2697 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2698 | -c "! Certificate verification flags"\ |
| 2699 | -C "! mbedtls_ssl_handshake returned" \ |
| 2700 | -C "X509 - Certificate verification failed" \ |
| 2701 | -C "SSL - No CA Chain is set, but required to operate" |
| 2702 | |
| 2703 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2704 | "$P_SRV" \ |
| 2705 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2706 | 1 \ |
| 2707 | -c "x509_verify_cert() returned" \ |
| 2708 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2709 | -c "! Certificate verification flags"\ |
| 2710 | -c "! mbedtls_ssl_handshake returned" \ |
| 2711 | -c "SSL - No CA Chain is set, but required to operate" |
| 2712 | |
| 2713 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2714 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2715 | # the client informs the server about the supported curves - it does, though, in the |
| 2716 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2717 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2718 | # different means to have the server ignoring the client's supported curve list. |
| 2719 | |
| 2720 | requires_config_enabled MBEDTLS_ECP_C |
| 2721 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2722 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2723 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2724 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2725 | 1 \ |
| 2726 | -c "bad certificate (EC key curve)"\ |
| 2727 | -c "! Certificate verification flags"\ |
| 2728 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2729 | |
| 2730 | requires_config_enabled MBEDTLS_ECP_C |
| 2731 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2732 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2733 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2734 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2735 | 1 \ |
| 2736 | -c "bad certificate (EC key curve)"\ |
| 2737 | -c "! Certificate verification flags"\ |
| 2738 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2739 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2740 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2741 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2742 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2743 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2744 | 0 \ |
| 2745 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2746 | -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] | 2747 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2748 | -C "X509 - Certificate verification failed" |
| 2749 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2750 | run_test "Authentication: client SHA256, server required" \ |
| 2751 | "$P_SRV auth_mode=required" \ |
| 2752 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2753 | key_file=data_files/server6.key \ |
| 2754 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2755 | 0 \ |
| 2756 | -c "Supported Signature Algorithm found: 4," \ |
| 2757 | -c "Supported Signature Algorithm found: 5," |
| 2758 | |
| 2759 | run_test "Authentication: client SHA384, server required" \ |
| 2760 | "$P_SRV auth_mode=required" \ |
| 2761 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2762 | key_file=data_files/server6.key \ |
| 2763 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2764 | 0 \ |
| 2765 | -c "Supported Signature Algorithm found: 4," \ |
| 2766 | -c "Supported Signature Algorithm found: 5," |
| 2767 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2768 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2769 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2770 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2771 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2772 | key_file=data_files/server5.key" \ |
| 2773 | 1 \ |
| 2774 | -S "skip write certificate request" \ |
| 2775 | -C "skip parse certificate request" \ |
| 2776 | -c "got a certificate request" \ |
| 2777 | -c "got no certificate to send" \ |
| 2778 | -S "x509_verify_cert() returned" \ |
| 2779 | -s "client has no certificate" \ |
| 2780 | -s "! mbedtls_ssl_handshake returned" \ |
| 2781 | -c "! mbedtls_ssl_handshake returned" \ |
| 2782 | -s "No client certification received from the client, but required by the authentication mode" |
| 2783 | |
| 2784 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2785 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2786 | "$P_CLI debug_level=3 crt_file=none \ |
| 2787 | key_file=data_files/server5.key" \ |
| 2788 | 1 \ |
| 2789 | -S "skip write certificate request" \ |
| 2790 | -C "skip parse certificate request" \ |
| 2791 | -c "got a certificate request" \ |
| 2792 | -c "= write certificate$" \ |
| 2793 | -C "skip write certificate$" \ |
| 2794 | -S "x509_verify_cert() returned" \ |
| 2795 | -s "client has no certificate" \ |
| 2796 | -s "! mbedtls_ssl_handshake returned" \ |
| 2797 | -c "! mbedtls_ssl_handshake returned" \ |
| 2798 | -s "No client certification received from the client, but required by the authentication mode" |
| 2799 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2800 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2801 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2802 | "$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] | 2803 | key_file=data_files/server5.key" \ |
| 2804 | 1 \ |
| 2805 | -S "skip write certificate request" \ |
| 2806 | -C "skip parse certificate request" \ |
| 2807 | -c "got a certificate request" \ |
| 2808 | -C "skip write certificate" \ |
| 2809 | -C "skip write certificate verify" \ |
| 2810 | -S "skip parse certificate verify" \ |
| 2811 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2812 | -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] | 2813 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2814 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2815 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2816 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2817 | # We don't check that the client receives the alert because it might |
| 2818 | # detect that its write end of the connection is closed and abort |
| 2819 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2820 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2821 | run_test "Authentication: client cert not trusted, server required" \ |
| 2822 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2823 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2824 | key_file=data_files/server5.key" \ |
| 2825 | 1 \ |
| 2826 | -S "skip write certificate request" \ |
| 2827 | -C "skip parse certificate request" \ |
| 2828 | -c "got a certificate request" \ |
| 2829 | -C "skip write certificate" \ |
| 2830 | -C "skip write certificate verify" \ |
| 2831 | -S "skip parse certificate verify" \ |
| 2832 | -s "x509_verify_cert() returned" \ |
| 2833 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2834 | -s "! mbedtls_ssl_handshake returned" \ |
| 2835 | -c "! mbedtls_ssl_handshake returned" \ |
| 2836 | -s "X509 - Certificate verification failed" |
| 2837 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2838 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2839 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2840 | "$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] | 2841 | key_file=data_files/server5.key" \ |
| 2842 | 0 \ |
| 2843 | -S "skip write certificate request" \ |
| 2844 | -C "skip parse certificate request" \ |
| 2845 | -c "got a certificate request" \ |
| 2846 | -C "skip write certificate" \ |
| 2847 | -C "skip write certificate verify" \ |
| 2848 | -S "skip parse certificate verify" \ |
| 2849 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2850 | -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] | 2851 | -S "! mbedtls_ssl_handshake returned" \ |
| 2852 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2853 | -S "X509 - Certificate verification failed" |
| 2854 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2855 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2856 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2857 | "$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] | 2858 | key_file=data_files/server5.key" \ |
| 2859 | 0 \ |
| 2860 | -s "skip write certificate request" \ |
| 2861 | -C "skip parse certificate request" \ |
| 2862 | -c "got no certificate request" \ |
| 2863 | -c "skip write certificate" \ |
| 2864 | -c "skip write certificate verify" \ |
| 2865 | -s "skip parse certificate verify" \ |
| 2866 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2867 | -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] | 2868 | -S "! mbedtls_ssl_handshake returned" \ |
| 2869 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2870 | -S "X509 - Certificate verification failed" |
| 2871 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2872 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2873 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2874 | "$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] | 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 "got no certificate to send" \ |
| 2881 | -S "SSLv3 client has no certificate" \ |
| 2882 | -c "skip write certificate verify" \ |
| 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 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2889 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2890 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2891 | "$O_CLI" \ |
| 2892 | 0 \ |
| 2893 | -S "skip write certificate request" \ |
| 2894 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2895 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2896 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2897 | -S "X509 - Certificate verification failed" |
| 2898 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2899 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2900 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2901 | "$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] | 2902 | 0 \ |
| 2903 | -C "skip parse certificate request" \ |
| 2904 | -c "got a certificate request" \ |
| 2905 | -C "skip write certificate$" \ |
| 2906 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2907 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2908 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2909 | run_test "Authentication: client no cert, openssl server required" \ |
| 2910 | "$O_SRV -Verify 10" \ |
| 2911 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 2912 | 1 \ |
| 2913 | -C "skip parse certificate request" \ |
| 2914 | -c "got a certificate request" \ |
| 2915 | -C "skip write certificate$" \ |
| 2916 | -c "skip write certificate verify" \ |
| 2917 | -c "! mbedtls_ssl_handshake returned" |
| 2918 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2919 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2920 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2921 | "$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] | 2922 | "$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] | 2923 | 0 \ |
| 2924 | -S "skip write certificate request" \ |
| 2925 | -C "skip parse certificate request" \ |
| 2926 | -c "got a certificate request" \ |
| 2927 | -C "skip write certificate$" \ |
| 2928 | -c "skip write certificate verify" \ |
| 2929 | -c "got no certificate to send" \ |
| 2930 | -s "SSLv3 client has no certificate" \ |
| 2931 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2932 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2933 | -S "! mbedtls_ssl_handshake returned" \ |
| 2934 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2935 | -S "X509 - Certificate verification failed" |
| 2936 | |
Yuto Takano | 8df2d25 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 2937 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 2938 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 2939 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2940 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2941 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2942 | |
Yuto Takano | 8df2d25 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 2943 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 2944 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 2945 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 2946 | # 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] | 2947 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2948 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2949 | run_test "Authentication: server max_int chain, client default" \ |
| 2950 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2951 | key_file=data_files/dir-maxpath/09.key" \ |
| 2952 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2953 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2954 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2955 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 2956 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2957 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2958 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2959 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2960 | key_file=data_files/dir-maxpath/10.key" \ |
| 2961 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2962 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2963 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2964 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 2965 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2966 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2967 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 2968 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2969 | key_file=data_files/dir-maxpath/10.key" \ |
| 2970 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2971 | auth_mode=optional" \ |
| 2972 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2973 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2974 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 2975 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2976 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2977 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 2978 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2979 | key_file=data_files/dir-maxpath/10.key" \ |
| 2980 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2981 | auth_mode=none" \ |
| 2982 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2983 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2984 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 2985 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2986 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2987 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2988 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2989 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2990 | key_file=data_files/dir-maxpath/10.key" \ |
| 2991 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2992 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2993 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 2994 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2995 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2996 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2997 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2998 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2999 | key_file=data_files/dir-maxpath/10.key" \ |
| 3000 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3001 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3002 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3003 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3004 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3005 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 3006 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3007 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3008 | key_file=data_files/dir-maxpath/10.key" \ |
| 3009 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3010 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3011 | |
Yuto Takano | bc632c2 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3012 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3013 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3014 | run_test "Authentication: client max_int chain, server required" \ |
| 3015 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3016 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3017 | key_file=data_files/dir-maxpath/09.key" \ |
| 3018 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3019 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3020 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3021 | # Tests for CA list in CertificateRequest messages |
| 3022 | |
| 3023 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3024 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3025 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3026 | key_file=data_files/server6.key" \ |
| 3027 | 0 \ |
| 3028 | -s "requested DN" |
| 3029 | |
| 3030 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 3031 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3032 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3033 | key_file=data_files/server6.key" \ |
| 3034 | 0 \ |
| 3035 | -S "requested DN" |
| 3036 | |
| 3037 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 3038 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3039 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3040 | key_file=data_files/server5.key" \ |
| 3041 | 1 \ |
| 3042 | -S "requested DN" \ |
| 3043 | -s "x509_verify_cert() returned" \ |
| 3044 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3045 | -s "! mbedtls_ssl_handshake returned" \ |
| 3046 | -c "! mbedtls_ssl_handshake returned" \ |
| 3047 | -s "X509 - Certificate verification failed" |
| 3048 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 3049 | # Tests for certificate selection based on SHA verson |
| 3050 | |
| 3051 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 3052 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3053 | key_file=data_files/server5.key \ |
| 3054 | crt_file2=data_files/server5-sha1.crt \ |
| 3055 | key_file2=data_files/server5.key" \ |
| 3056 | "$P_CLI force_version=tls1_2" \ |
| 3057 | 0 \ |
| 3058 | -c "signed using.*ECDSA with SHA256" \ |
| 3059 | -C "signed using.*ECDSA with SHA1" |
| 3060 | |
| 3061 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 3062 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3063 | key_file=data_files/server5.key \ |
| 3064 | crt_file2=data_files/server5-sha1.crt \ |
| 3065 | key_file2=data_files/server5.key" \ |
| 3066 | "$P_CLI force_version=tls1_1" \ |
| 3067 | 0 \ |
| 3068 | -C "signed using.*ECDSA with SHA256" \ |
| 3069 | -c "signed using.*ECDSA with SHA1" |
| 3070 | |
| 3071 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 3072 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3073 | key_file=data_files/server5.key \ |
| 3074 | crt_file2=data_files/server5-sha1.crt \ |
| 3075 | key_file2=data_files/server5.key" \ |
| 3076 | "$P_CLI force_version=tls1" \ |
| 3077 | 0 \ |
| 3078 | -C "signed using.*ECDSA with SHA256" \ |
| 3079 | -c "signed using.*ECDSA with SHA1" |
| 3080 | |
| 3081 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 3082 | "$P_SRV crt_file=data_files/server5.crt \ |
| 3083 | key_file=data_files/server5.key \ |
| 3084 | crt_file2=data_files/server6.crt \ |
| 3085 | key_file2=data_files/server6.key" \ |
| 3086 | "$P_CLI force_version=tls1_1" \ |
| 3087 | 0 \ |
| 3088 | -c "serial number.*09" \ |
| 3089 | -c "signed using.*ECDSA with SHA256" \ |
| 3090 | -C "signed using.*ECDSA with SHA1" |
| 3091 | |
| 3092 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 3093 | "$P_SRV crt_file=data_files/server6.crt \ |
| 3094 | key_file=data_files/server6.key \ |
| 3095 | crt_file2=data_files/server5.crt \ |
| 3096 | key_file2=data_files/server5.key" \ |
| 3097 | "$P_CLI force_version=tls1_1" \ |
| 3098 | 0 \ |
| 3099 | -c "serial number.*0A" \ |
| 3100 | -c "signed using.*ECDSA with SHA256" \ |
| 3101 | -C "signed using.*ECDSA with SHA1" |
| 3102 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3103 | # tests for SNI |
| 3104 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3105 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3106 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3107 | 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] | 3108 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3109 | 0 \ |
| 3110 | -S "parse ServerName extension" \ |
| 3111 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3112 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3113 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3114 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3115 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3116 | 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] | 3117 | 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] | 3118 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3119 | 0 \ |
| 3120 | -s "parse ServerName extension" \ |
| 3121 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3122 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3123 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3124 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3125 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3126 | 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] | 3127 | 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] | 3128 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3129 | 0 \ |
| 3130 | -s "parse ServerName extension" \ |
| 3131 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3132 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3133 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3134 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3135 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3136 | 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] | 3137 | 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] | 3138 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3139 | 1 \ |
| 3140 | -s "parse ServerName extension" \ |
| 3141 | -s "ssl_sni_wrapper() returned" \ |
| 3142 | -s "mbedtls_ssl_handshake returned" \ |
| 3143 | -c "mbedtls_ssl_handshake returned" \ |
| 3144 | -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] | 3145 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3146 | run_test "SNI: client auth no override: optional" \ |
| 3147 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3148 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3149 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3150 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3151 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3152 | -S "skip write certificate request" \ |
| 3153 | -C "skip parse certificate request" \ |
| 3154 | -c "got a certificate request" \ |
| 3155 | -C "skip write certificate" \ |
| 3156 | -C "skip write certificate verify" \ |
| 3157 | -S "skip parse certificate verify" |
| 3158 | |
| 3159 | run_test "SNI: client auth override: none -> optional" \ |
| 3160 | "$P_SRV debug_level=3 auth_mode=none \ |
| 3161 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3162 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3163 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3164 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3165 | -S "skip write certificate request" \ |
| 3166 | -C "skip parse certificate request" \ |
| 3167 | -c "got a certificate request" \ |
| 3168 | -C "skip write certificate" \ |
| 3169 | -C "skip write certificate verify" \ |
| 3170 | -S "skip parse certificate verify" |
| 3171 | |
| 3172 | run_test "SNI: client auth override: optional -> none" \ |
| 3173 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3174 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3175 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3176 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3177 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3178 | -s "skip write certificate request" \ |
| 3179 | -C "skip parse certificate request" \ |
| 3180 | -c "got no certificate request" \ |
| 3181 | -c "skip write certificate" \ |
| 3182 | -c "skip write certificate verify" \ |
| 3183 | -s "skip parse certificate verify" |
| 3184 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3185 | run_test "SNI: CA no override" \ |
| 3186 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3187 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3188 | ca_file=data_files/test-ca.crt \ |
| 3189 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3190 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3191 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3192 | 1 \ |
| 3193 | -S "skip write certificate request" \ |
| 3194 | -C "skip parse certificate request" \ |
| 3195 | -c "got a certificate request" \ |
| 3196 | -C "skip write certificate" \ |
| 3197 | -C "skip write certificate verify" \ |
| 3198 | -S "skip parse certificate verify" \ |
| 3199 | -s "x509_verify_cert() returned" \ |
| 3200 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3201 | -S "The certificate has been revoked (is on a CRL)" |
| 3202 | |
| 3203 | run_test "SNI: CA override" \ |
| 3204 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3205 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3206 | ca_file=data_files/test-ca.crt \ |
| 3207 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3208 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3209 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3210 | 0 \ |
| 3211 | -S "skip write certificate request" \ |
| 3212 | -C "skip parse certificate request" \ |
| 3213 | -c "got a certificate request" \ |
| 3214 | -C "skip write certificate" \ |
| 3215 | -C "skip write certificate verify" \ |
| 3216 | -S "skip parse certificate verify" \ |
| 3217 | -S "x509_verify_cert() returned" \ |
| 3218 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3219 | -S "The certificate has been revoked (is on a CRL)" |
| 3220 | |
| 3221 | run_test "SNI: CA override with CRL" \ |
| 3222 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3223 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3224 | ca_file=data_files/test-ca.crt \ |
| 3225 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3226 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3227 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3228 | 1 \ |
| 3229 | -S "skip write certificate request" \ |
| 3230 | -C "skip parse certificate request" \ |
| 3231 | -c "got a certificate request" \ |
| 3232 | -C "skip write certificate" \ |
| 3233 | -C "skip write certificate verify" \ |
| 3234 | -S "skip parse certificate verify" \ |
| 3235 | -s "x509_verify_cert() returned" \ |
| 3236 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3237 | -s "The certificate has been revoked (is on a CRL)" |
| 3238 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3239 | # Tests for SNI and DTLS |
| 3240 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3241 | run_test "SNI: DTLS, no SNI callback" \ |
| 3242 | "$P_SRV debug_level=3 dtls=1 \ |
| 3243 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 3244 | "$P_CLI server_name=localhost dtls=1" \ |
| 3245 | 0 \ |
| 3246 | -S "parse ServerName extension" \ |
| 3247 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3248 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3249 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3250 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3251 | "$P_SRV debug_level=3 dtls=1 \ |
| 3252 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3253 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3254 | "$P_CLI server_name=localhost dtls=1" \ |
| 3255 | 0 \ |
| 3256 | -s "parse ServerName extension" \ |
| 3257 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3258 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3259 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3260 | run_test "SNI: DTLS, matching cert 2" \ |
| 3261 | "$P_SRV debug_level=3 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,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3264 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 3265 | 0 \ |
| 3266 | -s "parse ServerName extension" \ |
| 3267 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3268 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 3269 | |
| 3270 | run_test "SNI: DTLS, no matching cert" \ |
| 3271 | "$P_SRV debug_level=3 dtls=1 \ |
| 3272 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3273 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3274 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 3275 | 1 \ |
| 3276 | -s "parse ServerName extension" \ |
| 3277 | -s "ssl_sni_wrapper() returned" \ |
| 3278 | -s "mbedtls_ssl_handshake returned" \ |
| 3279 | -c "mbedtls_ssl_handshake returned" \ |
| 3280 | -c "SSL - A fatal alert message was received from our peer" |
| 3281 | |
| 3282 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 3283 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3284 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3285 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3286 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3287 | 0 \ |
| 3288 | -S "skip write certificate request" \ |
| 3289 | -C "skip parse certificate request" \ |
| 3290 | -c "got a certificate request" \ |
| 3291 | -C "skip write certificate" \ |
| 3292 | -C "skip write certificate verify" \ |
| 3293 | -S "skip parse certificate verify" |
| 3294 | |
| 3295 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 3296 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 3297 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3298 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3299 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3300 | 0 \ |
| 3301 | -S "skip write certificate request" \ |
| 3302 | -C "skip parse certificate request" \ |
| 3303 | -c "got a certificate request" \ |
| 3304 | -C "skip write certificate" \ |
| 3305 | -C "skip write certificate verify" \ |
| 3306 | -S "skip parse certificate verify" |
| 3307 | |
| 3308 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 3309 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3310 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3311 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3312 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3313 | 0 \ |
| 3314 | -s "skip write certificate request" \ |
| 3315 | -C "skip parse certificate request" \ |
| 3316 | -c "got no certificate request" \ |
| 3317 | -c "skip write certificate" \ |
| 3318 | -c "skip write certificate verify" \ |
| 3319 | -s "skip parse certificate verify" |
| 3320 | |
| 3321 | run_test "SNI: DTLS, CA no override" \ |
| 3322 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3323 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3324 | ca_file=data_files/test-ca.crt \ |
| 3325 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3326 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3327 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3328 | 1 \ |
| 3329 | -S "skip write certificate request" \ |
| 3330 | -C "skip parse certificate request" \ |
| 3331 | -c "got a certificate request" \ |
| 3332 | -C "skip write certificate" \ |
| 3333 | -C "skip write certificate verify" \ |
| 3334 | -S "skip parse certificate verify" \ |
| 3335 | -s "x509_verify_cert() returned" \ |
| 3336 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3337 | -S "The certificate has been revoked (is on a CRL)" |
| 3338 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3339 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3340 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3341 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3342 | ca_file=data_files/test-ca.crt \ |
| 3343 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3344 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3345 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3346 | 0 \ |
| 3347 | -S "skip write certificate request" \ |
| 3348 | -C "skip parse certificate request" \ |
| 3349 | -c "got a certificate request" \ |
| 3350 | -C "skip write certificate" \ |
| 3351 | -C "skip write certificate verify" \ |
| 3352 | -S "skip parse certificate verify" \ |
| 3353 | -S "x509_verify_cert() returned" \ |
| 3354 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3355 | -S "The certificate has been revoked (is on a CRL)" |
| 3356 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3357 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3358 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3359 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 3360 | ca_file=data_files/test-ca.crt \ |
| 3361 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3362 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3363 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3364 | 1 \ |
| 3365 | -S "skip write certificate request" \ |
| 3366 | -C "skip parse certificate request" \ |
| 3367 | -c "got a certificate request" \ |
| 3368 | -C "skip write certificate" \ |
| 3369 | -C "skip write certificate verify" \ |
| 3370 | -S "skip parse certificate verify" \ |
| 3371 | -s "x509_verify_cert() returned" \ |
| 3372 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3373 | -s "The certificate has been revoked (is on a CRL)" |
| 3374 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3375 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 3376 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3377 | run_test "Non-blocking I/O: basic handshake" \ |
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" \ |
| 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 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3385 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3386 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 3387 | "$P_CLI nbio=2 tickets=0" \ |
| 3388 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3389 | -S "mbedtls_ssl_handshake returned" \ |
| 3390 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3391 | -c "Read from server: .* bytes read" |
| 3392 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3393 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3394 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3395 | "$P_CLI nbio=2 tickets=1" \ |
| 3396 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3397 | -S "mbedtls_ssl_handshake returned" \ |
| 3398 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3399 | -c "Read from server: .* bytes read" |
| 3400 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3401 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3402 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3403 | "$P_CLI nbio=2 tickets=1" \ |
| 3404 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3405 | -S "mbedtls_ssl_handshake returned" \ |
| 3406 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3407 | -c "Read from server: .* bytes read" |
| 3408 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3409 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3410 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3411 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3412 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3413 | -S "mbedtls_ssl_handshake returned" \ |
| 3414 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3415 | -c "Read from server: .* bytes read" |
| 3416 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3417 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3418 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3419 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3420 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3421 | -S "mbedtls_ssl_handshake returned" \ |
| 3422 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3423 | -c "Read from server: .* bytes read" |
| 3424 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3425 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3426 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3427 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 3428 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3429 | -S "mbedtls_ssl_handshake returned" \ |
| 3430 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3431 | -c "Read from server: .* bytes read" |
| 3432 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 3433 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 3434 | |
| 3435 | run_test "Event-driven I/O: basic handshake" \ |
| 3436 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3437 | "$P_CLI event=1 tickets=0" \ |
| 3438 | 0 \ |
| 3439 | -S "mbedtls_ssl_handshake returned" \ |
| 3440 | -C "mbedtls_ssl_handshake returned" \ |
| 3441 | -c "Read from server: .* bytes read" |
| 3442 | |
| 3443 | run_test "Event-driven I/O: client auth" \ |
| 3444 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 3445 | "$P_CLI event=1 tickets=0" \ |
| 3446 | 0 \ |
| 3447 | -S "mbedtls_ssl_handshake returned" \ |
| 3448 | -C "mbedtls_ssl_handshake returned" \ |
| 3449 | -c "Read from server: .* bytes read" |
| 3450 | |
| 3451 | run_test "Event-driven I/O: ticket" \ |
| 3452 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3453 | "$P_CLI event=1 tickets=1" \ |
| 3454 | 0 \ |
| 3455 | -S "mbedtls_ssl_handshake returned" \ |
| 3456 | -C "mbedtls_ssl_handshake returned" \ |
| 3457 | -c "Read from server: .* bytes read" |
| 3458 | |
| 3459 | run_test "Event-driven I/O: ticket + client auth" \ |
| 3460 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3461 | "$P_CLI event=1 tickets=1" \ |
| 3462 | 0 \ |
| 3463 | -S "mbedtls_ssl_handshake returned" \ |
| 3464 | -C "mbedtls_ssl_handshake returned" \ |
| 3465 | -c "Read from server: .* bytes read" |
| 3466 | |
| 3467 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 3468 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3469 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3470 | 0 \ |
| 3471 | -S "mbedtls_ssl_handshake returned" \ |
| 3472 | -C "mbedtls_ssl_handshake returned" \ |
| 3473 | -c "Read from server: .* bytes read" |
| 3474 | |
| 3475 | run_test "Event-driven I/O: ticket + resume" \ |
| 3476 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3477 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3478 | 0 \ |
| 3479 | -S "mbedtls_ssl_handshake returned" \ |
| 3480 | -C "mbedtls_ssl_handshake returned" \ |
| 3481 | -c "Read from server: .* bytes read" |
| 3482 | |
| 3483 | run_test "Event-driven I/O: session-id resume" \ |
| 3484 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3485 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 3486 | 0 \ |
| 3487 | -S "mbedtls_ssl_handshake returned" \ |
| 3488 | -C "mbedtls_ssl_handshake returned" \ |
| 3489 | -c "Read from server: .* bytes read" |
| 3490 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 3491 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 3492 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3493 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3494 | 0 \ |
| 3495 | -c "Read from server: .* bytes read" |
| 3496 | |
| 3497 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 3498 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3499 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3500 | 0 \ |
| 3501 | -c "Read from server: .* bytes read" |
| 3502 | |
| 3503 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 3504 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3505 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3506 | 0 \ |
| 3507 | -c "Read from server: .* bytes read" |
| 3508 | |
| 3509 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 3510 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3511 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3512 | 0 \ |
| 3513 | -c "Read from server: .* bytes read" |
| 3514 | |
| 3515 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 3516 | "$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] | 3517 | "$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] | 3518 | 0 \ |
| 3519 | -c "Read from server: .* bytes read" |
| 3520 | |
| 3521 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 3522 | "$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] | 3523 | "$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] | 3524 | 0 \ |
| 3525 | -c "Read from server: .* bytes read" |
| 3526 | |
| 3527 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 3528 | "$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] | 3529 | "$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] | 3530 | 0 \ |
| 3531 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3532 | |
| 3533 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3534 | # During session resumption, the client will send its ApplicationData record |
| 3535 | # within the same datagram as the Finished messages. In this situation, the |
| 3536 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3537 | # because the ApplicationData request has already been queued internally. |
| 3538 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3539 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3540 | "$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] | 3541 | "$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] | 3542 | 0 \ |
| 3543 | -c "Read from server: .* bytes read" |
| 3544 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3545 | # Tests for version negotiation |
| 3546 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3547 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3548 | "$P_SRV" \ |
| 3549 | "$P_CLI" \ |
| 3550 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3551 | -S "mbedtls_ssl_handshake returned" \ |
| 3552 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3553 | -s "Protocol is TLSv1.2" \ |
| 3554 | -c "Protocol is TLSv1.2" |
| 3555 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3556 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3557 | "$P_SRV" \ |
| 3558 | "$P_CLI max_version=tls1_1" \ |
| 3559 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3560 | -S "mbedtls_ssl_handshake returned" \ |
| 3561 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3562 | -s "Protocol is TLSv1.1" \ |
| 3563 | -c "Protocol is TLSv1.1" |
| 3564 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3565 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3566 | "$P_SRV max_version=tls1_1" \ |
| 3567 | "$P_CLI" \ |
| 3568 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3569 | -S "mbedtls_ssl_handshake returned" \ |
| 3570 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3571 | -s "Protocol is TLSv1.1" \ |
| 3572 | -c "Protocol is TLSv1.1" |
| 3573 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3574 | 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] | 3575 | "$P_SRV max_version=tls1_1" \ |
| 3576 | "$P_CLI max_version=tls1_1" \ |
| 3577 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3578 | -S "mbedtls_ssl_handshake returned" \ |
| 3579 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3580 | -s "Protocol is TLSv1.1" \ |
| 3581 | -c "Protocol is TLSv1.1" |
| 3582 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3583 | 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] | 3584 | "$P_SRV min_version=tls1_1" \ |
| 3585 | "$P_CLI max_version=tls1_1" \ |
| 3586 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3587 | -S "mbedtls_ssl_handshake returned" \ |
| 3588 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3589 | -s "Protocol is TLSv1.1" \ |
| 3590 | -c "Protocol is TLSv1.1" |
| 3591 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3592 | 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] | 3593 | "$P_SRV max_version=tls1_1" \ |
| 3594 | "$P_CLI min_version=tls1_1" \ |
| 3595 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3596 | -S "mbedtls_ssl_handshake returned" \ |
| 3597 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3598 | -s "Protocol is TLSv1.1" \ |
| 3599 | -c "Protocol is TLSv1.1" |
| 3600 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3601 | 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] | 3602 | "$P_SRV max_version=tls1_1" \ |
| 3603 | "$P_CLI min_version=tls1_2" \ |
| 3604 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3605 | -s "mbedtls_ssl_handshake returned" \ |
| 3606 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3607 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3608 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3609 | 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] | 3610 | "$P_SRV min_version=tls1_2" \ |
| 3611 | "$P_CLI max_version=tls1_1" \ |
| 3612 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3613 | -s "mbedtls_ssl_handshake returned" \ |
| 3614 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3615 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3616 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3617 | # Tests for ALPN extension |
| 3618 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3619 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3620 | "$P_SRV debug_level=3" \ |
| 3621 | "$P_CLI debug_level=3" \ |
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" \ |
| 3629 | -S "Application Layer Protocol is" |
| 3630 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3631 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3632 | "$P_SRV debug_level=3" \ |
| 3633 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
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 (none)" \ |
| 3641 | -S "Application Layer Protocol is" |
| 3642 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3643 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3644 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3645 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3646 | 0 \ |
| 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" \ |
| 3653 | -s "Application Layer Protocol is (none)" |
| 3654 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3655 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3656 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3657 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3658 | 0 \ |
| 3659 | -c "client hello, adding alpn extension" \ |
| 3660 | -s "found alpn extension" \ |
| 3661 | -C "got an alert message, type: \\[2:120]" \ |
| 3662 | -s "server hello, adding alpn extension" \ |
| 3663 | -c "found alpn extension" \ |
| 3664 | -c "Application Layer Protocol is abc" \ |
| 3665 | -s "Application Layer Protocol is abc" |
| 3666 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3667 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3668 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3669 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3670 | 0 \ |
| 3671 | -c "client hello, adding alpn extension" \ |
| 3672 | -s "found alpn extension" \ |
| 3673 | -C "got an alert message, type: \\[2:120]" \ |
| 3674 | -s "server hello, adding alpn extension" \ |
| 3675 | -c "found alpn extension" \ |
| 3676 | -c "Application Layer Protocol is abc" \ |
| 3677 | -s "Application Layer Protocol is abc" |
| 3678 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3679 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3680 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3681 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3682 | 0 \ |
| 3683 | -c "client hello, adding alpn extension" \ |
| 3684 | -s "found alpn extension" \ |
| 3685 | -C "got an alert message, type: \\[2:120]" \ |
| 3686 | -s "server hello, adding alpn extension" \ |
| 3687 | -c "found alpn extension" \ |
| 3688 | -c "Application Layer Protocol is 1234" \ |
| 3689 | -s "Application Layer Protocol is 1234" |
| 3690 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3691 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3692 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 3693 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3694 | 1 \ |
| 3695 | -c "client hello, adding alpn extension" \ |
| 3696 | -s "found alpn extension" \ |
| 3697 | -c "got an alert message, type: \\[2:120]" \ |
| 3698 | -S "server hello, adding alpn extension" \ |
| 3699 | -C "found alpn extension" \ |
| 3700 | -C "Application Layer Protocol is 1234" \ |
| 3701 | -S "Application Layer Protocol is 1234" |
| 3702 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3703 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3704 | # Tests for keyUsage in leaf certificates, part 1: |
| 3705 | # server-side certificate/suite selection |
| 3706 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3707 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3708 | "$P_SRV key_file=data_files/server2.key \ |
| 3709 | crt_file=data_files/server2.ku-ds.crt" \ |
| 3710 | "$P_CLI" \ |
| 3711 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3712 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3713 | |
| 3714 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3715 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3716 | "$P_SRV key_file=data_files/server2.key \ |
| 3717 | crt_file=data_files/server2.ku-ke.crt" \ |
| 3718 | "$P_CLI" \ |
| 3719 | 0 \ |
| 3720 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 3721 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3722 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3723 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3724 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3725 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3726 | 1 \ |
| 3727 | -C "Ciphersuite is " |
| 3728 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3729 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3730 | "$P_SRV key_file=data_files/server5.key \ |
| 3731 | crt_file=data_files/server5.ku-ds.crt" \ |
| 3732 | "$P_CLI" \ |
| 3733 | 0 \ |
| 3734 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 3735 | |
| 3736 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3737 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3738 | "$P_SRV key_file=data_files/server5.key \ |
| 3739 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3740 | "$P_CLI" \ |
| 3741 | 0 \ |
| 3742 | -c "Ciphersuite is TLS-ECDH-" |
| 3743 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3744 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3745 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3746 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3747 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3748 | 1 \ |
| 3749 | -C "Ciphersuite is " |
| 3750 | |
| 3751 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3752 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3753 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3754 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3755 | "$O_SRV -key data_files/server2.key \ |
| 3756 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3757 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3758 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3759 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3760 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3761 | -C "Processing of the Certificate handshake message failed" \ |
| 3762 | -c "Ciphersuite is TLS-" |
| 3763 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3764 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3765 | "$O_SRV -key data_files/server2.key \ |
| 3766 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3767 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3768 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3769 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3770 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3771 | -C "Processing of the Certificate handshake message failed" \ |
| 3772 | -c "Ciphersuite is TLS-" |
| 3773 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3774 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3775 | "$O_SRV -key data_files/server2.key \ |
| 3776 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3777 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3778 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3779 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3780 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3781 | -C "Processing of the Certificate handshake message failed" \ |
| 3782 | -c "Ciphersuite is TLS-" |
| 3783 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3784 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3785 | "$O_SRV -key data_files/server2.key \ |
| 3786 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3787 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3788 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3789 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3790 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3791 | -c "Processing of the Certificate handshake message failed" \ |
| 3792 | -C "Ciphersuite is TLS-" |
| 3793 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3794 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3795 | "$O_SRV -key data_files/server2.key \ |
| 3796 | -cert data_files/server2.ku-ke.crt" \ |
| 3797 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3798 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3799 | 0 \ |
| 3800 | -c "bad certificate (usage extensions)" \ |
| 3801 | -C "Processing of the Certificate handshake message failed" \ |
| 3802 | -c "Ciphersuite is TLS-" \ |
| 3803 | -c "! Usage does not match the keyUsage extension" |
| 3804 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3805 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3806 | "$O_SRV -key data_files/server2.key \ |
| 3807 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3808 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3809 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3810 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3811 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3812 | -C "Processing of the Certificate handshake message failed" \ |
| 3813 | -c "Ciphersuite is TLS-" |
| 3814 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3815 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3816 | "$O_SRV -key data_files/server2.key \ |
| 3817 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3818 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3819 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3820 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3821 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3822 | -c "Processing of the Certificate handshake message failed" \ |
| 3823 | -C "Ciphersuite is TLS-" |
| 3824 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3825 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3826 | "$O_SRV -key data_files/server2.key \ |
| 3827 | -cert data_files/server2.ku-ds.crt" \ |
| 3828 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3829 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3830 | 0 \ |
| 3831 | -c "bad certificate (usage extensions)" \ |
| 3832 | -C "Processing of the Certificate handshake message failed" \ |
| 3833 | -c "Ciphersuite is TLS-" \ |
| 3834 | -c "! Usage does not match the keyUsage extension" |
| 3835 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3836 | # Tests for keyUsage in leaf certificates, part 3: |
| 3837 | # server-side checking of client cert |
| 3838 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3839 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3840 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3841 | "$O_CLI -key data_files/server2.key \ |
| 3842 | -cert data_files/server2.ku-ds.crt" \ |
| 3843 | 0 \ |
| 3844 | -S "bad certificate (usage extensions)" \ |
| 3845 | -S "Processing of the Certificate handshake message failed" |
| 3846 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3847 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3848 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3849 | "$O_CLI -key data_files/server2.key \ |
| 3850 | -cert data_files/server2.ku-ke.crt" \ |
| 3851 | 0 \ |
| 3852 | -s "bad certificate (usage extensions)" \ |
| 3853 | -S "Processing of the Certificate handshake message failed" |
| 3854 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3855 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3856 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3857 | "$O_CLI -key data_files/server2.key \ |
| 3858 | -cert data_files/server2.ku-ke.crt" \ |
| 3859 | 1 \ |
| 3860 | -s "bad certificate (usage extensions)" \ |
| 3861 | -s "Processing of the Certificate handshake message failed" |
| 3862 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3863 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3864 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3865 | "$O_CLI -key data_files/server5.key \ |
| 3866 | -cert data_files/server5.ku-ds.crt" \ |
| 3867 | 0 \ |
| 3868 | -S "bad certificate (usage extensions)" \ |
| 3869 | -S "Processing of the Certificate handshake message failed" |
| 3870 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3871 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3872 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3873 | "$O_CLI -key data_files/server5.key \ |
| 3874 | -cert data_files/server5.ku-ka.crt" \ |
| 3875 | 0 \ |
| 3876 | -s "bad certificate (usage extensions)" \ |
| 3877 | -S "Processing of the Certificate handshake message failed" |
| 3878 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3879 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3880 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3881 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3882 | "$P_SRV key_file=data_files/server5.key \ |
| 3883 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3884 | "$P_CLI" \ |
| 3885 | 0 |
| 3886 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3887 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3888 | "$P_SRV key_file=data_files/server5.key \ |
| 3889 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3890 | "$P_CLI" \ |
| 3891 | 0 |
| 3892 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3893 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3894 | "$P_SRV key_file=data_files/server5.key \ |
| 3895 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3896 | "$P_CLI" \ |
| 3897 | 0 |
| 3898 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3899 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3900 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3901 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3902 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3903 | 1 |
| 3904 | |
| 3905 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3906 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3907 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3908 | "$O_SRV -key data_files/server5.key \ |
| 3909 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3910 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3911 | 0 \ |
| 3912 | -C "bad certificate (usage extensions)" \ |
| 3913 | -C "Processing of the Certificate handshake message failed" \ |
| 3914 | -c "Ciphersuite is TLS-" |
| 3915 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3916 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3917 | "$O_SRV -key data_files/server5.key \ |
| 3918 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3919 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3920 | 0 \ |
| 3921 | -C "bad certificate (usage extensions)" \ |
| 3922 | -C "Processing of the Certificate handshake message failed" \ |
| 3923 | -c "Ciphersuite is TLS-" |
| 3924 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3925 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3926 | "$O_SRV -key data_files/server5.key \ |
| 3927 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3928 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3929 | 0 \ |
| 3930 | -C "bad certificate (usage extensions)" \ |
| 3931 | -C "Processing of the Certificate handshake message failed" \ |
| 3932 | -c "Ciphersuite is TLS-" |
| 3933 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3934 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3935 | "$O_SRV -key data_files/server5.key \ |
| 3936 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3937 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3938 | 1 \ |
| 3939 | -c "bad certificate (usage extensions)" \ |
| 3940 | -c "Processing of the Certificate handshake message failed" \ |
| 3941 | -C "Ciphersuite is TLS-" |
| 3942 | |
| 3943 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3944 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3945 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3946 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3947 | "$O_CLI -key data_files/server5.key \ |
| 3948 | -cert data_files/server5.eku-cli.crt" \ |
| 3949 | 0 \ |
| 3950 | -S "bad certificate (usage extensions)" \ |
| 3951 | -S "Processing of the Certificate handshake message failed" |
| 3952 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3953 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3954 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3955 | "$O_CLI -key data_files/server5.key \ |
| 3956 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3957 | 0 \ |
| 3958 | -S "bad certificate (usage extensions)" \ |
| 3959 | -S "Processing of the Certificate handshake message failed" |
| 3960 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3961 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3962 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3963 | "$O_CLI -key data_files/server5.key \ |
| 3964 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3965 | 0 \ |
| 3966 | -S "bad certificate (usage extensions)" \ |
| 3967 | -S "Processing of the Certificate handshake message failed" |
| 3968 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3969 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3970 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3971 | "$O_CLI -key data_files/server5.key \ |
| 3972 | -cert data_files/server5.eku-cs.crt" \ |
| 3973 | 0 \ |
| 3974 | -s "bad certificate (usage extensions)" \ |
| 3975 | -S "Processing of the Certificate handshake message failed" |
| 3976 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3977 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3978 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3979 | "$O_CLI -key data_files/server5.key \ |
| 3980 | -cert data_files/server5.eku-cs.crt" \ |
| 3981 | 1 \ |
| 3982 | -s "bad certificate (usage extensions)" \ |
| 3983 | -s "Processing of the Certificate handshake message failed" |
| 3984 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3985 | # Tests for DHM parameters loading |
| 3986 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3987 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3988 | "$P_SRV" \ |
| 3989 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3990 | debug_level=3" \ |
| 3991 | 0 \ |
| 3992 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3993 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3994 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3995 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3996 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3997 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3998 | debug_level=3" \ |
| 3999 | 0 \ |
| 4000 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 4001 | -c "value of 'DHM: G ' (2 bits)" |
| 4002 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 4003 | # Tests for DHM client-side size checking |
| 4004 | |
| 4005 | run_test "DHM size: server default, client default, OK" \ |
| 4006 | "$P_SRV" \ |
| 4007 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4008 | debug_level=1" \ |
| 4009 | 0 \ |
| 4010 | -C "DHM prime too short:" |
| 4011 | |
| 4012 | run_test "DHM size: server default, client 2048, OK" \ |
| 4013 | "$P_SRV" \ |
| 4014 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4015 | debug_level=1 dhmlen=2048" \ |
| 4016 | 0 \ |
| 4017 | -C "DHM prime too short:" |
| 4018 | |
| 4019 | run_test "DHM size: server 1024, client default, OK" \ |
| 4020 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 4021 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4022 | debug_level=1" \ |
| 4023 | 0 \ |
| 4024 | -C "DHM prime too short:" |
| 4025 | |
Gilles Peskine | 3e7b61c | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 4026 | run_test "DHM size: server 999, client 999, OK" \ |
| 4027 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 4028 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4029 | debug_level=1 dhmlen=999" \ |
| 4030 | 0 \ |
| 4031 | -C "DHM prime too short:" |
| 4032 | |
| 4033 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 4034 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 4035 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4036 | debug_level=1 dhmlen=1000" \ |
| 4037 | 0 \ |
| 4038 | -C "DHM prime too short:" |
| 4039 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 4040 | run_test "DHM size: server 1000, client default, rejected" \ |
| 4041 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 4042 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4043 | debug_level=1" \ |
| 4044 | 1 \ |
| 4045 | -c "DHM prime too short:" |
| 4046 | |
Gilles Peskine | 3e7b61c | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 4047 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 4048 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 4049 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4050 | debug_level=1 dhmlen=1001" \ |
| 4051 | 1 \ |
| 4052 | -c "DHM prime too short:" |
| 4053 | |
| 4054 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 4055 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 4056 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4057 | debug_level=1 dhmlen=1000" \ |
| 4058 | 1 \ |
| 4059 | -c "DHM prime too short:" |
| 4060 | |
| 4061 | run_test "DHM size: server 998, client 999, rejected" \ |
| 4062 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 4063 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4064 | debug_level=1 dhmlen=999" \ |
| 4065 | 1 \ |
| 4066 | -c "DHM prime too short:" |
| 4067 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 4068 | run_test "DHM size: server default, client 2049, rejected" \ |
| 4069 | "$P_SRV" \ |
| 4070 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 4071 | debug_level=1 dhmlen=2049" \ |
| 4072 | 1 \ |
| 4073 | -c "DHM prime too short:" |
| 4074 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4075 | # Tests for PSK callback |
| 4076 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4077 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4078 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 4079 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4080 | psk_identity=foo psk=abc123" \ |
| 4081 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4082 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4083 | -S "SSL - Unknown identity received" \ |
| 4084 | -S "SSL - Verification of the message MAC failed" |
| 4085 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4086 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 4087 | "$P_SRV" \ |
| 4088 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4089 | psk_identity=foo psk=abc123" \ |
| 4090 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4091 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4092 | -S "SSL - Unknown identity received" \ |
| 4093 | -S "SSL - Verification of the message MAC failed" |
| 4094 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4095 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4096 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 4097 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4098 | psk_identity=foo psk=abc123" \ |
| 4099 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4100 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4101 | -s "SSL - Unknown identity received" \ |
| 4102 | -S "SSL - Verification of the message MAC failed" |
| 4103 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4104 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4105 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4106 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4107 | psk_identity=abc psk=dead" \ |
| 4108 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4109 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4110 | -S "SSL - Unknown identity received" \ |
| 4111 | -S "SSL - Verification of the message MAC failed" |
| 4112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4113 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4114 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4115 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4116 | psk_identity=def psk=beef" \ |
| 4117 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4118 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4119 | -S "SSL - Unknown identity received" \ |
| 4120 | -S "SSL - Verification of the message MAC failed" |
| 4121 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4122 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4123 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4124 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4125 | psk_identity=ghi psk=beef" \ |
| 4126 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4127 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4128 | -s "SSL - Unknown identity received" \ |
| 4129 | -S "SSL - Verification of the message MAC failed" |
| 4130 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4131 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4132 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 4133 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 4134 | psk_identity=abc psk=beef" \ |
| 4135 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 4136 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 4137 | -S "SSL - Unknown identity received" \ |
| 4138 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 4139 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4140 | # Tests for EC J-PAKE |
| 4141 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4142 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4143 | run_test "ECJPAKE: client not configured" \ |
| 4144 | "$P_SRV debug_level=3" \ |
| 4145 | "$P_CLI debug_level=3" \ |
| 4146 | 0 \ |
| 4147 | -C "add ciphersuite: c0ff" \ |
| 4148 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4149 | -S "found ecjpake kkpp extension" \ |
| 4150 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4151 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4152 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4153 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4154 | -S "None of the common ciphersuites is usable" |
| 4155 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4156 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4157 | run_test "ECJPAKE: server not configured" \ |
| 4158 | "$P_SRV debug_level=3" \ |
| 4159 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4160 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4161 | 1 \ |
| 4162 | -c "add ciphersuite: c0ff" \ |
| 4163 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4164 | -s "found ecjpake kkpp extension" \ |
| 4165 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4166 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4167 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4168 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4169 | -s "None of the common ciphersuites is usable" |
| 4170 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4171 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4172 | run_test "ECJPAKE: working, TLS" \ |
| 4173 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4174 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4175 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 4176 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4177 | -c "add ciphersuite: c0ff" \ |
| 4178 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4179 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4180 | -s "found ecjpake kkpp extension" \ |
| 4181 | -S "skip ecjpake kkpp extension" \ |
| 4182 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4183 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4184 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4185 | -S "None of the common ciphersuites is usable" \ |
| 4186 | -S "SSL - Verification of the message MAC failed" |
| 4187 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4188 | server_needs_more_time 1 |
Dave Rodgman | cee9e92 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 4189 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4190 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 4191 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4192 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 4193 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4194 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4195 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4196 | -s "SSL - Verification of the message MAC failed" |
| 4197 | |
Dave Rodgman | cee9e92 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 4198 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4199 | run_test "ECJPAKE: working, DTLS" \ |
| 4200 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4201 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4202 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4203 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4204 | -c "re-using cached ecjpake parameters" \ |
| 4205 | -S "SSL - Verification of the message MAC failed" |
| 4206 | |
Dave Rodgman | cee9e92 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 4207 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4208 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 4209 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 4210 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4211 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4212 | 0 \ |
| 4213 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4214 | -S "SSL - Verification of the message MAC failed" |
| 4215 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4216 | server_needs_more_time 1 |
Dave Rodgman | cee9e92 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 4217 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4218 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 4219 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4220 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 4221 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4222 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4223 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4224 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4225 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4226 | # for tests with configs/config-thread.h |
Dave Rodgman | cee9e92 | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 4227 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4228 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 4229 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 4230 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 4231 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4232 | 0 |
| 4233 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4234 | # Tests for ciphersuites per version |
| 4235 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4236 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4237 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4238 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4239 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4240 | "$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] | 4241 | "$P_CLI force_version=ssl3" \ |
| 4242 | 0 \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4243 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4244 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4245 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 4246 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4247 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4248 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4249 | "$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] | 4250 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4251 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4252 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4253 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4254 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4255 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4256 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4257 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4258 | "$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] | 4259 | "$P_CLI force_version=tls1_1" \ |
| 4260 | 0 \ |
| 4261 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 4262 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4263 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4264 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4265 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4266 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4267 | "$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] | 4268 | "$P_CLI force_version=tls1_2" \ |
| 4269 | 0 \ |
| 4270 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 4271 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4272 | # Test for ClientHello without extensions |
| 4273 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 4274 | requires_gnutls |
Manuel Pégourié-Gonnard | d20ae89 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 4275 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 7c9add2 | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 4276 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4277 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4278 | 0 \ |
| 4279 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4280 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4281 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4282 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4283 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4284 | "$P_SRV" \ |
| 4285 | "$P_CLI request_size=100" \ |
| 4286 | 0 \ |
| 4287 | -s "Read from client: 100 bytes read$" |
| 4288 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4289 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4290 | "$P_SRV" \ |
| 4291 | "$P_CLI request_size=500" \ |
| 4292 | 0 \ |
| 4293 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4294 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4295 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4296 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4297 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4298 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4299 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4300 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4301 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4302 | 0 \ |
| 4303 | -s "Read from client: 1 bytes read" |
| 4304 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4305 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4306 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4307 | "$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] | 4308 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4309 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4310 | 0 \ |
| 4311 | -s "Read from client: 1 bytes read" |
| 4312 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4313 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4314 | "$P_SRV" \ |
| 4315 | "$P_CLI request_size=1 force_version=tls1 \ |
| 4316 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4317 | 0 \ |
| 4318 | -s "Read from client: 1 bytes read" |
| 4319 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4320 | 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] | 4321 | "$P_SRV" \ |
| 4322 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 4323 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4324 | 0 \ |
| 4325 | -s "Read from client: 1 bytes read" |
| 4326 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4327 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4328 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4329 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4330 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4331 | 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] | 4332 | 0 \ |
| 4333 | -s "Read from client: 1 bytes read" |
| 4334 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4335 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4336 | 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] | 4337 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4338 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4339 | 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] | 4340 | 0 \ |
| 4341 | -s "Read from client: 1 bytes read" |
| 4342 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4343 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4344 | "$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] | 4345 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4346 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4347 | 0 \ |
| 4348 | -s "Read from client: 1 bytes read" |
| 4349 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4350 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4351 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4352 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4353 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4354 | 0 \ |
| 4355 | -s "Read from client: 1 bytes read" |
| 4356 | |
| 4357 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4358 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4359 | "$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] | 4360 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4361 | 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] | 4362 | 0 \ |
| 4363 | -s "Read from client: 1 bytes read" |
| 4364 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4365 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4366 | 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] | 4367 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4368 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4369 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4370 | 0 \ |
| 4371 | -s "Read from client: 1 bytes read" |
| 4372 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4373 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4374 | "$P_SRV" \ |
| 4375 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4376 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4377 | 0 \ |
| 4378 | -s "Read from client: 1 bytes read" |
| 4379 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4380 | 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] | 4381 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4382 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4383 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4384 | 0 \ |
| 4385 | -s "Read from client: 1 bytes read" |
| 4386 | |
| 4387 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4388 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4389 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4390 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4391 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4392 | 0 \ |
| 4393 | -s "Read from client: 1 bytes read" |
| 4394 | |
| 4395 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4396 | 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] | 4397 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4398 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4399 | 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] | 4400 | 0 \ |
| 4401 | -s "Read from client: 1 bytes read" |
| 4402 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4403 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4404 | "$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] | 4405 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4406 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4407 | 0 \ |
| 4408 | -s "Read from client: 1 bytes read" |
| 4409 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4410 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4411 | "$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] | 4412 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4413 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4414 | 0 \ |
| 4415 | -s "Read from client: 1 bytes read" |
| 4416 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4417 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4418 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4419 | "$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] | 4420 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4421 | 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] | 4422 | 0 \ |
| 4423 | -s "Read from client: 1 bytes read" |
| 4424 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4425 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4426 | 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] | 4427 | "$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] | 4428 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4429 | 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] | 4430 | 0 \ |
| 4431 | -s "Read from client: 1 bytes read" |
| 4432 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4433 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4434 | "$P_SRV" \ |
| 4435 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4436 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4437 | 0 \ |
| 4438 | -s "Read from client: 1 bytes read" |
| 4439 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4440 | 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] | 4441 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4442 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4443 | 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] | 4444 | 0 \ |
| 4445 | -s "Read from client: 1 bytes read" |
| 4446 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4447 | 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] | 4448 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4449 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4450 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4451 | 0 \ |
| 4452 | -s "Read from client: 1 bytes read" |
| 4453 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4454 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4455 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4456 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4457 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4458 | 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] | 4459 | 0 \ |
| 4460 | -s "Read from client: 1 bytes read" |
| 4461 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4462 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4463 | 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] | 4464 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4465 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4466 | 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] | 4467 | 0 \ |
| 4468 | -s "Read from client: 1 bytes read" |
| 4469 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4470 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4471 | "$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] | 4472 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4473 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4474 | 0 \ |
| 4475 | -s "Read from client: 1 bytes read" |
| 4476 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4477 | 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] | 4478 | "$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] | 4479 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4480 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4481 | 0 \ |
| 4482 | -s "Read from client: 1 bytes read" |
| 4483 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4484 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4485 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4486 | "$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] | 4487 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4488 | 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] | 4489 | 0 \ |
| 4490 | -s "Read from client: 1 bytes read" |
| 4491 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4492 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4493 | 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] | 4494 | "$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] | 4495 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4496 | 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] | 4497 | 0 \ |
| 4498 | -s "Read from client: 1 bytes read" |
| 4499 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4500 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4501 | "$P_SRV" \ |
| 4502 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4503 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4504 | 0 \ |
| 4505 | -s "Read from client: 1 bytes read" |
| 4506 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4507 | 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] | 4508 | "$P_SRV" \ |
| 4509 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4510 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4511 | 0 \ |
| 4512 | -s "Read from client: 1 bytes read" |
| 4513 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4514 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4515 | |
| 4516 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4517 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4518 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 4519 | "$P_CLI dtls=1 request_size=1 \ |
| 4520 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4521 | 0 \ |
| 4522 | -s "Read from client: 1 bytes read" |
| 4523 | |
| 4524 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4525 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4526 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 4527 | "$P_CLI dtls=1 request_size=1 \ |
| 4528 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4529 | 0 \ |
| 4530 | -s "Read from client: 1 bytes read" |
| 4531 | |
| 4532 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4533 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4534 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4535 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 4536 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4537 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4538 | 0 \ |
| 4539 | -s "Read from client: 1 bytes read" |
| 4540 | |
| 4541 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4542 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4543 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4544 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4545 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4546 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4547 | 0 \ |
| 4548 | -s "Read from client: 1 bytes read" |
| 4549 | |
| 4550 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4551 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4552 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 4553 | "$P_CLI dtls=1 request_size=1 \ |
| 4554 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4555 | 0 \ |
| 4556 | -s "Read from client: 1 bytes read" |
| 4557 | |
| 4558 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4559 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4560 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4561 | "$P_CLI dtls=1 request_size=1 \ |
| 4562 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4563 | 0 \ |
| 4564 | -s "Read from client: 1 bytes read" |
| 4565 | |
| 4566 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4567 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4568 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4569 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4570 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4571 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4572 | 0 \ |
| 4573 | -s "Read from client: 1 bytes read" |
| 4574 | |
| 4575 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4576 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4577 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4578 | "$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] | 4579 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4580 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4581 | 0 \ |
| 4582 | -s "Read from client: 1 bytes read" |
| 4583 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4584 | # Tests for small server packets |
| 4585 | |
| 4586 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4587 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 4588 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 4589 | "$P_CLI force_version=ssl3 \ |
| 4590 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4591 | 0 \ |
| 4592 | -c "Read from server: 1 bytes read" |
| 4593 | |
| 4594 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4595 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 4596 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4597 | "$P_CLI force_version=ssl3 \ |
| 4598 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4599 | 0 \ |
| 4600 | -c "Read from server: 1 bytes read" |
| 4601 | |
| 4602 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 4603 | "$P_SRV response_size=1" \ |
| 4604 | "$P_CLI force_version=tls1 \ |
| 4605 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4606 | 0 \ |
| 4607 | -c "Read from server: 1 bytes read" |
| 4608 | |
| 4609 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 4610 | "$P_SRV response_size=1" \ |
| 4611 | "$P_CLI force_version=tls1 etm=0 \ |
| 4612 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4613 | 0 \ |
| 4614 | -c "Read from server: 1 bytes read" |
| 4615 | |
| 4616 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4617 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 4618 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4619 | "$P_CLI force_version=tls1 \ |
| 4620 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4621 | 0 \ |
| 4622 | -c "Read from server: 1 bytes read" |
| 4623 | |
| 4624 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4625 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 4626 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4627 | "$P_CLI force_version=tls1 \ |
| 4628 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4629 | 0 \ |
| 4630 | -c "Read from server: 1 bytes read" |
| 4631 | |
| 4632 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 4633 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4634 | "$P_CLI force_version=tls1 \ |
| 4635 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4636 | 0 \ |
| 4637 | -c "Read from server: 1 bytes read" |
| 4638 | |
| 4639 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 4640 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4641 | "$P_CLI force_version=tls1 \ |
| 4642 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4643 | 0 \ |
| 4644 | -c "Read from server: 1 bytes read" |
| 4645 | |
| 4646 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4647 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 4648 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4649 | "$P_CLI force_version=tls1 \ |
| 4650 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4651 | 0 \ |
| 4652 | -c "Read from server: 1 bytes read" |
| 4653 | |
| 4654 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4655 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 4656 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4657 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4658 | trunc_hmac=1 etm=0" \ |
| 4659 | 0 \ |
| 4660 | -c "Read from server: 1 bytes read" |
| 4661 | |
| 4662 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 4663 | "$P_SRV response_size=1" \ |
| 4664 | "$P_CLI force_version=tls1_1 \ |
| 4665 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4666 | 0 \ |
| 4667 | -c "Read from server: 1 bytes read" |
| 4668 | |
| 4669 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 4670 | "$P_SRV response_size=1" \ |
| 4671 | "$P_CLI force_version=tls1_1 \ |
| 4672 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4673 | 0 \ |
| 4674 | -c "Read from server: 1 bytes read" |
| 4675 | |
| 4676 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4677 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 4678 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4679 | "$P_CLI force_version=tls1_1 \ |
| 4680 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4681 | 0 \ |
| 4682 | -c "Read from server: 1 bytes read" |
| 4683 | |
| 4684 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4685 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 4686 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4687 | "$P_CLI force_version=tls1_1 \ |
| 4688 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4689 | 0 \ |
| 4690 | -c "Read from server: 1 bytes read" |
| 4691 | |
| 4692 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 4693 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4694 | "$P_CLI force_version=tls1_1 \ |
| 4695 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4696 | 0 \ |
| 4697 | -c "Read from server: 1 bytes read" |
| 4698 | |
| 4699 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 4700 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4701 | "$P_CLI force_version=tls1_1 \ |
| 4702 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4703 | 0 \ |
| 4704 | -c "Read from server: 1 bytes read" |
| 4705 | |
| 4706 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4707 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 4708 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4709 | "$P_CLI force_version=tls1_1 \ |
| 4710 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4711 | 0 \ |
| 4712 | -c "Read from server: 1 bytes read" |
| 4713 | |
| 4714 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4715 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 4716 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4717 | "$P_CLI force_version=tls1_1 \ |
| 4718 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4719 | 0 \ |
| 4720 | -c "Read from server: 1 bytes read" |
| 4721 | |
| 4722 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 4723 | "$P_SRV response_size=1" \ |
| 4724 | "$P_CLI force_version=tls1_2 \ |
| 4725 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4726 | 0 \ |
| 4727 | -c "Read from server: 1 bytes read" |
| 4728 | |
| 4729 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 4730 | "$P_SRV response_size=1" \ |
| 4731 | "$P_CLI force_version=tls1_2 \ |
| 4732 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4733 | 0 \ |
| 4734 | -c "Read from server: 1 bytes read" |
| 4735 | |
| 4736 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 4737 | "$P_SRV response_size=1" \ |
| 4738 | "$P_CLI force_version=tls1_2 \ |
| 4739 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 4740 | 0 \ |
| 4741 | -c "Read from server: 1 bytes read" |
| 4742 | |
| 4743 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4744 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 4745 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4746 | "$P_CLI force_version=tls1_2 \ |
| 4747 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4748 | 0 \ |
| 4749 | -c "Read from server: 1 bytes read" |
| 4750 | |
| 4751 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4752 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 4753 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4754 | "$P_CLI force_version=tls1_2 \ |
| 4755 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4756 | 0 \ |
| 4757 | -c "Read from server: 1 bytes read" |
| 4758 | |
| 4759 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 4760 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4761 | "$P_CLI force_version=tls1_2 \ |
| 4762 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4763 | 0 \ |
| 4764 | -c "Read from server: 1 bytes read" |
| 4765 | |
| 4766 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 4767 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4768 | "$P_CLI force_version=tls1_2 \ |
| 4769 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4770 | 0 \ |
| 4771 | -c "Read from server: 1 bytes read" |
| 4772 | |
| 4773 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4774 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 4775 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4776 | "$P_CLI force_version=tls1_2 \ |
| 4777 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4778 | 0 \ |
| 4779 | -c "Read from server: 1 bytes read" |
| 4780 | |
| 4781 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4782 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 4783 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4784 | "$P_CLI force_version=tls1_2 \ |
| 4785 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4786 | 0 \ |
| 4787 | -c "Read from server: 1 bytes read" |
| 4788 | |
| 4789 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 4790 | "$P_SRV response_size=1" \ |
| 4791 | "$P_CLI force_version=tls1_2 \ |
| 4792 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4793 | 0 \ |
| 4794 | -c "Read from server: 1 bytes read" |
| 4795 | |
| 4796 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 4797 | "$P_SRV response_size=1" \ |
| 4798 | "$P_CLI force_version=tls1_2 \ |
| 4799 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4800 | 0 \ |
| 4801 | -c "Read from server: 1 bytes read" |
| 4802 | |
| 4803 | # Tests for small server packets in DTLS |
| 4804 | |
| 4805 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4806 | run_test "Small server packet DTLS 1.0" \ |
| 4807 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 4808 | "$P_CLI dtls=1 \ |
| 4809 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4810 | 0 \ |
| 4811 | -c "Read from server: 1 bytes read" |
| 4812 | |
| 4813 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4814 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 4815 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 4816 | "$P_CLI dtls=1 \ |
| 4817 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4818 | 0 \ |
| 4819 | -c "Read from server: 1 bytes read" |
| 4820 | |
| 4821 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4822 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4823 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 4824 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 4825 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 4826 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4827 | 0 \ |
| 4828 | -c "Read from server: 1 bytes read" |
| 4829 | |
| 4830 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4831 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4832 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 4833 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 4834 | "$P_CLI dtls=1 \ |
| 4835 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4836 | 0 \ |
| 4837 | -c "Read from server: 1 bytes read" |
| 4838 | |
| 4839 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4840 | run_test "Small server packet DTLS 1.2" \ |
| 4841 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 4842 | "$P_CLI dtls=1 \ |
| 4843 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4844 | 0 \ |
| 4845 | -c "Read from server: 1 bytes read" |
| 4846 | |
| 4847 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4848 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 4849 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 4850 | "$P_CLI dtls=1 \ |
| 4851 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4852 | 0 \ |
| 4853 | -c "Read from server: 1 bytes read" |
| 4854 | |
| 4855 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4856 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4857 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 4858 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 4859 | "$P_CLI dtls=1 \ |
| 4860 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4861 | 0 \ |
| 4862 | -c "Read from server: 1 bytes read" |
| 4863 | |
| 4864 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4865 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4866 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 4867 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 4868 | "$P_CLI dtls=1 \ |
| 4869 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4870 | 0 \ |
| 4871 | -c "Read from server: 1 bytes read" |
| 4872 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4873 | # A test for extensions in SSLv3 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 4874 | requires_max_content_len 4096 |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4875 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4876 | run_test "SSLv3 with extensions, server side" \ |
| 4877 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 4878 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 4879 | 0 \ |
| 4880 | -S "dumping 'client hello extensions'" \ |
| 4881 | -S "server hello, total extension length:" |
| 4882 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4883 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4884 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4885 | # How many fragments do we expect to write $1 bytes? |
| 4886 | fragments_for_write() { |
| 4887 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 4888 | } |
| 4889 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4890 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4891 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4892 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4893 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4894 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4895 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4896 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4897 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4898 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4899 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4900 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4901 | "$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] | 4902 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4903 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4904 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4905 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4906 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4907 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4908 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4909 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4910 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4911 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4912 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4913 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4914 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4915 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4916 | 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] | 4917 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4918 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4919 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4920 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4921 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4922 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4923 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4924 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4925 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4926 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4927 | 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] | 4928 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4929 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4930 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4931 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4932 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4933 | 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] | 4934 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4935 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4936 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4937 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4938 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4939 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4940 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4941 | "$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] | 4942 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4943 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4944 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4945 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4946 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4947 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4948 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4949 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4950 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA 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 | |
| 4954 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4955 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4956 | "$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] | 4957 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4958 | 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] | 4959 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 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 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4962 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4963 | 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] | 4964 | "$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] | 4965 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4966 | 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] | 4967 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4968 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4969 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4970 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4971 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4972 | "$P_SRV" \ |
| 4973 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4974 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4975 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4976 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4977 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4978 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4979 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4980 | "$P_SRV" \ |
| 4981 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 4982 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
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 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4985 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4986 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4987 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4988 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4989 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4990 | 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] | 4991 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4992 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4993 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4994 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4995 | 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] | 4996 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4997 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4998 | 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] | 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.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5003 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5004 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 5005 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 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 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5010 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5011 | "$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] | 5012 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5013 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5014 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5015 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 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.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5020 | "$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] | 5021 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5022 | 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] | 5023 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5024 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5025 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5026 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5027 | 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] | 5028 | "$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] | 5029 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5030 | 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] | 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 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5036 | "$P_SRV" \ |
| 5037 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5038 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5039 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5040 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5041 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5042 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5043 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5044 | "$P_SRV" \ |
| 5045 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5046 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5047 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5048 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5049 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5050 | 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] | 5051 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5052 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5053 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5054 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5055 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5056 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5057 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5058 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5059 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5060 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5061 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5062 | 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] | 5063 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5064 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5065 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5066 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5067 | 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] | 5068 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5069 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5070 | 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] | 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 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5076 | "$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] | 5077 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5078 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5079 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5080 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5081 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5082 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5083 | 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] | 5084 | "$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] | 5085 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5086 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5087 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5088 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5089 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 5090 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5091 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5092 | "$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] | 5093 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5094 | 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] | 5095 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5096 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5097 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5098 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5099 | 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] | 5100 | "$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] | 5101 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5102 | 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] | 5103 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5104 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5105 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5106 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5107 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5108 | "$P_SRV" \ |
| 5109 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5110 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5111 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5112 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5113 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5114 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5115 | 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] | 5116 | "$P_SRV" \ |
| 5117 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5118 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5119 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5120 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5121 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5122 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5123 | # Test for large server packets |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 5124 | # The tests below fail when the server's OUT_CONTENT_LEN is less than 16384. |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5125 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5126 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 5127 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5128 | "$P_CLI force_version=ssl3 \ |
| 5129 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5130 | 0 \ |
| 5131 | -c "Read from server: 16384 bytes read" |
| 5132 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 5133 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 5134 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 5135 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 5136 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 5137 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 5138 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5139 | 0 \ |
| 5140 | -c "Read from server: 1 bytes read"\ |
| 5141 | -c "16383 bytes read"\ |
| 5142 | -C "Read from server: 16384 bytes read" |
| 5143 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5144 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 5145 | "$P_SRV response_size=16384" \ |
| 5146 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5147 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5148 | 0 \ |
| 5149 | -c "Read from server: 1 bytes read"\ |
| 5150 | -c "16383 bytes read"\ |
| 5151 | -C "Read from server: 16384 bytes read" |
| 5152 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5153 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 5154 | "$P_SRV response_size=16384" \ |
| 5155 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 5156 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5157 | 0 \ |
| 5158 | -c "Read from server: 1 bytes read"\ |
| 5159 | -c "16383 bytes read"\ |
| 5160 | -C "Read from server: 16384 bytes read" |
| 5161 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5162 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5163 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 5164 | "$P_SRV response_size=16384" \ |
| 5165 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5166 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5167 | trunc_hmac=1" \ |
| 5168 | 0 \ |
| 5169 | -c "Read from server: 1 bytes read"\ |
| 5170 | -c "16383 bytes read"\ |
| 5171 | -C "Read from server: 16384 bytes read" |
| 5172 | |
| 5173 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5174 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 5175 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5176 | "$P_CLI force_version=tls1 \ |
| 5177 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5178 | trunc_hmac=1" \ |
| 5179 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5180 | -s "16384 bytes written in 1 fragments" \ |
| 5181 | -c "Read from server: 16384 bytes read" |
| 5182 | |
| 5183 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 5184 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5185 | "$P_CLI force_version=tls1 \ |
| 5186 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5187 | 0 \ |
| 5188 | -s "16384 bytes written in 1 fragments" \ |
| 5189 | -c "Read from server: 16384 bytes read" |
| 5190 | |
| 5191 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5192 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5193 | "$P_CLI force_version=tls1 \ |
| 5194 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5195 | 0 \ |
| 5196 | -s "16384 bytes written in 1 fragments" \ |
| 5197 | -c "Read from server: 16384 bytes read" |
| 5198 | |
| 5199 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5200 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5201 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5202 | "$P_CLI force_version=tls1 \ |
| 5203 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5204 | 0 \ |
| 5205 | -s "16384 bytes written in 1 fragments" \ |
| 5206 | -c "Read from server: 16384 bytes read" |
| 5207 | |
| 5208 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5209 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5210 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5211 | "$P_CLI force_version=tls1 \ |
| 5212 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5213 | 0 \ |
| 5214 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5215 | -c "Read from server: 16384 bytes read" |
| 5216 | |
| 5217 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 5218 | "$P_SRV response_size=16384" \ |
| 5219 | "$P_CLI force_version=tls1_1 \ |
| 5220 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5221 | 0 \ |
| 5222 | -c "Read from server: 16384 bytes read" |
| 5223 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5224 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5225 | "$P_SRV response_size=16384" \ |
| 5226 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 5227 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5228 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5229 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5230 | -c "Read from server: 16384 bytes read" |
| 5231 | |
| 5232 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5233 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 5234 | "$P_SRV response_size=16384" \ |
| 5235 | "$P_CLI force_version=tls1_1 \ |
| 5236 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5237 | trunc_hmac=1" \ |
| 5238 | 0 \ |
| 5239 | -c "Read from server: 16384 bytes read" |
| 5240 | |
| 5241 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5242 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5243 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5244 | "$P_CLI force_version=tls1_1 \ |
| 5245 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5246 | 0 \ |
| 5247 | -s "16384 bytes written in 1 fragments" \ |
| 5248 | -c "Read from server: 16384 bytes read" |
| 5249 | |
| 5250 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 5251 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5252 | "$P_CLI force_version=tls1_1 \ |
| 5253 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5254 | 0 \ |
| 5255 | -c "Read from server: 16384 bytes read" |
| 5256 | |
| 5257 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5258 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5259 | "$P_CLI force_version=tls1_1 \ |
| 5260 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5261 | 0 \ |
| 5262 | -s "16384 bytes written in 1 fragments" \ |
| 5263 | -c "Read from server: 16384 bytes read" |
| 5264 | |
| 5265 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5266 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 5267 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5268 | "$P_CLI force_version=tls1_1 \ |
| 5269 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5270 | trunc_hmac=1" \ |
| 5271 | 0 \ |
| 5272 | -c "Read from server: 16384 bytes read" |
| 5273 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5274 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5275 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5276 | "$P_CLI force_version=tls1_1 \ |
| 5277 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5278 | 0 \ |
| 5279 | -s "16384 bytes written in 1 fragments" \ |
| 5280 | -c "Read from server: 16384 bytes read" |
| 5281 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5282 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5283 | "$P_SRV response_size=16384" \ |
| 5284 | "$P_CLI force_version=tls1_2 \ |
| 5285 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5286 | 0 \ |
| 5287 | -c "Read from server: 16384 bytes read" |
| 5288 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5289 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5290 | "$P_SRV response_size=16384" \ |
| 5291 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5292 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5293 | 0 \ |
| 5294 | -s "16384 bytes written in 1 fragments" \ |
| 5295 | -c "Read from server: 16384 bytes read" |
| 5296 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5297 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5298 | "$P_SRV response_size=16384" \ |
| 5299 | "$P_CLI force_version=tls1_2 \ |
| 5300 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5301 | 0 \ |
| 5302 | -c "Read from server: 16384 bytes read" |
| 5303 | |
| 5304 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5305 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 5306 | "$P_SRV response_size=16384" \ |
| 5307 | "$P_CLI force_version=tls1_2 \ |
| 5308 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5309 | trunc_hmac=1" \ |
| 5310 | 0 \ |
| 5311 | -c "Read from server: 16384 bytes read" |
| 5312 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5313 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5314 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5315 | "$P_CLI force_version=tls1_2 \ |
| 5316 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5317 | 0 \ |
| 5318 | -s "16384 bytes written in 1 fragments" \ |
| 5319 | -c "Read from server: 16384 bytes read" |
| 5320 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5321 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 5322 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5323 | "$P_CLI force_version=tls1_2 \ |
| 5324 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5325 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5326 | -s "16384 bytes written in 1 fragments" \ |
| 5327 | -c "Read from server: 16384 bytes read" |
| 5328 | |
| 5329 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5330 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5331 | "$P_CLI force_version=tls1_2 \ |
| 5332 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5333 | 0 \ |
| 5334 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5335 | -c "Read from server: 16384 bytes read" |
| 5336 | |
| 5337 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5338 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 5339 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5340 | "$P_CLI force_version=tls1_2 \ |
| 5341 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5342 | trunc_hmac=1" \ |
| 5343 | 0 \ |
| 5344 | -c "Read from server: 16384 bytes read" |
| 5345 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5346 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5347 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5348 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5349 | "$P_CLI force_version=tls1_2 \ |
| 5350 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5351 | 0 \ |
| 5352 | -s "16384 bytes written in 1 fragments" \ |
| 5353 | -c "Read from server: 16384 bytes read" |
| 5354 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5355 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5356 | "$P_SRV response_size=16384" \ |
| 5357 | "$P_CLI force_version=tls1_2 \ |
| 5358 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5359 | 0 \ |
| 5360 | -c "Read from server: 16384 bytes read" |
| 5361 | |
| 5362 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5363 | "$P_SRV response_size=16384" \ |
| 5364 | "$P_CLI force_version=tls1_2 \ |
| 5365 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5366 | 0 \ |
| 5367 | -c "Read from server: 16384 bytes read" |
| 5368 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5369 | # Tests for restartable ECC |
| 5370 | |
| 5371 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5372 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5373 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5374 | "$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] | 5375 | 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] | 5376 | debug_level=1" \ |
| 5377 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5378 | -C "x509_verify_cert.*4b00" \ |
| 5379 | -C "mbedtls_pk_verify.*4b00" \ |
| 5380 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5381 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5382 | |
| 5383 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5384 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5385 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5386 | "$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] | 5387 | 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] | 5388 | debug_level=1 ec_max_ops=0" \ |
| 5389 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5390 | -C "x509_verify_cert.*4b00" \ |
| 5391 | -C "mbedtls_pk_verify.*4b00" \ |
| 5392 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5393 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5394 | |
| 5395 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5396 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5397 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5398 | "$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] | 5399 | 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] | 5400 | debug_level=1 ec_max_ops=65535" \ |
| 5401 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5402 | -C "x509_verify_cert.*4b00" \ |
| 5403 | -C "mbedtls_pk_verify.*4b00" \ |
| 5404 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5405 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5406 | |
| 5407 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5408 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5409 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5410 | "$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] | 5411 | 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] | 5412 | debug_level=1 ec_max_ops=1000" \ |
| 5413 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5414 | -c "x509_verify_cert.*4b00" \ |
| 5415 | -c "mbedtls_pk_verify.*4b00" \ |
| 5416 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5417 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5418 | |
| 5419 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5420 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 5421 | "$P_SRV auth_mode=required \ |
| 5422 | crt_file=data_files/server5-badsign.crt \ |
| 5423 | key_file=data_files/server5.key" \ |
| 5424 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5425 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5426 | debug_level=1 ec_max_ops=1000" \ |
| 5427 | 1 \ |
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 | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5432 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5433 | -c "! mbedtls_ssl_handshake returned" \ |
| 5434 | -c "X509 - Certificate verification failed" |
| 5435 | |
| 5436 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5437 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 5438 | "$P_SRV auth_mode=required \ |
| 5439 | crt_file=data_files/server5-badsign.crt \ |
| 5440 | key_file=data_files/server5.key" \ |
| 5441 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5442 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5443 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5444 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5445 | -c "x509_verify_cert.*4b00" \ |
| 5446 | -c "mbedtls_pk_verify.*4b00" \ |
| 5447 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5448 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5449 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5450 | -C "! mbedtls_ssl_handshake returned" \ |
| 5451 | -C "X509 - Certificate verification failed" |
| 5452 | |
| 5453 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5454 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 5455 | "$P_SRV auth_mode=required \ |
| 5456 | crt_file=data_files/server5-badsign.crt \ |
| 5457 | key_file=data_files/server5.key" \ |
| 5458 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5459 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5460 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 5461 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5462 | -C "x509_verify_cert.*4b00" \ |
| 5463 | -c "mbedtls_pk_verify.*4b00" \ |
| 5464 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5465 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5466 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5467 | -C "! mbedtls_ssl_handshake returned" \ |
| 5468 | -C "X509 - Certificate verification failed" |
| 5469 | |
| 5470 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5471 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5472 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5473 | "$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] | 5474 | 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] | 5475 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 5476 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5477 | -c "x509_verify_cert.*4b00" \ |
| 5478 | -c "mbedtls_pk_verify.*4b00" \ |
| 5479 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5480 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5481 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5482 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5483 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 5484 | "$P_SRV" \ |
| 5485 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5486 | debug_level=1 ec_max_ops=1000" \ |
| 5487 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5488 | -c "x509_verify_cert.*4b00" \ |
| 5489 | -c "mbedtls_pk_verify.*4b00" \ |
| 5490 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5491 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5492 | |
| 5493 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5494 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 5495 | "$P_SRV psk=abc123" \ |
| 5496 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 5497 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 5498 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5499 | -C "x509_verify_cert.*4b00" \ |
| 5500 | -C "mbedtls_pk_verify.*4b00" \ |
| 5501 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5502 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5503 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5504 | # Tests of asynchronous private key support in SSL |
| 5505 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5506 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5507 | run_test "SSL async private: sign, delay=0" \ |
| 5508 | "$P_SRV \ |
| 5509 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5510 | "$P_CLI" \ |
| 5511 | 0 \ |
| 5512 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5513 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5514 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5515 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5516 | run_test "SSL async private: sign, delay=1" \ |
| 5517 | "$P_SRV \ |
| 5518 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5519 | "$P_CLI" \ |
| 5520 | 0 \ |
| 5521 | -s "Async sign callback: using key slot " \ |
| 5522 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5523 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5524 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 5525 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5526 | run_test "SSL async private: sign, delay=2" \ |
| 5527 | "$P_SRV \ |
| 5528 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 5529 | "$P_CLI" \ |
| 5530 | 0 \ |
| 5531 | -s "Async sign callback: using key slot " \ |
| 5532 | -U "Async sign callback: using key slot " \ |
| 5533 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 5534 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5535 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5536 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 5537 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 5538 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 5539 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5540 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5541 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 5542 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 5543 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 5544 | "$P_CLI force_version=tls1_1" \ |
| 5545 | 0 \ |
| 5546 | -s "Async sign callback: using key slot " \ |
| 5547 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5548 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5549 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 5550 | run_test "SSL async private: sign, SNI" \ |
| 5551 | "$P_SRV debug_level=3 \ |
| 5552 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 5553 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5554 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5555 | "$P_CLI server_name=polarssl.example" \ |
| 5556 | 0 \ |
| 5557 | -s "Async sign callback: using key slot " \ |
| 5558 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5559 | -s "parse ServerName extension" \ |
| 5560 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5561 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5562 | |
| 5563 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5564 | run_test "SSL async private: decrypt, delay=0" \ |
| 5565 | "$P_SRV \ |
| 5566 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5567 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5568 | 0 \ |
| 5569 | -s "Async decrypt callback: using key slot " \ |
| 5570 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5571 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5572 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5573 | run_test "SSL async private: decrypt, delay=1" \ |
| 5574 | "$P_SRV \ |
| 5575 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5576 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5577 | 0 \ |
| 5578 | -s "Async decrypt callback: using key slot " \ |
| 5579 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5580 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5581 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5582 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5583 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 5584 | "$P_SRV psk=abc123 \ |
| 5585 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5586 | "$P_CLI psk=abc123 \ |
| 5587 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5588 | 0 \ |
| 5589 | -s "Async decrypt callback: using key slot " \ |
| 5590 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5591 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5592 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5593 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 5594 | "$P_SRV psk=abc123 \ |
| 5595 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5596 | "$P_CLI psk=abc123 \ |
| 5597 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5598 | 0 \ |
| 5599 | -s "Async decrypt callback: using key slot " \ |
| 5600 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5601 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5602 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5603 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5604 | run_test "SSL async private: sign callback not present" \ |
| 5605 | "$P_SRV \ |
| 5606 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5607 | "$P_CLI; [ \$? -eq 1 ] && |
| 5608 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5609 | 0 \ |
| 5610 | -S "Async sign callback" \ |
| 5611 | -s "! mbedtls_ssl_handshake returned" \ |
| 5612 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 5613 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 5614 | -s "Successful connection" |
| 5615 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5616 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5617 | run_test "SSL async private: decrypt callback not present" \ |
| 5618 | "$P_SRV debug_level=1 \ |
| 5619 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 5620 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 5621 | [ \$? -eq 1 ] && $P_CLI" \ |
| 5622 | 0 \ |
| 5623 | -S "Async decrypt callback" \ |
| 5624 | -s "! mbedtls_ssl_handshake returned" \ |
| 5625 | -s "got no RSA private key" \ |
| 5626 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5627 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5628 | |
| 5629 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5630 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5631 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5632 | "$P_SRV \ |
| 5633 | async_operations=s async_private_delay1=1 \ |
| 5634 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5635 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5636 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5637 | 0 \ |
| 5638 | -s "Async sign callback: using key slot 0," \ |
| 5639 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5640 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5641 | |
| 5642 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5643 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5644 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5645 | "$P_SRV \ |
| 5646 | async_operations=s async_private_delay2=1 \ |
| 5647 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5648 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5649 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5650 | 0 \ |
| 5651 | -s "Async sign callback: using key slot 0," \ |
| 5652 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5653 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5654 | |
| 5655 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5656 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 5657 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5658 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 5659 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5660 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5661 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5662 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5663 | 0 \ |
| 5664 | -s "Async sign callback: using key slot 1," \ |
| 5665 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5666 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5667 | |
| 5668 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5669 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5670 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5671 | "$P_SRV \ |
| 5672 | async_operations=s async_private_delay1=1 \ |
| 5673 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5674 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5675 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5676 | 0 \ |
| 5677 | -s "Async sign callback: no key matches this certificate." |
| 5678 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5679 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5680 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5681 | "$P_SRV \ |
| 5682 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5683 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5684 | "$P_CLI" \ |
| 5685 | 1 \ |
| 5686 | -s "Async sign callback: injected error" \ |
| 5687 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5688 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5689 | -s "! mbedtls_ssl_handshake returned" |
| 5690 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5691 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5692 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5693 | "$P_SRV \ |
| 5694 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5695 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5696 | "$P_CLI" \ |
| 5697 | 1 \ |
| 5698 | -s "Async sign callback: using key slot " \ |
| 5699 | -S "Async resume" \ |
| 5700 | -s "Async cancel" |
| 5701 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5702 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5703 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5704 | "$P_SRV \ |
| 5705 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5706 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5707 | "$P_CLI" \ |
| 5708 | 1 \ |
| 5709 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5710 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5711 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5712 | -s "! mbedtls_ssl_handshake returned" |
| 5713 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5714 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5715 | run_test "SSL async private: decrypt, error in start" \ |
| 5716 | "$P_SRV \ |
| 5717 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5718 | async_private_error=1" \ |
| 5719 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5720 | 1 \ |
| 5721 | -s "Async decrypt callback: injected error" \ |
| 5722 | -S "Async resume" \ |
| 5723 | -S "Async cancel" \ |
| 5724 | -s "! mbedtls_ssl_handshake returned" |
| 5725 | |
| 5726 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5727 | run_test "SSL async private: decrypt, cancel after start" \ |
| 5728 | "$P_SRV \ |
| 5729 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5730 | async_private_error=2" \ |
| 5731 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5732 | 1 \ |
| 5733 | -s "Async decrypt callback: using key slot " \ |
| 5734 | -S "Async resume" \ |
| 5735 | -s "Async cancel" |
| 5736 | |
| 5737 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5738 | run_test "SSL async private: decrypt, error in resume" \ |
| 5739 | "$P_SRV \ |
| 5740 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5741 | async_private_error=3" \ |
| 5742 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5743 | 1 \ |
| 5744 | -s "Async decrypt callback: using key slot " \ |
| 5745 | -s "Async resume callback: decrypt done but injected error" \ |
| 5746 | -S "Async cancel" \ |
| 5747 | -s "! mbedtls_ssl_handshake returned" |
| 5748 | |
| 5749 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5750 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5751 | "$P_SRV \ |
| 5752 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5753 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5754 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5755 | 0 \ |
| 5756 | -s "Async cancel" \ |
| 5757 | -s "! mbedtls_ssl_handshake returned" \ |
| 5758 | -s "Async resume" \ |
| 5759 | -s "Successful connection" |
| 5760 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5761 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5762 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5763 | "$P_SRV \ |
| 5764 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5765 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5766 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5767 | 0 \ |
| 5768 | -s "! mbedtls_ssl_handshake returned" \ |
| 5769 | -s "Async resume" \ |
| 5770 | -s "Successful connection" |
| 5771 | |
| 5772 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5773 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5774 | 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] | 5775 | "$P_SRV \ |
| 5776 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 5777 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5778 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5779 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5780 | [ \$? -eq 1 ] && |
| 5781 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5782 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 5783 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5784 | -S "Async resume" \ |
| 5785 | -s "Async cancel" \ |
| 5786 | -s "! mbedtls_ssl_handshake returned" \ |
| 5787 | -s "Async sign callback: no key matches this certificate." \ |
| 5788 | -s "Successful connection" |
| 5789 | |
| 5790 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5791 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5792 | 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] | 5793 | "$P_SRV \ |
| 5794 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 5795 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5796 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5797 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5798 | [ \$? -eq 1 ] && |
| 5799 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5800 | 0 \ |
| 5801 | -s "Async resume" \ |
| 5802 | -s "! mbedtls_ssl_handshake returned" \ |
| 5803 | -s "Async sign callback: no key matches this certificate." \ |
| 5804 | -s "Successful connection" |
| 5805 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5806 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5807 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5808 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 5809 | "$P_SRV \ |
| 5810 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5811 | exchanges=2 renegotiation=1" \ |
| 5812 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5813 | 0 \ |
| 5814 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5815 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5816 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5817 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5818 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5819 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 5820 | "$P_SRV \ |
| 5821 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5822 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5823 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 5824 | 0 \ |
| 5825 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5826 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5827 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5828 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5829 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5830 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 5831 | "$P_SRV \ |
| 5832 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5833 | exchanges=2 renegotiation=1" \ |
| 5834 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5835 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5836 | 0 \ |
| 5837 | -s "Async decrypt callback: using key slot " \ |
| 5838 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5839 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5840 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5841 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5842 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 5843 | "$P_SRV \ |
| 5844 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5845 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5846 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 5847 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5848 | 0 \ |
| 5849 | -s "Async decrypt callback: using key slot " \ |
| 5850 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5851 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5852 | # Tests for ECC extensions (rfc 4492) |
| 5853 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5854 | requires_config_enabled MBEDTLS_AES_C |
| 5855 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5856 | requires_config_enabled MBEDTLS_SHA256_C |
| 5857 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5858 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 5859 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5860 | "$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] | 5861 | 0 \ |
| 5862 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 5863 | -C "client hello, adding supported_point_formats extension" \ |
| 5864 | -S "found supported elliptic curves extension" \ |
| 5865 | -S "found supported point formats extension" |
| 5866 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5867 | requires_config_enabled MBEDTLS_AES_C |
| 5868 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5869 | requires_config_enabled MBEDTLS_SHA256_C |
| 5870 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5871 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5872 | "$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] | 5873 | "$P_CLI debug_level=3" \ |
| 5874 | 0 \ |
| 5875 | -C "found supported_point_formats extension" \ |
| 5876 | -S "server hello, supported_point_formats extension" |
| 5877 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5878 | requires_config_enabled MBEDTLS_AES_C |
| 5879 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5880 | requires_config_enabled MBEDTLS_SHA256_C |
| 5881 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5882 | run_test "Force an ECC ciphersuite in the client side" \ |
| 5883 | "$P_SRV debug_level=3" \ |
| 5884 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5885 | 0 \ |
| 5886 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 5887 | -c "client hello, adding supported_point_formats extension" \ |
| 5888 | -s "found supported elliptic curves extension" \ |
| 5889 | -s "found supported point formats extension" |
| 5890 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5891 | requires_config_enabled MBEDTLS_AES_C |
| 5892 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5893 | requires_config_enabled MBEDTLS_SHA256_C |
| 5894 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5895 | run_test "Force an ECC ciphersuite in the server side" \ |
| 5896 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5897 | "$P_CLI debug_level=3" \ |
| 5898 | 0 \ |
| 5899 | -c "found supported_point_formats extension" \ |
| 5900 | -s "server hello, supported_point_formats extension" |
| 5901 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5902 | # Tests for DTLS HelloVerifyRequest |
| 5903 | |
| 5904 | run_test "DTLS cookie: enabled" \ |
| 5905 | "$P_SRV dtls=1 debug_level=2" \ |
| 5906 | "$P_CLI dtls=1 debug_level=2" \ |
| 5907 | 0 \ |
| 5908 | -s "cookie verification failed" \ |
| 5909 | -s "cookie verification passed" \ |
| 5910 | -S "cookie verification skipped" \ |
| 5911 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5912 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5913 | -S "SSL - The requested feature is not available" |
| 5914 | |
| 5915 | run_test "DTLS cookie: disabled" \ |
| 5916 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 5917 | "$P_CLI dtls=1 debug_level=2" \ |
| 5918 | 0 \ |
| 5919 | -S "cookie verification failed" \ |
| 5920 | -S "cookie verification passed" \ |
| 5921 | -s "cookie verification skipped" \ |
| 5922 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5923 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5924 | -S "SSL - The requested feature is not available" |
| 5925 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5926 | run_test "DTLS cookie: default (failing)" \ |
| 5927 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 5928 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 5929 | 1 \ |
| 5930 | -s "cookie verification failed" \ |
| 5931 | -S "cookie verification passed" \ |
| 5932 | -S "cookie verification skipped" \ |
| 5933 | -C "received hello verify request" \ |
| 5934 | -S "hello verification requested" \ |
| 5935 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5936 | |
| 5937 | requires_ipv6 |
| 5938 | run_test "DTLS cookie: enabled, IPv6" \ |
| 5939 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 5940 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 5941 | 0 \ |
| 5942 | -s "cookie verification failed" \ |
| 5943 | -s "cookie verification passed" \ |
| 5944 | -S "cookie verification skipped" \ |
| 5945 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5946 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5947 | -S "SSL - The requested feature is not available" |
| 5948 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5949 | run_test "DTLS cookie: enabled, nbio" \ |
| 5950 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 5951 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 5952 | 0 \ |
| 5953 | -s "cookie verification failed" \ |
| 5954 | -s "cookie verification passed" \ |
| 5955 | -S "cookie verification skipped" \ |
| 5956 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5957 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5958 | -S "SSL - The requested feature is not available" |
| 5959 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5960 | # Tests for client reconnecting from the same port with DTLS |
| 5961 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5962 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5963 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 5964 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 5965 | "$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] | 5966 | 0 \ |
| 5967 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5968 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5969 | -S "Client initiated reconnection from same port" |
| 5970 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5971 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5972 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 5973 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 5974 | "$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] | 5975 | 0 \ |
| 5976 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5977 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5978 | -s "Client initiated reconnection from same port" |
| 5979 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 5980 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 5981 | 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] | 5982 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 5983 | "$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] | 5984 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5985 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5986 | -s "Client initiated reconnection from same port" |
| 5987 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 5988 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 5989 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 5990 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 5991 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 5992 | 0 \ |
| 5993 | -S "The operation timed out" \ |
| 5994 | -s "Client initiated reconnection from same port" |
| 5995 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5996 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 5997 | "$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] | 5998 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 5999 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6000 | -s "The operation timed out" \ |
| 6001 | -S "Client initiated reconnection from same port" |
| 6002 | |
Manuel Pégourié-Gonnard | b85ce9e | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6003 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6004 | -p "$P_PXY inject_clihlo=1" \ |
| 6005 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6006 | "$P_CLI dtls=1 exchanges=2" \ |
| 6007 | 0 \ |
| 6008 | -s "possible client reconnect from the same port" \ |
| 6009 | -S "Client initiated reconnection from same port" |
| 6010 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6011 | # Tests for various cases of client authentication with DTLS |
| 6012 | # (focused on handshake flows and message parsing) |
| 6013 | |
| 6014 | run_test "DTLS client auth: required" \ |
| 6015 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6016 | "$P_CLI dtls=1" \ |
| 6017 | 0 \ |
| 6018 | -s "Verifying peer X.509 certificate... ok" |
| 6019 | |
| 6020 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6021 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6022 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6023 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6024 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6025 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6026 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6027 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6028 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6029 | 0 \ |
| 6030 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6031 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6032 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6033 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6034 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6035 | "$P_CLI dtls=1 psk=abc124" \ |
| 6036 | 1 \ |
| 6037 | -s "SSL - Verification of the message MAC failed" \ |
| 6038 | -c "SSL - A fatal alert message was received from our peer" |
| 6039 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6040 | # Tests for receiving fragmented handshake messages with DTLS |
| 6041 | |
| 6042 | requires_gnutls |
| 6043 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6044 | "$G_SRV -u --mtu 2048 -a" \ |
| 6045 | "$P_CLI dtls=1 debug_level=2" \ |
| 6046 | 0 \ |
| 6047 | -C "found fragmented DTLS handshake message" \ |
| 6048 | -C "error" |
| 6049 | |
| 6050 | requires_gnutls |
| 6051 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6052 | "$G_SRV -u --mtu 512" \ |
| 6053 | "$P_CLI dtls=1 debug_level=2" \ |
| 6054 | 0 \ |
| 6055 | -c "found fragmented DTLS handshake message" \ |
| 6056 | -C "error" |
| 6057 | |
| 6058 | requires_gnutls |
| 6059 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6060 | "$G_SRV -u --mtu 128" \ |
| 6061 | "$P_CLI dtls=1 debug_level=2" \ |
| 6062 | 0 \ |
| 6063 | -c "found fragmented DTLS handshake message" \ |
| 6064 | -C "error" |
| 6065 | |
| 6066 | requires_gnutls |
| 6067 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6068 | "$G_SRV -u --mtu 128" \ |
| 6069 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6070 | 0 \ |
| 6071 | -c "found fragmented DTLS handshake message" \ |
| 6072 | -C "error" |
| 6073 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6074 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6075 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6076 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6077 | "$G_SRV -u --mtu 256" \ |
| 6078 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6079 | 0 \ |
| 6080 | -c "found fragmented DTLS handshake message" \ |
| 6081 | -c "client hello, adding renegotiation extension" \ |
| 6082 | -c "found renegotiation extension" \ |
| 6083 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6084 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6085 | -C "error" \ |
| 6086 | -s "Extra-header:" |
| 6087 | |
| 6088 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6089 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6090 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6091 | "$G_SRV -u --mtu 256" \ |
| 6092 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6093 | 0 \ |
| 6094 | -c "found fragmented DTLS handshake message" \ |
| 6095 | -c "client hello, adding renegotiation extension" \ |
| 6096 | -c "found renegotiation extension" \ |
| 6097 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6098 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6099 | -C "error" \ |
| 6100 | -s "Extra-header:" |
| 6101 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6102 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6103 | "$O_SRV -dtls1 -mtu 2048" \ |
| 6104 | "$P_CLI dtls=1 debug_level=2" \ |
| 6105 | 0 \ |
| 6106 | -C "found fragmented DTLS handshake message" \ |
| 6107 | -C "error" |
| 6108 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6109 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6110 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6111 | "$P_CLI dtls=1 debug_level=2" \ |
| 6112 | 0 \ |
| 6113 | -c "found fragmented DTLS handshake message" \ |
| 6114 | -C "error" |
| 6115 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6116 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 6117 | "$O_SRV -dtls1 -mtu 256" \ |
| 6118 | "$P_CLI dtls=1 debug_level=2" \ |
| 6119 | 0 \ |
| 6120 | -c "found fragmented DTLS handshake message" \ |
| 6121 | -C "error" |
| 6122 | |
| 6123 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6124 | "$O_SRV -dtls1 -mtu 256" \ |
| 6125 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6126 | 0 \ |
| 6127 | -c "found fragmented DTLS handshake message" \ |
| 6128 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6129 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6130 | # Tests for sending fragmented handshake messages with DTLS |
| 6131 | # |
| 6132 | # Use client auth when we need the client to send large messages, |
| 6133 | # and use large cert chains on both sides too (the long chains we have all use |
| 6134 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6135 | # Sizes reached (UDP payload): |
| 6136 | # - 2037B for server certificate |
| 6137 | # - 1542B for client certificate |
| 6138 | # - 1013B for newsessionticket |
| 6139 | # - all others below 512B |
| 6140 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6141 | |
| 6142 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6143 | requires_config_enabled MBEDTLS_RSA_C |
| 6144 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6145 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6146 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6147 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6148 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6149 | crt_file=data_files/server7_int-ca.crt \ |
| 6150 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6151 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6152 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6153 | "$P_CLI dtls=1 debug_level=2 \ |
| 6154 | crt_file=data_files/server8_int-ca2.crt \ |
| 6155 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6156 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6157 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6158 | 0 \ |
| 6159 | -S "found fragmented DTLS handshake message" \ |
| 6160 | -C "found fragmented DTLS handshake message" \ |
| 6161 | -C "error" |
| 6162 | |
| 6163 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6164 | requires_config_enabled MBEDTLS_RSA_C |
| 6165 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6166 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6167 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6168 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6169 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6170 | crt_file=data_files/server7_int-ca.crt \ |
| 6171 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6172 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6173 | max_frag_len=1024" \ |
| 6174 | "$P_CLI dtls=1 debug_level=2 \ |
| 6175 | crt_file=data_files/server8_int-ca2.crt \ |
| 6176 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6177 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6178 | max_frag_len=2048" \ |
| 6179 | 0 \ |
| 6180 | -S "found fragmented DTLS handshake message" \ |
| 6181 | -c "found fragmented DTLS handshake message" \ |
| 6182 | -C "error" |
| 6183 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6184 | # With the MFL extension, the server has no way of forcing |
| 6185 | # the client to not exceed a certain MTU; hence, the following |
| 6186 | # test can't be replicated with an MTU proxy such as the one |
| 6187 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6188 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6189 | requires_config_enabled MBEDTLS_RSA_C |
| 6190 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6191 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6192 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6193 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6194 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6195 | crt_file=data_files/server7_int-ca.crt \ |
| 6196 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6197 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6198 | max_frag_len=512" \ |
| 6199 | "$P_CLI dtls=1 debug_level=2 \ |
| 6200 | crt_file=data_files/server8_int-ca2.crt \ |
| 6201 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6202 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6203 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6204 | 0 \ |
| 6205 | -S "found fragmented DTLS handshake message" \ |
| 6206 | -c "found fragmented DTLS handshake message" \ |
| 6207 | -C "error" |
| 6208 | |
| 6209 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6210 | requires_config_enabled MBEDTLS_RSA_C |
| 6211 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6212 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6213 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6214 | 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] | 6215 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6216 | crt_file=data_files/server7_int-ca.crt \ |
| 6217 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6218 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6219 | max_frag_len=2048" \ |
| 6220 | "$P_CLI dtls=1 debug_level=2 \ |
| 6221 | crt_file=data_files/server8_int-ca2.crt \ |
| 6222 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6223 | hs_timeout=2500-60000 \ |
| 6224 | max_frag_len=1024" \ |
| 6225 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6226 | -S "found fragmented DTLS handshake message" \ |
| 6227 | -c "found fragmented DTLS handshake message" \ |
| 6228 | -C "error" |
| 6229 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6230 | # While not required by the standard defining the MFL extension |
| 6231 | # (according to which it only applies to records, not to datagrams), |
| 6232 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6233 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6234 | # to the peer. |
| 6235 | # The next test checks that no datagrams significantly larger than the |
| 6236 | # negotiated MFL are sent. |
| 6237 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6238 | requires_config_enabled MBEDTLS_RSA_C |
| 6239 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6240 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6241 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6242 | 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] | 6243 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6244 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6245 | crt_file=data_files/server7_int-ca.crt \ |
| 6246 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6247 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6248 | max_frag_len=2048" \ |
| 6249 | "$P_CLI dtls=1 debug_level=2 \ |
| 6250 | crt_file=data_files/server8_int-ca2.crt \ |
| 6251 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6252 | hs_timeout=2500-60000 \ |
| 6253 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6254 | 0 \ |
| 6255 | -S "found fragmented DTLS handshake message" \ |
| 6256 | -c "found fragmented DTLS handshake message" \ |
| 6257 | -C "error" |
| 6258 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6259 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6260 | requires_config_enabled MBEDTLS_RSA_C |
| 6261 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6262 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6263 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6264 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6265 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6266 | crt_file=data_files/server7_int-ca.crt \ |
| 6267 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6268 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6269 | max_frag_len=2048" \ |
| 6270 | "$P_CLI dtls=1 debug_level=2 \ |
| 6271 | crt_file=data_files/server8_int-ca2.crt \ |
| 6272 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6273 | hs_timeout=2500-60000 \ |
| 6274 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6275 | 0 \ |
| 6276 | -s "found fragmented DTLS handshake message" \ |
| 6277 | -c "found fragmented DTLS handshake message" \ |
| 6278 | -C "error" |
| 6279 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6280 | # While not required by the standard defining the MFL extension |
| 6281 | # (according to which it only applies to records, not to datagrams), |
| 6282 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6283 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6284 | # to the peer. |
| 6285 | # The next test checks that no datagrams significantly larger than the |
| 6286 | # negotiated MFL are sent. |
| 6287 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6288 | requires_config_enabled MBEDTLS_RSA_C |
| 6289 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6290 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6291 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6292 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6293 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6294 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6295 | crt_file=data_files/server7_int-ca.crt \ |
| 6296 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6297 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6298 | max_frag_len=2048" \ |
| 6299 | "$P_CLI dtls=1 debug_level=2 \ |
| 6300 | crt_file=data_files/server8_int-ca2.crt \ |
| 6301 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6302 | hs_timeout=2500-60000 \ |
| 6303 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6304 | 0 \ |
| 6305 | -s "found fragmented DTLS handshake message" \ |
| 6306 | -c "found fragmented DTLS handshake message" \ |
| 6307 | -C "error" |
| 6308 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6309 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6310 | requires_config_enabled MBEDTLS_RSA_C |
| 6311 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6312 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6313 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6314 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6315 | crt_file=data_files/server7_int-ca.crt \ |
| 6316 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6317 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6318 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6319 | "$P_CLI dtls=1 debug_level=2 \ |
| 6320 | crt_file=data_files/server8_int-ca2.crt \ |
| 6321 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6322 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6323 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6324 | 0 \ |
| 6325 | -S "found fragmented DTLS handshake message" \ |
| 6326 | -C "found fragmented DTLS handshake message" \ |
| 6327 | -C "error" |
| 6328 | |
| 6329 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6330 | requires_config_enabled MBEDTLS_RSA_C |
| 6331 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6332 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6333 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6334 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6335 | crt_file=data_files/server7_int-ca.crt \ |
| 6336 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6337 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6338 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6339 | "$P_CLI dtls=1 debug_level=2 \ |
| 6340 | crt_file=data_files/server8_int-ca2.crt \ |
| 6341 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6342 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6343 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6344 | 0 \ |
| 6345 | -s "found fragmented DTLS handshake message" \ |
| 6346 | -C "found fragmented DTLS handshake message" \ |
| 6347 | -C "error" |
| 6348 | |
| 6349 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6350 | requires_config_enabled MBEDTLS_RSA_C |
| 6351 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6352 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6353 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6354 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6355 | crt_file=data_files/server7_int-ca.crt \ |
| 6356 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6357 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6358 | mtu=512" \ |
| 6359 | "$P_CLI dtls=1 debug_level=2 \ |
| 6360 | crt_file=data_files/server8_int-ca2.crt \ |
| 6361 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6362 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6363 | mtu=2048" \ |
| 6364 | 0 \ |
| 6365 | -S "found fragmented DTLS handshake message" \ |
| 6366 | -c "found fragmented DTLS handshake message" \ |
| 6367 | -C "error" |
| 6368 | |
| 6369 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6370 | requires_config_enabled MBEDTLS_RSA_C |
| 6371 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6372 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6373 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6374 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6375 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6376 | crt_file=data_files/server7_int-ca.crt \ |
| 6377 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6378 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6379 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6380 | "$P_CLI dtls=1 debug_level=2 \ |
| 6381 | crt_file=data_files/server8_int-ca2.crt \ |
| 6382 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6383 | hs_timeout=2500-60000 \ |
| 6384 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6385 | 0 \ |
| 6386 | -s "found fragmented DTLS handshake message" \ |
| 6387 | -c "found fragmented DTLS handshake message" \ |
| 6388 | -C "error" |
| 6389 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6390 | # 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] | 6391 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6392 | requires_config_enabled MBEDTLS_RSA_C |
| 6393 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6394 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6395 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6396 | requires_config_enabled MBEDTLS_AES_C |
| 6397 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6398 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6399 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6400 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6401 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6402 | crt_file=data_files/server7_int-ca.crt \ |
| 6403 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6404 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6405 | mtu=512" \ |
| 6406 | "$P_CLI dtls=1 debug_level=2 \ |
| 6407 | crt_file=data_files/server8_int-ca2.crt \ |
| 6408 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6409 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6410 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6411 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6412 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6413 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6414 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6415 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6416 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6417 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6418 | # 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] | 6419 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 6420 | # retransmissions, but in some cases (like both the server and client using |
| 6421 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 6422 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 6423 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6424 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6425 | requires_config_enabled MBEDTLS_RSA_C |
| 6426 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6427 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6428 | requires_config_enabled MBEDTLS_AES_C |
| 6429 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6430 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6431 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6432 | -p "$P_PXY mtu=508" \ |
| 6433 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6434 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6435 | key_file=data_files/server7.key \ |
| 6436 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6437 | "$P_CLI dtls=1 debug_level=2 \ |
| 6438 | crt_file=data_files/server8_int-ca2.crt \ |
| 6439 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6440 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6441 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6442 | 0 \ |
| 6443 | -s "found fragmented DTLS handshake message" \ |
| 6444 | -c "found fragmented DTLS handshake message" \ |
| 6445 | -C "error" |
| 6446 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6447 | # 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] | 6448 | only_with_valgrind |
| 6449 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6450 | requires_config_enabled MBEDTLS_RSA_C |
| 6451 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6452 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6453 | requires_config_enabled MBEDTLS_AES_C |
| 6454 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6455 | requires_max_content_len 2048 |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6456 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6457 | -p "$P_PXY mtu=508" \ |
| 6458 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6459 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6460 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6461 | hs_timeout=250-10000" \ |
| 6462 | "$P_CLI dtls=1 debug_level=2 \ |
| 6463 | crt_file=data_files/server8_int-ca2.crt \ |
| 6464 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6465 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6466 | hs_timeout=250-10000" \ |
| 6467 | 0 \ |
| 6468 | -s "found fragmented DTLS handshake message" \ |
| 6469 | -c "found fragmented DTLS handshake message" \ |
| 6470 | -C "error" |
| 6471 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6472 | # 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] | 6473 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6474 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6475 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6476 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6477 | requires_config_enabled MBEDTLS_RSA_C |
| 6478 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6479 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6480 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6481 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6482 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6483 | crt_file=data_files/server7_int-ca.crt \ |
| 6484 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6485 | hs_timeout=10000-60000 \ |
| 6486 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6487 | "$P_CLI dtls=1 debug_level=2 \ |
| 6488 | crt_file=data_files/server8_int-ca2.crt \ |
| 6489 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6490 | hs_timeout=10000-60000 \ |
| 6491 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6492 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6493 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6494 | -s "found fragmented DTLS handshake message" \ |
| 6495 | -c "found fragmented DTLS handshake message" \ |
| 6496 | -C "error" |
| 6497 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6498 | # 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] | 6499 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 6500 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6501 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6502 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6503 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6504 | requires_config_enabled MBEDTLS_RSA_C |
| 6505 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6506 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6507 | requires_config_enabled MBEDTLS_AES_C |
| 6508 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6509 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6510 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6511 | -p "$P_PXY mtu=512" \ |
| 6512 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6513 | crt_file=data_files/server7_int-ca.crt \ |
| 6514 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6515 | hs_timeout=10000-60000 \ |
| 6516 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6517 | "$P_CLI dtls=1 debug_level=2 \ |
| 6518 | crt_file=data_files/server8_int-ca2.crt \ |
| 6519 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6520 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6521 | hs_timeout=10000-60000 \ |
| 6522 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6523 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6524 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6525 | -s "found fragmented DTLS handshake message" \ |
| 6526 | -c "found fragmented DTLS handshake message" \ |
| 6527 | -C "error" |
| 6528 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6529 | not_with_valgrind # spurious autoreduction due to timeout |
| 6530 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6531 | requires_config_enabled MBEDTLS_RSA_C |
| 6532 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6533 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6534 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6535 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6536 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6537 | crt_file=data_files/server7_int-ca.crt \ |
| 6538 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6539 | hs_timeout=10000-60000 \ |
| 6540 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6541 | "$P_CLI dtls=1 debug_level=2 \ |
| 6542 | crt_file=data_files/server8_int-ca2.crt \ |
| 6543 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6544 | hs_timeout=10000-60000 \ |
| 6545 | mtu=1024 nbio=2" \ |
| 6546 | 0 \ |
| 6547 | -S "autoreduction" \ |
| 6548 | -s "found fragmented DTLS handshake message" \ |
| 6549 | -c "found fragmented DTLS handshake message" \ |
| 6550 | -C "error" |
| 6551 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6552 | # 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] | 6553 | not_with_valgrind # spurious autoreduction due to timeout |
| 6554 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6555 | requires_config_enabled MBEDTLS_RSA_C |
| 6556 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6557 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6558 | requires_config_enabled MBEDTLS_AES_C |
| 6559 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6560 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6561 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 6562 | -p "$P_PXY mtu=512" \ |
| 6563 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6564 | crt_file=data_files/server7_int-ca.crt \ |
| 6565 | key_file=data_files/server7.key \ |
| 6566 | hs_timeout=10000-60000 \ |
| 6567 | mtu=512 nbio=2" \ |
| 6568 | "$P_CLI dtls=1 debug_level=2 \ |
| 6569 | crt_file=data_files/server8_int-ca2.crt \ |
| 6570 | key_file=data_files/server8.key \ |
| 6571 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6572 | hs_timeout=10000-60000 \ |
| 6573 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6580 | # 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] | 6581 | # This ensures things still work after session_reset(). |
| 6582 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6583 | # Since we don't support reading fragmented ClientHello yet, |
| 6584 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 6585 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6586 | # An autoreduction on the client-side might happen if the server is |
| 6587 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6588 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6589 | # resumed listening, which would result in a spurious autoreduction. |
| 6590 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6591 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6592 | requires_config_enabled MBEDTLS_RSA_C |
| 6593 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6594 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6595 | requires_config_enabled MBEDTLS_AES_C |
| 6596 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6597 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6598 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 6599 | -p "$P_PXY mtu=1450" \ |
| 6600 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6601 | crt_file=data_files/server7_int-ca.crt \ |
| 6602 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6603 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6604 | mtu=1450" \ |
| 6605 | "$P_CLI dtls=1 debug_level=2 \ |
| 6606 | crt_file=data_files/server8_int-ca2.crt \ |
| 6607 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6608 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6609 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 6610 | 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] | 6611 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6612 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6613 | -s "found fragmented DTLS handshake message" \ |
| 6614 | -c "found fragmented DTLS handshake message" \ |
| 6615 | -C "error" |
| 6616 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6617 | # An autoreduction on the client-side might happen if the server is |
| 6618 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6619 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6620 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6621 | requires_config_enabled MBEDTLS_RSA_C |
| 6622 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6623 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6624 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6625 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6626 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6627 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6628 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 6629 | -p "$P_PXY mtu=512" \ |
| 6630 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6631 | crt_file=data_files/server7_int-ca.crt \ |
| 6632 | key_file=data_files/server7.key \ |
| 6633 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6634 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6635 | mtu=512" \ |
| 6636 | "$P_CLI dtls=1 debug_level=2 \ |
| 6637 | crt_file=data_files/server8_int-ca2.crt \ |
| 6638 | key_file=data_files/server8.key \ |
| 6639 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6640 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6641 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6642 | mtu=512" \ |
| 6643 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6644 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6645 | -s "found fragmented DTLS handshake message" \ |
| 6646 | -c "found fragmented DTLS handshake message" \ |
| 6647 | -C "error" |
| 6648 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6649 | # An autoreduction on the client-side might happen if the server is |
| 6650 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6651 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6652 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6653 | requires_config_enabled MBEDTLS_RSA_C |
| 6654 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6655 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6656 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6657 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6658 | requires_config_enabled MBEDTLS_AES_C |
| 6659 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6660 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6661 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 6662 | -p "$P_PXY mtu=512" \ |
| 6663 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6664 | crt_file=data_files/server7_int-ca.crt \ |
| 6665 | key_file=data_files/server7.key \ |
| 6666 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6667 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6668 | mtu=512" \ |
| 6669 | "$P_CLI dtls=1 debug_level=2 \ |
| 6670 | crt_file=data_files/server8_int-ca2.crt \ |
| 6671 | key_file=data_files/server8.key \ |
| 6672 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6673 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6674 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6675 | mtu=512" \ |
| 6676 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6677 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6678 | -s "found fragmented DTLS handshake message" \ |
| 6679 | -c "found fragmented DTLS handshake message" \ |
| 6680 | -C "error" |
| 6681 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6682 | # An autoreduction on the client-side might happen if the server is |
| 6683 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6684 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6685 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6686 | requires_config_enabled MBEDTLS_RSA_C |
| 6687 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6688 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6689 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6690 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6691 | requires_config_enabled MBEDTLS_AES_C |
| 6692 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6693 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6694 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6695 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6696 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6697 | crt_file=data_files/server7_int-ca.crt \ |
| 6698 | key_file=data_files/server7.key \ |
| 6699 | exchanges=2 renegotiation=1 \ |
| 6700 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
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 | "$P_CLI dtls=1 debug_level=2 \ |
| 6704 | crt_file=data_files/server8_int-ca2.crt \ |
| 6705 | key_file=data_files/server8.key \ |
| 6706 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6707 | hs_timeout=10000-60000 \ |
| 6708 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6709 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6710 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6711 | -s "found fragmented DTLS handshake message" \ |
| 6712 | -c "found fragmented DTLS handshake message" \ |
| 6713 | -C "error" |
| 6714 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6715 | # An autoreduction on the client-side might happen if the server is |
| 6716 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6717 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6718 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6719 | requires_config_enabled MBEDTLS_RSA_C |
| 6720 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6721 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6722 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6723 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6724 | requires_config_enabled MBEDTLS_AES_C |
| 6725 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6726 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6727 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6728 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6729 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6730 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6731 | crt_file=data_files/server7_int-ca.crt \ |
| 6732 | key_file=data_files/server7.key \ |
| 6733 | exchanges=2 renegotiation=1 \ |
| 6734 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6735 | hs_timeout=10000-60000 \ |
| 6736 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6737 | "$P_CLI dtls=1 debug_level=2 \ |
| 6738 | crt_file=data_files/server8_int-ca2.crt \ |
| 6739 | key_file=data_files/server8.key \ |
| 6740 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6741 | hs_timeout=10000-60000 \ |
| 6742 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6743 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6744 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6745 | -s "found fragmented DTLS handshake message" \ |
| 6746 | -c "found fragmented DTLS handshake message" \ |
| 6747 | -C "error" |
| 6748 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6749 | # An autoreduction on the client-side might happen if the server is |
| 6750 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6751 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6752 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6753 | requires_config_enabled MBEDTLS_RSA_C |
| 6754 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6755 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6756 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6757 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6758 | requires_config_enabled MBEDTLS_AES_C |
| 6759 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6760 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6761 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6762 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6763 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6764 | crt_file=data_files/server7_int-ca.crt \ |
| 6765 | key_file=data_files/server7.key \ |
| 6766 | exchanges=2 renegotiation=1 \ |
| 6767 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6768 | hs_timeout=10000-60000 \ |
| 6769 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6770 | "$P_CLI dtls=1 debug_level=2 \ |
| 6771 | crt_file=data_files/server8_int-ca2.crt \ |
| 6772 | key_file=data_files/server8.key \ |
| 6773 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6774 | hs_timeout=10000-60000 \ |
| 6775 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6776 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6777 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6778 | -s "found fragmented DTLS handshake message" \ |
| 6779 | -c "found fragmented DTLS handshake message" \ |
| 6780 | -C "error" |
| 6781 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6782 | # 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] | 6783 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6784 | requires_config_enabled MBEDTLS_RSA_C |
| 6785 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6786 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6787 | requires_config_enabled MBEDTLS_AES_C |
| 6788 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6789 | client_needs_more_time 2 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6790 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6791 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 6792 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6793 | "$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] | 6794 | crt_file=data_files/server7_int-ca.crt \ |
| 6795 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6796 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6797 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6798 | crt_file=data_files/server8_int-ca2.crt \ |
| 6799 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6800 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6801 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6802 | 0 \ |
| 6803 | -s "found fragmented DTLS handshake message" \ |
| 6804 | -c "found fragmented DTLS handshake message" \ |
| 6805 | -C "error" |
| 6806 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6807 | # 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] | 6808 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6809 | requires_config_enabled MBEDTLS_RSA_C |
| 6810 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | c221e53 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6811 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6812 | requires_config_enabled MBEDTLS_AES_C |
| 6813 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6814 | client_needs_more_time 2 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6815 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6816 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 6817 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 6818 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6819 | crt_file=data_files/server7_int-ca.crt \ |
| 6820 | key_file=data_files/server7.key \ |
| 6821 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6822 | "$P_CLI dtls=1 debug_level=2 \ |
| 6823 | crt_file=data_files/server8_int-ca2.crt \ |
| 6824 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6825 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6826 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6827 | 0 \ |
| 6828 | -s "found fragmented DTLS handshake message" \ |
| 6829 | -c "found fragmented DTLS handshake message" \ |
| 6830 | -C "error" |
| 6831 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6832 | # interop tests for DTLS fragmentating with reliable connection |
| 6833 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6834 | # here and below we just want to test that the we fragment in a way that |
| 6835 | # pleases other implementations, so we don't need the peer to fragment |
| 6836 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6837 | requires_config_enabled MBEDTLS_RSA_C |
| 6838 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6839 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6840 | requires_gnutls |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6841 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6842 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 6843 | "$G_SRV -u" \ |
| 6844 | "$P_CLI dtls=1 debug_level=2 \ |
| 6845 | crt_file=data_files/server8_int-ca2.crt \ |
| 6846 | key_file=data_files/server8.key \ |
| 6847 | mtu=512 force_version=dtls1_2" \ |
| 6848 | 0 \ |
| 6849 | -c "fragmenting handshake message" \ |
| 6850 | -C "error" |
| 6851 | |
| 6852 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6853 | requires_config_enabled MBEDTLS_RSA_C |
| 6854 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6855 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6856 | requires_gnutls |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6857 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6858 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 6859 | "$G_SRV -u" \ |
| 6860 | "$P_CLI dtls=1 debug_level=2 \ |
| 6861 | crt_file=data_files/server8_int-ca2.crt \ |
| 6862 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6863 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6864 | 0 \ |
| 6865 | -c "fragmenting handshake message" \ |
| 6866 | -C "error" |
| 6867 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6868 | # We use --insecure for the GnuTLS client because it expects |
| 6869 | # the hostname / IP it connects to to be the name used in the |
| 6870 | # certificate obtained from the server. Here, however, it |
| 6871 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 6872 | # as the server name in the certificate. This will make the |
| 6873 | # certifiate validation fail, but passing --insecure makes |
| 6874 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6875 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6876 | requires_config_enabled MBEDTLS_RSA_C |
| 6877 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6878 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6879 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6880 | requires_not_i686 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6881 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6882 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6883 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6884 | crt_file=data_files/server7_int-ca.crt \ |
| 6885 | key_file=data_files/server7.key \ |
| 6886 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6887 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6888 | 0 \ |
| 6889 | -s "fragmenting handshake message" |
| 6890 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6891 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6892 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6893 | requires_config_enabled MBEDTLS_RSA_C |
| 6894 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6895 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6896 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6897 | requires_not_i686 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6898 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6899 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6900 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6901 | crt_file=data_files/server7_int-ca.crt \ |
| 6902 | key_file=data_files/server7.key \ |
| 6903 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6904 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6905 | 0 \ |
| 6906 | -s "fragmenting handshake message" |
| 6907 | |
| 6908 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6909 | requires_config_enabled MBEDTLS_RSA_C |
| 6910 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6911 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6912 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6913 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 6914 | "$O_SRV -dtls1_2 -verify 10" \ |
| 6915 | "$P_CLI dtls=1 debug_level=2 \ |
| 6916 | crt_file=data_files/server8_int-ca2.crt \ |
| 6917 | key_file=data_files/server8.key \ |
| 6918 | mtu=512 force_version=dtls1_2" \ |
| 6919 | 0 \ |
| 6920 | -c "fragmenting handshake message" \ |
| 6921 | -C "error" |
| 6922 | |
| 6923 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6924 | requires_config_enabled MBEDTLS_RSA_C |
| 6925 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6926 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6927 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6928 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 6929 | "$O_SRV -dtls1 -verify 10" \ |
| 6930 | "$P_CLI dtls=1 debug_level=2 \ |
| 6931 | crt_file=data_files/server8_int-ca2.crt \ |
| 6932 | key_file=data_files/server8.key \ |
| 6933 | mtu=512 force_version=dtls1" \ |
| 6934 | 0 \ |
| 6935 | -c "fragmenting handshake message" \ |
| 6936 | -C "error" |
| 6937 | |
| 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_2 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6942 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6943 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 6944 | "$P_SRV dtls=1 debug_level=2 \ |
| 6945 | crt_file=data_files/server7_int-ca.crt \ |
| 6946 | key_file=data_files/server7.key \ |
| 6947 | mtu=512 force_version=dtls1_2" \ |
| 6948 | "$O_CLI -dtls1_2" \ |
| 6949 | 0 \ |
| 6950 | -s "fragmenting handshake message" |
| 6951 | |
| 6952 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6953 | requires_config_enabled MBEDTLS_RSA_C |
| 6954 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6955 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6956 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6957 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 6958 | "$P_SRV dtls=1 debug_level=2 \ |
| 6959 | crt_file=data_files/server7_int-ca.crt \ |
| 6960 | key_file=data_files/server7.key \ |
| 6961 | mtu=512 force_version=dtls1" \ |
| 6962 | "$O_CLI -dtls1" \ |
| 6963 | 0 \ |
| 6964 | -s "fragmenting handshake message" |
| 6965 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6966 | # interop tests for DTLS fragmentating with unreliable connection |
| 6967 | # |
| 6968 | # again we just want to test that the we fragment in a way that |
| 6969 | # pleases other implementations, so we don't need the peer to fragment |
| 6970 | requires_gnutls_next |
| 6971 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6972 | requires_config_enabled MBEDTLS_RSA_C |
| 6973 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6974 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6975 | client_needs_more_time 4 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6976 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6977 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 6978 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6979 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6980 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6981 | crt_file=data_files/server8_int-ca2.crt \ |
| 6982 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6983 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6984 | 0 \ |
| 6985 | -c "fragmenting handshake message" \ |
| 6986 | -C "error" |
| 6987 | |
| 6988 | requires_gnutls_next |
| 6989 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6990 | requires_config_enabled MBEDTLS_RSA_C |
| 6991 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6992 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6993 | client_needs_more_time 4 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6994 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6995 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 6996 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6997 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6998 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6999 | crt_file=data_files/server8_int-ca2.crt \ |
| 7000 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7001 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7002 | 0 \ |
| 7003 | -c "fragmenting handshake message" \ |
| 7004 | -C "error" |
| 7005 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7006 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7007 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7008 | requires_config_enabled MBEDTLS_RSA_C |
| 7009 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7010 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7011 | client_needs_more_time 4 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7012 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7013 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7014 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7015 | "$P_SRV dtls=1 debug_level=2 \ |
| 7016 | crt_file=data_files/server7_int-ca.crt \ |
| 7017 | key_file=data_files/server7.key \ |
| 7018 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7019 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7020 | 0 \ |
| 7021 | -s "fragmenting handshake message" |
| 7022 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7023 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7024 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7025 | requires_config_enabled MBEDTLS_RSA_C |
| 7026 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7027 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 7028 | client_needs_more_time 4 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7029 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7030 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 7031 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7032 | "$P_SRV dtls=1 debug_level=2 \ |
| 7033 | crt_file=data_files/server7_int-ca.crt \ |
| 7034 | key_file=data_files/server7.key \ |
| 7035 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7036 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7037 | 0 \ |
| 7038 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7039 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7040 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7041 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7042 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7043 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7044 | ## (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] | 7045 | skip_next_test |
| 7046 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7047 | requires_config_enabled MBEDTLS_RSA_C |
| 7048 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7049 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7050 | client_needs_more_time 4 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7051 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7052 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7053 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7054 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7055 | "$P_CLI dtls=1 debug_level=2 \ |
| 7056 | crt_file=data_files/server8_int-ca2.crt \ |
| 7057 | key_file=data_files/server8.key \ |
| 7058 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7059 | 0 \ |
| 7060 | -c "fragmenting handshake message" \ |
| 7061 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7062 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7063 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7064 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7065 | requires_config_enabled MBEDTLS_RSA_C |
| 7066 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7067 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7068 | client_needs_more_time 4 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7069 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7070 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 7071 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7072 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7073 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7074 | crt_file=data_files/server8_int-ca2.crt \ |
| 7075 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7076 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7077 | 0 \ |
| 7078 | -c "fragmenting handshake message" \ |
| 7079 | -C "error" |
| 7080 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7081 | skip_next_test |
| 7082 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7083 | requires_config_enabled MBEDTLS_RSA_C |
| 7084 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7085 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7086 | client_needs_more_time 4 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7087 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7088 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7089 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7090 | "$P_SRV dtls=1 debug_level=2 \ |
| 7091 | crt_file=data_files/server7_int-ca.crt \ |
| 7092 | key_file=data_files/server7.key \ |
| 7093 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7094 | "$O_CLI -dtls1_2" \ |
| 7095 | 0 \ |
| 7096 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7097 | |
| 7098 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 7099 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7100 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7101 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7102 | requires_config_enabled MBEDTLS_RSA_C |
| 7103 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7104 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7105 | client_needs_more_time 4 |
Yuto Takano | c75df63 | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7106 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7107 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 7108 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7109 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7110 | crt_file=data_files/server7_int-ca.crt \ |
| 7111 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7112 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7113 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7114 | 0 \ |
| 7115 | -s "fragmenting handshake message" |
| 7116 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7117 | # Tests for specific things with "unreliable" UDP connection |
| 7118 | |
| 7119 | not_with_valgrind # spurious resend due to timeout |
| 7120 | run_test "DTLS proxy: reference" \ |
| 7121 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7122 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 7123 | "$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] | 7124 | 0 \ |
| 7125 | -C "replayed record" \ |
| 7126 | -S "replayed record" \ |
| 7127 | -C "record from another epoch" \ |
| 7128 | -S "record from another epoch" \ |
| 7129 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7130 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7131 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7132 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7133 | -c "HTTP/1.0 200 OK" |
| 7134 | |
| 7135 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7136 | run_test "DTLS proxy: duplicate every packet" \ |
| 7137 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7138 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 7139 | "$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] | 7140 | 0 \ |
| 7141 | -c "replayed record" \ |
| 7142 | -s "replayed record" \ |
| 7143 | -c "record from another epoch" \ |
| 7144 | -s "record from another epoch" \ |
| 7145 | -S "resend" \ |
| 7146 | -s "Extra-header:" \ |
| 7147 | -c "HTTP/1.0 200 OK" |
| 7148 | |
| 7149 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 7150 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7151 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 7152 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7153 | 0 \ |
| 7154 | -c "replayed record" \ |
| 7155 | -S "replayed record" \ |
| 7156 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7157 | -s "record from another epoch" \ |
| 7158 | -c "resend" \ |
| 7159 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7160 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7161 | -c "HTTP/1.0 200 OK" |
| 7162 | |
| 7163 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 7164 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7165 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7166 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7167 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7168 | -c "next record in same datagram" \ |
| 7169 | -s "next record in same datagram" |
| 7170 | |
| 7171 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 7172 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7173 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7174 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7175 | 0 \ |
| 7176 | -c "next record in same datagram" \ |
| 7177 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7178 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7179 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 7180 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7181 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 7182 | "$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] | 7183 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7184 | -c "discarding invalid record (mac)" \ |
| 7185 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7186 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7187 | -c "HTTP/1.0 200 OK" \ |
| 7188 | -S "too many records with bad MAC" \ |
| 7189 | -S "Verification of the message MAC failed" |
| 7190 | |
| 7191 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 7192 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7193 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 7194 | "$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] | 7195 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7196 | -C "discarding invalid record (mac)" \ |
| 7197 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7198 | -S "Extra-header:" \ |
| 7199 | -C "HTTP/1.0 200 OK" \ |
| 7200 | -s "too many records with bad MAC" \ |
| 7201 | -s "Verification of the message MAC failed" |
| 7202 | |
| 7203 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 7204 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7205 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 7206 | "$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] | 7207 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7208 | -c "discarding invalid record (mac)" \ |
| 7209 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7210 | -s "Extra-header:" \ |
| 7211 | -c "HTTP/1.0 200 OK" \ |
| 7212 | -S "too many records with bad MAC" \ |
| 7213 | -S "Verification of the message MAC failed" |
| 7214 | |
| 7215 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 7216 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7217 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 7218 | "$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] | 7219 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7220 | -c "discarding invalid record (mac)" \ |
| 7221 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7222 | -s "Extra-header:" \ |
| 7223 | -c "HTTP/1.0 200 OK" \ |
| 7224 | -s "too many records with bad MAC" \ |
| 7225 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7226 | |
| 7227 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 7228 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 7229 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 7230 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7231 | 0 \ |
| 7232 | -c "record from another epoch" \ |
| 7233 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7234 | -s "Extra-header:" \ |
| 7235 | -c "HTTP/1.0 200 OK" |
| 7236 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7237 | # Tests for reordering support with DTLS |
| 7238 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7239 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 7240 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7241 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7242 | hs_timeout=2500-60000" \ |
| 7243 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7244 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7245 | 0 \ |
| 7246 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7247 | -c "Next handshake message has been buffered - load"\ |
| 7248 | -S "Buffering HS message" \ |
| 7249 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7250 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7251 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7252 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7253 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7254 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7255 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 7256 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7257 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7258 | hs_timeout=2500-60000" \ |
| 7259 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7260 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7261 | 0 \ |
| 7262 | -c "Buffering HS message" \ |
| 7263 | -c "found fragmented DTLS handshake message"\ |
| 7264 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 7265 | -c "Next handshake message has been buffered - load"\ |
| 7266 | -S "Buffering HS message" \ |
| 7267 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7268 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7269 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7270 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7271 | -S "Remember CCS message" |
| 7272 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7273 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 7274 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 7275 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 7276 | # while keeping the ServerKeyExchange. |
| 7277 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 7278 | 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] | 7279 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7280 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7281 | hs_timeout=2500-60000" \ |
| 7282 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7283 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7284 | 0 \ |
| 7285 | -c "Buffering HS message" \ |
| 7286 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7287 | -C "attempt to make space by freeing buffered messages" \ |
| 7288 | -S "Buffering HS message" \ |
| 7289 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7290 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7291 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7292 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7293 | -S "Remember CCS message" |
| 7294 | |
| 7295 | # The size constraints ensure that the delayed certificate message can't |
| 7296 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 7297 | # when dropping it first. |
| 7298 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 7299 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 7300 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 7301 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7302 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7303 | hs_timeout=2500-60000" \ |
| 7304 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7305 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7306 | 0 \ |
| 7307 | -c "Buffering HS message" \ |
| 7308 | -c "attempt to make space by freeing buffered future messages" \ |
| 7309 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7310 | -S "Buffering HS message" \ |
| 7311 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7312 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7313 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7314 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7315 | -S "Remember CCS message" |
| 7316 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7317 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 7318 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7319 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 7320 | hs_timeout=2500-60000" \ |
| 7321 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7322 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7323 | 0 \ |
| 7324 | -C "Buffering HS message" \ |
| 7325 | -C "Next handshake message has been buffered - load"\ |
| 7326 | -s "Buffering HS message" \ |
| 7327 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7328 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7329 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7330 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7331 | -S "Remember CCS message" |
| 7332 | |
| 7333 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 7334 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7335 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7336 | hs_timeout=2500-60000" \ |
| 7337 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7338 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7339 | 0 \ |
| 7340 | -C "Buffering HS message" \ |
| 7341 | -C "Next handshake message has been buffered - load"\ |
| 7342 | -S "Buffering HS message" \ |
| 7343 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7344 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7345 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7346 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7347 | -S "Remember CCS message" |
| 7348 | |
| 7349 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 7350 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7351 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7352 | hs_timeout=2500-60000" \ |
| 7353 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7354 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7355 | 0 \ |
| 7356 | -C "Buffering HS message" \ |
| 7357 | -C "Next handshake message has been buffered - load"\ |
| 7358 | -S "Buffering HS message" \ |
| 7359 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7360 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7361 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7362 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7363 | -s "Remember CCS message" |
| 7364 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7365 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7366 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7367 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7368 | hs_timeout=2500-60000" \ |
| 7369 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7370 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 7371 | 0 \ |
| 7372 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7373 | -s "Found buffered record from current epoch - load" \ |
| 7374 | -c "Buffer record from epoch 1" \ |
| 7375 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7376 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7377 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 7378 | # from the server are delayed, so that the encrypted Finished message |
| 7379 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 7380 | # in afterwards, the encrypted Finished message must be freed in order |
| 7381 | # to make space for the NewSessionTicket to be reassembled. |
| 7382 | # This works only in very particular circumstances: |
| 7383 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 7384 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 7385 | # the encrypted Finished message. |
| 7386 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 7387 | # needs to be fragmented. |
| 7388 | # - All messages sent by the server must be small enough to be either sent |
| 7389 | # without fragmentation or be reassembled within the bounds of |
| 7390 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 7391 | # handshake, omitting CRTs. |
| 7392 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 |
| 7393 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 |
| 7394 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 7395 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
| 7396 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 7397 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 7398 | 0 \ |
| 7399 | -s "Buffer record from epoch 1" \ |
| 7400 | -s "Found buffered record from current epoch - load" \ |
| 7401 | -c "Buffer record from epoch 1" \ |
| 7402 | -C "Found buffered record from current epoch - load" \ |
| 7403 | -c "Enough space available after freeing future epoch record" |
| 7404 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 7405 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 7406 | |
| 7407 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7408 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 7409 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7410 | "$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] | 7411 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7412 | "$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] | 7413 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7414 | 0 \ |
| 7415 | -s "Extra-header:" \ |
| 7416 | -c "HTTP/1.0 200 OK" |
| 7417 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7418 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7419 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 7420 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7421 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7422 | "$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] | 7423 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7424 | 0 \ |
| 7425 | -s "Extra-header:" \ |
| 7426 | -c "HTTP/1.0 200 OK" |
| 7427 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7428 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7429 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 7430 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7431 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7432 | "$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] | 7433 | 0 \ |
| 7434 | -s "Extra-header:" \ |
| 7435 | -c "HTTP/1.0 200 OK" |
| 7436 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7437 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7438 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 7439 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7440 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 7441 | "$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] | 7442 | 0 \ |
| 7443 | -s "Extra-header:" \ |
| 7444 | -c "HTTP/1.0 200 OK" |
| 7445 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7446 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7447 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 7448 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7449 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 7450 | "$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] | 7451 | 0 \ |
| 7452 | -s "Extra-header:" \ |
| 7453 | -c "HTTP/1.0 200 OK" |
| 7454 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7455 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7456 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 7457 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7458 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 7459 | "$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] | 7460 | 0 \ |
| 7461 | -s "Extra-header:" \ |
| 7462 | -c "HTTP/1.0 200 OK" |
| 7463 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7464 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7465 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 7466 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7467 | "$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] | 7468 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7469 | "$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] | 7470 | 0 \ |
| 7471 | -s "Extra-header:" \ |
| 7472 | -c "HTTP/1.0 200 OK" |
| 7473 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7474 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 7475 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 7476 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7477 | "$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] | 7478 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7479 | "$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] | 7480 | 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] | 7481 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7482 | 0 \ |
| 7483 | -s "a session has been resumed" \ |
| 7484 | -c "a session has been resumed" \ |
| 7485 | -s "Extra-header:" \ |
| 7486 | -c "HTTP/1.0 200 OK" |
| 7487 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7488 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 7489 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 7490 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7491 | "$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] | 7492 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7493 | "$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] | 7494 | 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] | 7495 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 7496 | 0 \ |
| 7497 | -s "a session has been resumed" \ |
| 7498 | -c "a session has been resumed" \ |
| 7499 | -s "Extra-header:" \ |
| 7500 | -c "HTTP/1.0 200 OK" |
| 7501 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7502 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7503 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7504 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7505 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7506 | "$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] | 7507 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7508 | "$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] | 7509 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7510 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7511 | 0 \ |
| 7512 | -c "=> renegotiate" \ |
| 7513 | -s "=> renegotiate" \ |
| 7514 | -s "Extra-header:" \ |
| 7515 | -c "HTTP/1.0 200 OK" |
| 7516 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7517 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7518 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7519 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 7520 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7521 | "$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] | 7522 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7523 | "$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] | 7524 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7525 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7526 | 0 \ |
| 7527 | -c "=> renegotiate" \ |
| 7528 | -s "=> renegotiate" \ |
| 7529 | -s "Extra-header:" \ |
| 7530 | -c "HTTP/1.0 200 OK" |
| 7531 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7532 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7533 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7534 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 7535 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7536 | "$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] | 7537 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7538 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7539 | "$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] | 7540 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7541 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7542 | 0 \ |
| 7543 | -c "=> renegotiate" \ |
| 7544 | -s "=> renegotiate" \ |
| 7545 | -s "Extra-header:" \ |
| 7546 | -c "HTTP/1.0 200 OK" |
| 7547 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7548 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7549 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7550 | 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] | 7551 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7552 | "$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] | 7553 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7554 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7555 | "$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] | 7556 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7557 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7558 | 0 \ |
| 7559 | -c "=> renegotiate" \ |
| 7560 | -s "=> renegotiate" \ |
| 7561 | -s "Extra-header:" \ |
| 7562 | -c "HTTP/1.0 200 OK" |
| 7563 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7564 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 7565 | ## all versions installed on the CI machines), reported here: |
| 7566 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 7567 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7568 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 7569 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7570 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7571 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7572 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7573 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7574 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7575 | "$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] | 7576 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7577 | -c "HTTP/1.0 200 OK" |
| 7578 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7579 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7580 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7581 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7582 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 7583 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7584 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7585 | "$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] | 7586 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7587 | -c "HTTP/1.0 200 OK" |
| 7588 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7589 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7590 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7591 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7592 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 7593 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7594 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7595 | "$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] | 7596 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7597 | -c "HTTP/1.0 200 OK" |
| 7598 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 7599 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7600 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7601 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7602 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 7603 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 7604 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7605 | "$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] | 7606 | 0 \ |
| 7607 | -s "Extra-header:" \ |
| 7608 | -c "Extra-header:" |
| 7609 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7610 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7611 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7612 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7613 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 7614 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7615 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7616 | "$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] | 7617 | 0 \ |
| 7618 | -s "Extra-header:" \ |
| 7619 | -c "Extra-header:" |
| 7620 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7621 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7622 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7623 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7624 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 7625 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7626 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7627 | "$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] | 7628 | 0 \ |
| 7629 | -s "Extra-header:" \ |
| 7630 | -c "Extra-header:" |
| 7631 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 7632 | # Final report |
| 7633 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7634 | echo "------------------------------------------------------------------------" |
| 7635 | |
| 7636 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7637 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7638 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7639 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7640 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 7641 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 7642 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7643 | |
| 7644 | exit $FAILS |