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 | # |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 5 | # Copyright (c) 2016, ARM Limited, All Rights Reserved |
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 | # |
Bence Szépkúti | 51b41d5 | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 47 | # This file is part of Mbed TLS (https://tls.mbed.org) |
Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 48 | # |
| 49 | # Purpose |
| 50 | # |
| 51 | # Executes tests to prove various TLS/SSL options and extensions. |
| 52 | # |
| 53 | # The goal is not to cover every ciphersuite/version, but instead to cover |
| 54 | # specific options (max fragment length, truncated hmac, etc) or procedures |
| 55 | # (session resumption from cache or ticket, renego, etc). |
| 56 | # |
| 57 | # The tests assume a build with default options, with exceptions expressed |
| 58 | # with a dependency. The tests focus on functionality and do not consider |
| 59 | # performance. |
| 60 | # |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 61 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 62 | set -u |
| 63 | |
Jaeden Amero | a258ccd | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 64 | # Limit the size of each log to 10 GiB, in case of failures with this script |
| 65 | # where it may output seemingly unlimited length error logs. |
| 66 | ulimit -f 20971520 |
| 67 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 68 | if cd $( dirname $0 ); then :; else |
| 69 | echo "cd $( dirname $0 ) failed" >&2 |
| 70 | exit 1 |
| 71 | fi |
| 72 | |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 73 | # default values, can be overridden by the environment |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 74 | : ${P_SRV:=../programs/ssl/ssl_server2} |
| 75 | : ${P_CLI:=../programs/ssl/ssl_client2} |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 76 | : ${P_PXY:=../programs/test/udp_proxy} |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 77 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 78 | : ${GNUTLS_CLI:=gnutls-cli} |
| 79 | : ${GNUTLS_SERV:=gnutls-serv} |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 80 | : ${PERL:=perl} |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 81 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 82 | 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] | 83 | 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] | 84 | 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] | 85 | 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] | 86 | TCP_CLIENT="$PERL scripts/tcp_client.pl" |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 87 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 88 | # alternative versions of OpenSSL and GnuTLS (no default path) |
| 89 | |
| 90 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 91 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 92 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" |
| 93 | else |
| 94 | O_LEGACY_SRV=false |
| 95 | O_LEGACY_CLI=false |
| 96 | fi |
| 97 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 98 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 99 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 100 | else |
| 101 | G_NEXT_SRV=false |
| 102 | fi |
| 103 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 104 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 105 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 106 | else |
| 107 | G_NEXT_CLI=false |
| 108 | fi |
| 109 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 110 | TESTS=0 |
| 111 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 112 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 113 | |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 114 | CONFIG_H='../include/mbedtls/config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 115 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 116 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 117 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 118 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 119 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 120 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 121 | RUN_TEST_NUMBER='' |
| 122 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 123 | PRESERVE_LOGS=0 |
| 124 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 125 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 126 | # port which is this plus 10000. Each port number may be independently |
| 127 | # overridden by a command line option. |
| 128 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 129 | PXY_PORT=$((SRV_PORT + 10000)) |
| 130 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 131 | print_usage() { |
| 132 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 133 | printf " -h|--help\tPrint this help.\n" |
| 134 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 135 | printf " -f|--filter\tOnly matching tests are executed (BRE; default: '$FILTER')\n" |
| 136 | printf " -e|--exclude\tMatching tests are excluded (BRE; default: '$EXCLUDE')\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 137 | 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] | 138 | 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] | 139 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 140 | printf " --port\tTCP/UDP port (default: randomish 1xxxx)\n" |
| 141 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 142 | 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] | 143 | } |
| 144 | |
| 145 | get_options() { |
| 146 | while [ $# -gt 0 ]; do |
| 147 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 148 | -f|--filter) |
| 149 | shift; FILTER=$1 |
| 150 | ;; |
| 151 | -e|--exclude) |
| 152 | shift; EXCLUDE=$1 |
| 153 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 154 | -m|--memcheck) |
| 155 | MEMCHECK=1 |
| 156 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 157 | -n|--number) |
| 158 | shift; RUN_TEST_NUMBER=$1 |
| 159 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 160 | -s|--show-numbers) |
| 161 | SHOW_TEST_NUMBER=1 |
| 162 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 163 | -p|--preserve-logs) |
| 164 | PRESERVE_LOGS=1 |
| 165 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 166 | --port) |
| 167 | shift; SRV_PORT=$1 |
| 168 | ;; |
| 169 | --proxy-port) |
| 170 | shift; PXY_PORT=$1 |
| 171 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 172 | --seed) |
| 173 | shift; SEED="$1" |
| 174 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 175 | -h|--help) |
| 176 | print_usage |
| 177 | exit 0 |
| 178 | ;; |
| 179 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 180 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 181 | print_usage |
| 182 | exit 1 |
| 183 | ;; |
| 184 | esac |
| 185 | shift |
| 186 | done |
| 187 | } |
| 188 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 189 | # Skip next test; use this macro to skip tests which are legitimate |
| 190 | # in theory and expected to be re-introduced at some point, but |
| 191 | # aren't expected to succeed at the moment due to problems outside |
| 192 | # our control (such as bugs in other TLS implementations). |
| 193 | skip_next_test() { |
| 194 | SKIP_NEXT="YES" |
| 195 | } |
| 196 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 197 | # skip next test if the flag is not enabled in config.h |
| 198 | requires_config_enabled() { |
| 199 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else |
| 200 | SKIP_NEXT="YES" |
| 201 | fi |
| 202 | } |
| 203 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 204 | # skip next test if the flag is enabled in config.h |
| 205 | requires_config_disabled() { |
| 206 | if grep "^#define $1" $CONFIG_H > /dev/null; then |
| 207 | SKIP_NEXT="YES" |
| 208 | fi |
| 209 | } |
| 210 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 211 | get_config_value_or_default() { |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 212 | # This function uses the query_config command line option to query the |
| 213 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 214 | # program. The command will always return a success value if the |
| 215 | # configuration is defined and the value will be printed to stdout. |
| 216 | # |
| 217 | # Note that if the configuration is not defined or is defined to nothing, |
| 218 | # the output of this function will be an empty string. |
| 219 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | requires_config_value_at_least() { |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 223 | VAL="$( get_config_value_or_default "$1" )" |
| 224 | if [ -z "$VAL" ]; then |
| 225 | # Should never happen |
| 226 | echo "Mbed TLS configuration $1 is not defined" |
| 227 | exit 1 |
| 228 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 229 | SKIP_NEXT="YES" |
| 230 | fi |
| 231 | } |
| 232 | |
| 233 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 234 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 0644678 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 235 | if [ -z "$VAL" ]; then |
| 236 | # Should never happen |
| 237 | echo "Mbed TLS configuration $1 is not defined" |
| 238 | exit 1 |
| 239 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 240 | SKIP_NEXT="YES" |
| 241 | fi |
| 242 | } |
| 243 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 244 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 245 | requires_openssl_with_fallback_scsv() { |
| 246 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 247 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 248 | then |
| 249 | OPENSSL_HAS_FBSCSV="YES" |
| 250 | else |
| 251 | OPENSSL_HAS_FBSCSV="NO" |
| 252 | fi |
| 253 | fi |
| 254 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 255 | SKIP_NEXT="YES" |
| 256 | fi |
| 257 | } |
| 258 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 259 | # skip next test if GnuTLS isn't available |
| 260 | requires_gnutls() { |
| 261 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 262 | 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] | 263 | GNUTLS_AVAILABLE="YES" |
| 264 | else |
| 265 | GNUTLS_AVAILABLE="NO" |
| 266 | fi |
| 267 | fi |
| 268 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 269 | SKIP_NEXT="YES" |
| 270 | fi |
| 271 | } |
| 272 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 273 | # skip next test if GnuTLS-next isn't available |
| 274 | requires_gnutls_next() { |
| 275 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 276 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 277 | GNUTLS_NEXT_AVAILABLE="YES" |
| 278 | else |
| 279 | GNUTLS_NEXT_AVAILABLE="NO" |
| 280 | fi |
| 281 | fi |
| 282 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 283 | SKIP_NEXT="YES" |
| 284 | fi |
| 285 | } |
| 286 | |
| 287 | # skip next test if OpenSSL-legacy isn't available |
| 288 | requires_openssl_legacy() { |
| 289 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 290 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 291 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 292 | else |
| 293 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 294 | fi |
| 295 | fi |
| 296 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 297 | SKIP_NEXT="YES" |
| 298 | fi |
| 299 | } |
| 300 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 301 | # skip next test if IPv6 isn't available on this host |
| 302 | requires_ipv6() { |
| 303 | if [ -z "${HAS_IPV6:-}" ]; then |
| 304 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 305 | SRV_PID=$! |
| 306 | sleep 1 |
| 307 | kill $SRV_PID >/dev/null 2>&1 |
| 308 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 309 | HAS_IPV6="NO" |
| 310 | else |
| 311 | HAS_IPV6="YES" |
| 312 | fi |
| 313 | rm -r $SRV_OUT |
| 314 | fi |
| 315 | |
| 316 | if [ "$HAS_IPV6" = "NO" ]; then |
| 317 | SKIP_NEXT="YES" |
| 318 | fi |
| 319 | } |
| 320 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 321 | # skip next test if it's i686 or uname is not available |
| 322 | requires_not_i686() { |
| 323 | if [ -z "${IS_I686:-}" ]; then |
| 324 | IS_I686="YES" |
| 325 | if which "uname" >/dev/null 2>&1; then |
| 326 | if [ -z "$(uname -a | grep i686)" ]; then |
| 327 | IS_I686="NO" |
| 328 | fi |
| 329 | fi |
| 330 | fi |
| 331 | if [ "$IS_I686" = "YES" ]; then |
| 332 | SKIP_NEXT="YES" |
| 333 | fi |
| 334 | } |
| 335 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 336 | # Calculate the input & output maximum content lengths set in the config |
| 337 | MAX_CONTENT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") |
| 338 | MAX_IN_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 339 | MAX_OUT_LEN=$( ../scripts/config.pl get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 340 | |
| 341 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 342 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 343 | fi |
| 344 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 345 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 346 | fi |
| 347 | |
| 348 | # skip the next test if the SSL output buffer is less than 16KB |
| 349 | requires_full_size_output_buffer() { |
| 350 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 351 | SKIP_NEXT="YES" |
| 352 | fi |
| 353 | } |
| 354 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 355 | # skip the next test if valgrind is in use |
| 356 | not_with_valgrind() { |
| 357 | if [ "$MEMCHECK" -gt 0 ]; then |
| 358 | SKIP_NEXT="YES" |
| 359 | fi |
| 360 | } |
| 361 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 362 | # skip the next test if valgrind is NOT in use |
| 363 | only_with_valgrind() { |
| 364 | if [ "$MEMCHECK" -eq 0 ]; then |
| 365 | SKIP_NEXT="YES" |
| 366 | fi |
| 367 | } |
| 368 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 369 | # 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] | 370 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 371 | CLI_DELAY_FACTOR=$1 |
| 372 | } |
| 373 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 374 | # wait for the given seconds after the client finished in the next test |
| 375 | server_needs_more_time() { |
| 376 | SRV_DELAY_SECONDS=$1 |
| 377 | } |
| 378 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 379 | # print_name <name> |
| 380 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 381 | TESTS=$(( $TESTS + 1 )) |
| 382 | LINE="" |
| 383 | |
| 384 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 385 | LINE="$TESTS " |
| 386 | fi |
| 387 | |
| 388 | LINE="$LINE$1" |
| 389 | printf "$LINE " |
| 390 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 391 | for i in `seq 1 $LEN`; do printf '.'; done |
| 392 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 393 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 394 | } |
| 395 | |
| 396 | # fail <message> |
| 397 | fail() { |
| 398 | echo "FAIL" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 399 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 400 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 401 | mv $SRV_OUT o-srv-${TESTS}.log |
| 402 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 403 | if [ -n "$PXY_CMD" ]; then |
| 404 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 405 | fi |
| 406 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 407 | |
Azim Khan | 19d1373 | 2018-03-29 11:04:20 +0100 | [diff] [blame] | 408 | if [ "X${USER:-}" = Xbuildbot -o "X${LOGNAME:-}" = Xbuildbot -o "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 409 | echo " ! server output:" |
| 410 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 411 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 412 | echo " ! client output:" |
| 413 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 414 | if [ -n "$PXY_CMD" ]; then |
| 415 | echo " ! ========================================================" |
| 416 | echo " ! proxy output:" |
| 417 | cat o-pxy-${TESTS}.log |
| 418 | fi |
| 419 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 420 | fi |
| 421 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 422 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 423 | } |
| 424 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 425 | # is_polar <cmd_line> |
| 426 | is_polar() { |
| 427 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null |
| 428 | } |
| 429 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 430 | # openssl s_server doesn't have -www with DTLS |
| 431 | check_osrv_dtls() { |
| 432 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then |
| 433 | NEEDS_INPUT=1 |
| 434 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" |
| 435 | else |
| 436 | NEEDS_INPUT=0 |
| 437 | fi |
| 438 | } |
| 439 | |
| 440 | # provide input to commands that need it |
| 441 | provide_input() { |
| 442 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 443 | return |
| 444 | fi |
| 445 | |
| 446 | while true; do |
| 447 | echo "HTTP/1.0 200 OK" |
| 448 | sleep 1 |
| 449 | done |
| 450 | } |
| 451 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 452 | # has_mem_err <log_file_name> |
| 453 | has_mem_err() { |
| 454 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 455 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 456 | then |
| 457 | return 1 # false: does not have errors |
| 458 | else |
| 459 | return 0 # true: has errors |
| 460 | fi |
| 461 | } |
| 462 | |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 463 | # 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] | 464 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 465 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 466 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 467 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 468 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 469 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 470 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 471 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 472 | # Make a tight loop, server normally takes less than 1s to start. |
| 473 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 474 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 475 | echo "$3 START TIMEOUT" |
| 476 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 477 | break |
| 478 | fi |
| 479 | # Linux and *BSD support decimal arguments to sleep. On other |
| 480 | # OSes this may be a tight loop. |
| 481 | sleep 0.1 2>/dev/null || true |
| 482 | done |
| 483 | } |
| 484 | else |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 485 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 486 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 487 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 488 | } |
| 489 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 490 | |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 491 | # Wait for server process $2 to be listening on port $1. |
| 492 | wait_server_start() { |
| 493 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 494 | } |
| 495 | |
| 496 | # Wait for proxy process $2 to be listening on port $1. |
| 497 | wait_proxy_start() { |
| 498 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 499 | } |
| 500 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 501 | # 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] | 502 | # 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] | 503 | # acceptable bounds |
| 504 | check_server_hello_time() { |
| 505 | # 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] | 506 | 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] | 507 | # Get the Unix timestamp for now |
| 508 | CUR_TIME=$(date +'%s') |
| 509 | THRESHOLD_IN_SECS=300 |
| 510 | |
| 511 | # Check if the ServerHello time was printed |
| 512 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 513 | return 1 |
| 514 | fi |
| 515 | |
| 516 | # Check the time in ServerHello is within acceptable bounds |
| 517 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 518 | # The time in ServerHello is at least 5 minutes before now |
| 519 | return 1 |
| 520 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 521 | # 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] | 522 | return 1 |
| 523 | else |
| 524 | return 0 |
| 525 | fi |
| 526 | } |
| 527 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 528 | # wait for client to terminate and set CLI_EXIT |
| 529 | # must be called right after starting the client |
| 530 | wait_client_done() { |
| 531 | CLI_PID=$! |
| 532 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 533 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 534 | CLI_DELAY_FACTOR=1 |
| 535 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 536 | ( 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] | 537 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 538 | |
| 539 | wait $CLI_PID |
| 540 | CLI_EXIT=$? |
| 541 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 542 | kill $DOG_PID >/dev/null 2>&1 |
| 543 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 544 | |
| 545 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 546 | |
| 547 | sleep $SRV_DELAY_SECONDS |
| 548 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 549 | } |
| 550 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 551 | # check if the given command uses dtls and sets global variable DTLS |
| 552 | detect_dtls() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 553 | if echo "$1" | grep 'dtls=1\|-dtls1\|-u' >/dev/null; then |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 554 | DTLS=1 |
| 555 | else |
| 556 | DTLS=0 |
| 557 | fi |
| 558 | } |
| 559 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 560 | # 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] | 561 | # Options: -s pattern pattern that must be present in server output |
| 562 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 563 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 564 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 565 | # -S pattern pattern that must be absent in server output |
| 566 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 567 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 568 | # -F call shell function on server output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 569 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 570 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 571 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 572 | |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 573 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : |
| 574 | else |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 575 | SKIP_NEXT="NO" |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 576 | return |
| 577 | fi |
| 578 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 579 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 580 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 581 | # Do we only run numbered tests? |
| 582 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : |
| 583 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : |
| 584 | else |
| 585 | SKIP_NEXT="YES" |
| 586 | fi |
| 587 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 588 | # should we skip? |
| 589 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 590 | SKIP_NEXT="NO" |
| 591 | echo "SKIP" |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 592 | SKIPS=$(( $SKIPS + 1 )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 593 | return |
| 594 | fi |
| 595 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 596 | # does this test use a proxy? |
| 597 | if [ "X$1" = "X-p" ]; then |
| 598 | PXY_CMD="$2" |
| 599 | shift 2 |
| 600 | else |
| 601 | PXY_CMD="" |
| 602 | fi |
| 603 | |
| 604 | # get commands and client output |
| 605 | SRV_CMD="$1" |
| 606 | CLI_CMD="$2" |
| 607 | CLI_EXPECT="$3" |
| 608 | shift 3 |
| 609 | |
Hanno Becker | 7a11e72 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 610 | # Check if test uses files |
| 611 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) |
| 612 | if [ ! -z "$TEST_USES_FILES" ]; then |
| 613 | requires_config_enabled MBEDTLS_FS_IO |
| 614 | fi |
| 615 | |
| 616 | # should we skip? |
| 617 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 618 | SKIP_NEXT="NO" |
| 619 | echo "SKIP" |
| 620 | SKIPS=$(( $SKIPS + 1 )) |
| 621 | return |
| 622 | fi |
| 623 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 624 | # fix client port |
| 625 | if [ -n "$PXY_CMD" ]; then |
| 626 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 627 | else |
| 628 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 629 | fi |
| 630 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 631 | # update DTLS variable |
| 632 | detect_dtls "$SRV_CMD" |
| 633 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 634 | # prepend valgrind to our commands if active |
| 635 | if [ "$MEMCHECK" -gt 0 ]; then |
| 636 | if is_polar "$SRV_CMD"; then |
| 637 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 638 | fi |
| 639 | if is_polar "$CLI_CMD"; then |
| 640 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 641 | fi |
| 642 | fi |
| 643 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 644 | TIMES_LEFT=2 |
| 645 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 646 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 647 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 648 | # run the commands |
| 649 | if [ -n "$PXY_CMD" ]; then |
| 650 | echo "$PXY_CMD" > $PXY_OUT |
| 651 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 652 | PXY_PID=$! |
Unknown | 43dc0d6 | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 653 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 654 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 655 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 656 | check_osrv_dtls |
| 657 | echo "$SRV_CMD" > $SRV_OUT |
| 658 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 659 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 660 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 661 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 662 | echo "$CLI_CMD" > $CLI_OUT |
| 663 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 664 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 665 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 666 | sleep 0.05 |
| 667 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 668 | # terminate the server (and the proxy) |
| 669 | kill $SRV_PID |
| 670 | wait $SRV_PID |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 671 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 672 | if [ -n "$PXY_CMD" ]; then |
| 673 | kill $PXY_PID >/dev/null 2>&1 |
| 674 | wait $PXY_PID |
| 675 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 676 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 677 | # retry only on timeouts |
| 678 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 679 | printf "RETRY " |
| 680 | else |
| 681 | TIMES_LEFT=0 |
| 682 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 683 | done |
| 684 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 685 | # 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] | 686 | # (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] | 687 | # expected client exit to incorrectly succeed in case of catastrophic |
| 688 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 689 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 690 | 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] | 691 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 692 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 693 | return |
| 694 | fi |
| 695 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 696 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 697 | 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] | 698 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 699 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 700 | return |
| 701 | fi |
| 702 | fi |
| 703 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 704 | # check server exit code |
| 705 | if [ $? != 0 ]; then |
| 706 | fail "server fail" |
| 707 | return |
| 708 | fi |
| 709 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 710 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 711 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 712 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 713 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 714 | 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] | 715 | return |
| 716 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 717 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 718 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 719 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 720 | # 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] | 721 | while [ $# -gt 0 ] |
| 722 | do |
| 723 | case $1 in |
| 724 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 725 | 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] | 726 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 727 | return |
| 728 | fi |
| 729 | ;; |
| 730 | |
| 731 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 732 | 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] | 733 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 734 | return |
| 735 | fi |
| 736 | ;; |
| 737 | |
| 738 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 739 | 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] | 740 | 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] | 741 | return |
| 742 | fi |
| 743 | ;; |
| 744 | |
| 745 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 746 | 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] | 747 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 748 | return |
| 749 | fi |
| 750 | ;; |
| 751 | |
| 752 | # The filtering in the following two options (-u and -U) do the following |
| 753 | # - ignore valgrind output |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 754 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 755 | # - keep one of each non-unique line |
| 756 | # - count how many lines remain |
| 757 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 758 | # if there were no duplicates. |
| 759 | "-U") |
| 760 | 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 |
| 761 | fail "lines following pattern '$2' must be unique in Server output" |
| 762 | return |
| 763 | fi |
| 764 | ;; |
| 765 | |
| 766 | "-u") |
| 767 | 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 |
| 768 | 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] | 769 | return |
| 770 | fi |
| 771 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 772 | "-F") |
| 773 | if ! $2 "$SRV_OUT"; then |
| 774 | fail "function call to '$2' failed on Server output" |
| 775 | return |
| 776 | fi |
| 777 | ;; |
| 778 | "-f") |
| 779 | if ! $2 "$CLI_OUT"; then |
| 780 | fail "function call to '$2' failed on Client output" |
| 781 | return |
| 782 | fi |
| 783 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 784 | |
| 785 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 786 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 787 | exit 1 |
| 788 | esac |
| 789 | shift 2 |
| 790 | done |
| 791 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 792 | # check valgrind's results |
| 793 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 794 | 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] | 795 | fail "Server has memory errors" |
| 796 | return |
| 797 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 798 | 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] | 799 | fail "Client has memory errors" |
| 800 | return |
| 801 | fi |
| 802 | fi |
| 803 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 804 | # if we're here, everything is ok |
| 805 | echo "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 806 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 807 | mv $SRV_OUT o-srv-${TESTS}.log |
| 808 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 809 | if [ -n "$PXY_CMD" ]; then |
| 810 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 811 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 812 | fi |
| 813 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 814 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 815 | } |
| 816 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 817 | cleanup() { |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 818 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 819 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 820 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 821 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 822 | 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] | 823 | exit 1 |
| 824 | } |
| 825 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 826 | # |
| 827 | # MAIN |
| 828 | # |
| 829 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 830 | get_options "$@" |
| 831 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 832 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 833 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 834 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 835 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 836 | if [ ! -x "$P_SRV_BIN" ]; then |
| 837 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 838 | exit 1 |
| 839 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 840 | if [ ! -x "$P_CLI_BIN" ]; then |
| 841 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 842 | exit 1 |
| 843 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 844 | if [ ! -x "$P_PXY_BIN" ]; then |
| 845 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 846 | exit 1 |
| 847 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 848 | if [ "$MEMCHECK" -gt 0 ]; then |
| 849 | if which valgrind >/dev/null 2>&1; then :; else |
| 850 | echo "Memcheck not possible. Valgrind not found" |
| 851 | exit 1 |
| 852 | fi |
| 853 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 854 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 855 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 856 | exit 1 |
| 857 | fi |
| 858 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 859 | # used by watchdog |
| 860 | MAIN_PID="$$" |
| 861 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 862 | # We use somewhat arbitrary delays for tests: |
| 863 | # - how long do we wait for the server to start (when lsof not available)? |
| 864 | # - how long do we allow for the client to finish? |
| 865 | # (not to check performance, just to avoid waiting indefinitely) |
| 866 | # Things are slower with valgrind, so give extra time here. |
| 867 | # |
| 868 | # Note: without lsof, there is a trade-off between the running time of this |
| 869 | # script and the risk of spurious errors because we didn't wait long enough. |
| 870 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 871 | # 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] | 872 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 873 | START_DELAY=6 |
| 874 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 875 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 876 | START_DELAY=2 |
| 877 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 878 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 879 | |
| 880 | # some particular tests need more time: |
| 881 | # - for the client, we multiply the usual watchdog limit by a factor |
| 882 | # - for the server, we sleep for a number of seconds after the client exits |
| 883 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 884 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 885 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 886 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 887 | # 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] | 888 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 889 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 890 | 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] | 891 | 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"}" |
Manuel Pégourié-Gonnard | 6195767 | 2015-06-18 17:54:58 +0200 | [diff] [blame] | 892 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 893 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
| 894 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 895 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 896 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 897 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 898 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 899 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 900 | fi |
| 901 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 902 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 903 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 904 | fi |
| 905 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 906 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 907 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 908 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 909 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 910 | # Allow SHA-1, because many of our test certificates use it |
| 911 | P_SRV="$P_SRV allow_sha1=1" |
| 912 | P_CLI="$P_CLI allow_sha1=1" |
| 913 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 914 | # Also pick a unique name for intermediate files |
| 915 | SRV_OUT="srv_out.$$" |
| 916 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 917 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 918 | SESSION="session.$$" |
| 919 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 920 | SKIP_NEXT="NO" |
| 921 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 922 | trap cleanup INT TERM HUP |
| 923 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 924 | # Basic test |
| 925 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 926 | # Checks that: |
| 927 | # - things work with all ciphersuites active (used with config-full in all.sh) |
| 928 | # - the expected (highest security) parameters are selected |
| 929 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 930 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 931 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 932 | "$P_CLI" \ |
| 933 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 934 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 935 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 936 | -s "client hello v3, signature_algorithm ext: 6" \ |
| 937 | -s "ECDHE curve: secp521r1" \ |
| 938 | -S "error" \ |
| 939 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 940 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 941 | run_test "Default, DTLS" \ |
| 942 | "$P_SRV dtls=1" \ |
| 943 | "$P_CLI dtls=1" \ |
| 944 | 0 \ |
| 945 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 946 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 947 | |
Manuel Pégourié-Gonnard | 95a17fb | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 948 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT |
| 949 | run_test "Default (compression enabled)" \ |
| 950 | "$P_SRV debug_level=3" \ |
| 951 | "$P_CLI debug_level=3" \ |
| 952 | 0 \ |
| 953 | -s "Allocating compression buffer" \ |
| 954 | -c "Allocating compression buffer" \ |
| 955 | -s "Record expansion is unknown (compression)" \ |
| 956 | -c "Record expansion is unknown (compression)" \ |
| 957 | -S "error" \ |
| 958 | -C "error" |
| 959 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 960 | # Test current time in ServerHello |
| 961 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 962 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 963 | "$P_SRV debug_level=3" \ |
| 964 | "$P_CLI debug_level=3" \ |
| 965 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 966 | -f "check_server_hello_time" \ |
| 967 | -F "check_server_hello_time" |
| 968 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 969 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 970 | run_test "Unique IV in GCM" \ |
| 971 | "$P_SRV exchanges=20 debug_level=4" \ |
| 972 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 973 | 0 \ |
| 974 | -u "IV used" \ |
| 975 | -U "IV used" |
| 976 | |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 977 | # Tests for rc4 option |
| 978 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 979 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 980 | run_test "RC4: server disabled, client enabled" \ |
| 981 | "$P_SRV" \ |
| 982 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 983 | 1 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 984 | -s "SSL - The server has no ciphersuites in common" |
| 985 | |
Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 986 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 987 | run_test "RC4: server half, client enabled" \ |
| 988 | "$P_SRV arc4=1" \ |
| 989 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 990 | 1 \ |
| 991 | -s "SSL - The server has no ciphersuites in common" |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 992 | |
| 993 | run_test "RC4: server enabled, client disabled" \ |
| 994 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 995 | "$P_CLI" \ |
| 996 | 1 \ |
| 997 | -s "SSL - The server has no ciphersuites in common" |
| 998 | |
| 999 | run_test "RC4: both enabled" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1000 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1001 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 1002 | 0 \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1003 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1004 | -S "SSL - The server has no ciphersuites in common" |
| 1005 | |
Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1006 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier |
| 1007 | |
| 1008 | requires_gnutls |
| 1009 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 1010 | run_test "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ |
| 1011 | "$G_SRV"\ |
| 1012 | "$P_CLI force_version=tls1_1" \ |
| 1013 | 0 |
| 1014 | |
| 1015 | requires_gnutls |
| 1016 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 1017 | run_test "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ |
| 1018 | "$G_SRV"\ |
| 1019 | "$P_CLI force_version=tls1" \ |
| 1020 | 0 |
| 1021 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1022 | # Tests for SHA-1 support |
| 1023 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1024 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1025 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1026 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1027 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1028 | 1 \ |
| 1029 | -c "The certificate is signed with an unacceptable hash" |
| 1030 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1031 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1032 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1033 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1034 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1035 | 0 |
| 1036 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1037 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1038 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1039 | "$P_CLI allow_sha1=1" \ |
| 1040 | 0 |
| 1041 | |
| 1042 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1043 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1044 | "$P_CLI allow_sha1=0" \ |
| 1045 | 0 |
| 1046 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1047 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1048 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1049 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1050 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1051 | 1 \ |
| 1052 | -s "The certificate is signed with an unacceptable hash" |
| 1053 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1054 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES |
| 1055 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1056 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1057 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1058 | 0 |
| 1059 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1060 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1061 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1062 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1063 | 0 |
| 1064 | |
| 1065 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1066 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1067 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1068 | 0 |
| 1069 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1070 | # Tests for datagram packing |
| 1071 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1072 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1073 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1074 | 0 \ |
| 1075 | -c "next record in same datagram" \ |
| 1076 | -s "next record in same datagram" |
| 1077 | |
| 1078 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1079 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1080 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1081 | 0 \ |
| 1082 | -s "next record in same datagram" \ |
| 1083 | -C "next record in same datagram" |
| 1084 | |
| 1085 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1086 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1087 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1088 | 0 \ |
| 1089 | -S "next record in same datagram" \ |
| 1090 | -c "next record in same datagram" |
| 1091 | |
| 1092 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1093 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1094 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1095 | 0 \ |
| 1096 | -S "next record in same datagram" \ |
| 1097 | -C "next record in same datagram" |
| 1098 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1099 | # Tests for Truncated HMAC extension |
| 1100 | |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1101 | run_test "Truncated HMAC: client default, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1102 | "$P_SRV debug_level=4" \ |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1103 | "$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] | 1104 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1105 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1106 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1107 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1108 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1109 | run_test "Truncated HMAC: client disabled, server default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1110 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1111 | "$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] | 1112 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1113 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1114 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1115 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1116 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1117 | run_test "Truncated HMAC: client enabled, server default" \ |
| 1118 | "$P_SRV debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1119 | "$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] | 1120 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1121 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1122 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1123 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1124 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1125 | run_test "Truncated HMAC: client enabled, server disabled" \ |
| 1126 | "$P_SRV debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1127 | "$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] | 1128 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1129 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1130 | -S "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1131 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1132 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1133 | run_test "Truncated HMAC: client disabled, server enabled" \ |
| 1134 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1135 | "$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] | 1136 | 0 \ |
| 1137 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1138 | -S "dumping 'expected mac' (10 bytes)" |
| 1139 | |
| 1140 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1141 | run_test "Truncated HMAC: client enabled, server enabled" \ |
| 1142 | "$P_SRV debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1143 | "$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] | 1144 | 0 \ |
Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1145 | -S "dumping 'expected mac' (20 bytes)" \ |
| 1146 | -s "dumping 'expected mac' (10 bytes)" |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1147 | |
Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1148 | run_test "Truncated HMAC, DTLS: client default, server default" \ |
| 1149 | "$P_SRV dtls=1 debug_level=4" \ |
| 1150 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 1151 | 0 \ |
| 1152 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1153 | -S "dumping 'expected mac' (10 bytes)" |
| 1154 | |
| 1155 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1156 | run_test "Truncated HMAC, DTLS: client disabled, server default" \ |
| 1157 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1158 | "$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] | 1159 | 0 \ |
| 1160 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1161 | -S "dumping 'expected mac' (10 bytes)" |
| 1162 | |
| 1163 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1164 | run_test "Truncated HMAC, DTLS: client enabled, server default" \ |
| 1165 | "$P_SRV dtls=1 debug_level=4" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1166 | "$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] | 1167 | 0 \ |
| 1168 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1169 | -S "dumping 'expected mac' (10 bytes)" |
| 1170 | |
| 1171 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1172 | run_test "Truncated HMAC, DTLS: client enabled, server disabled" \ |
| 1173 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1174 | "$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] | 1175 | 0 \ |
| 1176 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1177 | -S "dumping 'expected mac' (10 bytes)" |
| 1178 | |
| 1179 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1180 | run_test "Truncated HMAC, DTLS: client disabled, server enabled" \ |
| 1181 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1182 | "$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] | 1183 | 0 \ |
| 1184 | -s "dumping 'expected mac' (20 bytes)" \ |
| 1185 | -S "dumping 'expected mac' (10 bytes)" |
| 1186 | |
| 1187 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 1188 | run_test "Truncated HMAC, DTLS: client enabled, server enabled" \ |
| 1189 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1190 | "$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] | 1191 | 0 \ |
| 1192 | -S "dumping 'expected mac' (20 bytes)" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1193 | -s "dumping 'expected mac' (10 bytes)" |
| 1194 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1195 | # Tests for Encrypt-then-MAC extension |
| 1196 | |
| 1197 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1198 | "$P_SRV debug_level=3 \ |
| 1199 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1200 | "$P_CLI debug_level=3" \ |
| 1201 | 0 \ |
| 1202 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1203 | -s "found encrypt then mac extension" \ |
| 1204 | -s "server hello, adding encrypt then mac extension" \ |
| 1205 | -c "found encrypt_then_mac extension" \ |
| 1206 | -c "using encrypt then mac" \ |
| 1207 | -s "using encrypt then mac" |
| 1208 | |
| 1209 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1210 | "$P_SRV debug_level=3 etm=0 \ |
| 1211 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1212 | "$P_CLI debug_level=3 etm=1" \ |
| 1213 | 0 \ |
| 1214 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1215 | -s "found encrypt then mac extension" \ |
| 1216 | -S "server hello, adding encrypt then mac extension" \ |
| 1217 | -C "found encrypt_then_mac extension" \ |
| 1218 | -C "using encrypt then mac" \ |
| 1219 | -S "using encrypt then mac" |
| 1220 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 1221 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 1222 | "$P_SRV debug_level=3 etm=1 \ |
| 1223 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 1224 | "$P_CLI debug_level=3 etm=1" \ |
| 1225 | 0 \ |
| 1226 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1227 | -s "found encrypt then mac extension" \ |
| 1228 | -S "server hello, adding encrypt then mac extension" \ |
| 1229 | -C "found encrypt_then_mac extension" \ |
| 1230 | -C "using encrypt then mac" \ |
| 1231 | -S "using encrypt then mac" |
| 1232 | |
| 1233 | run_test "Encrypt then MAC: client enabled, stream cipher" \ |
| 1234 | "$P_SRV debug_level=3 etm=1 \ |
| 1235 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1236 | "$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] | 1237 | 0 \ |
| 1238 | -c "client hello, adding encrypt_then_mac extension" \ |
| 1239 | -s "found encrypt then mac extension" \ |
| 1240 | -S "server hello, adding encrypt then mac extension" \ |
| 1241 | -C "found encrypt_then_mac extension" \ |
| 1242 | -C "using encrypt then mac" \ |
| 1243 | -S "using encrypt then mac" |
| 1244 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1245 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1246 | "$P_SRV debug_level=3 etm=1 \ |
| 1247 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1248 | "$P_CLI debug_level=3 etm=0" \ |
| 1249 | 0 \ |
| 1250 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1251 | -S "found encrypt then mac extension" \ |
| 1252 | -S "server hello, adding encrypt then mac extension" \ |
| 1253 | -C "found encrypt_then_mac extension" \ |
| 1254 | -C "using encrypt then mac" \ |
| 1255 | -S "using encrypt then mac" |
| 1256 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1257 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1258 | run_test "Encrypt then MAC: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1259 | "$P_SRV debug_level=3 min_version=ssl3 \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1260 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1261 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1262 | 0 \ |
| 1263 | -C "client hello, adding encrypt_then_mac extension" \ |
| 1264 | -S "found encrypt then mac extension" \ |
| 1265 | -S "server hello, adding encrypt then mac extension" \ |
| 1266 | -C "found encrypt_then_mac extension" \ |
| 1267 | -C "using encrypt then mac" \ |
| 1268 | -S "using encrypt then mac" |
| 1269 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1270 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1271 | run_test "Encrypt then MAC: client enabled, server SSLv3" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 1272 | "$P_SRV debug_level=3 force_version=ssl3 \ |
| 1273 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1274 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1275 | 0 \ |
| 1276 | -c "client hello, adding encrypt_then_mac extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1277 | -S "found encrypt then mac extension" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 1278 | -S "server hello, adding encrypt then mac extension" \ |
| 1279 | -C "found encrypt_then_mac extension" \ |
| 1280 | -C "using encrypt then mac" \ |
| 1281 | -S "using encrypt then mac" |
| 1282 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 1283 | # Tests for Extended Master Secret extension |
| 1284 | |
| 1285 | run_test "Extended Master Secret: default" \ |
| 1286 | "$P_SRV debug_level=3" \ |
| 1287 | "$P_CLI debug_level=3" \ |
| 1288 | 0 \ |
| 1289 | -c "client hello, adding extended_master_secret extension" \ |
| 1290 | -s "found extended master secret extension" \ |
| 1291 | -s "server hello, adding extended master secret extension" \ |
| 1292 | -c "found extended_master_secret extension" \ |
| 1293 | -c "using extended master secret" \ |
| 1294 | -s "using extended master secret" |
| 1295 | |
| 1296 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 1297 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 1298 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 1299 | 0 \ |
| 1300 | -c "client hello, adding extended_master_secret extension" \ |
| 1301 | -s "found extended master secret extension" \ |
| 1302 | -S "server hello, adding extended master secret extension" \ |
| 1303 | -C "found extended_master_secret extension" \ |
| 1304 | -C "using extended master secret" \ |
| 1305 | -S "using extended master secret" |
| 1306 | |
| 1307 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 1308 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 1309 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 1310 | 0 \ |
| 1311 | -C "client hello, adding extended_master_secret extension" \ |
| 1312 | -S "found extended master secret extension" \ |
| 1313 | -S "server hello, adding extended master secret extension" \ |
| 1314 | -C "found extended_master_secret extension" \ |
| 1315 | -C "using extended master secret" \ |
| 1316 | -S "using extended master secret" |
| 1317 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1318 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1319 | run_test "Extended Master Secret: client SSLv3, server enabled" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1320 | "$P_SRV debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1321 | "$P_CLI debug_level=3 force_version=ssl3" \ |
| 1322 | 0 \ |
| 1323 | -C "client hello, adding extended_master_secret extension" \ |
| 1324 | -S "found extended master secret extension" \ |
| 1325 | -S "server hello, adding extended master secret extension" \ |
| 1326 | -C "found extended_master_secret extension" \ |
| 1327 | -C "using extended master secret" \ |
| 1328 | -S "using extended master secret" |
| 1329 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1330 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1331 | run_test "Extended Master Secret: client enabled, server SSLv3" \ |
| 1332 | "$P_SRV debug_level=3 force_version=ssl3" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1333 | "$P_CLI debug_level=3 min_version=ssl3" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1334 | 0 \ |
| 1335 | -c "client hello, adding extended_master_secret extension" \ |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 1336 | -S "found extended master secret extension" \ |
Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 1337 | -S "server hello, adding extended master secret extension" \ |
| 1338 | -C "found extended_master_secret extension" \ |
| 1339 | -C "using extended master secret" \ |
| 1340 | -S "using extended master secret" |
| 1341 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1342 | # Tests for FALLBACK_SCSV |
| 1343 | |
| 1344 | run_test "Fallback SCSV: default" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1345 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1346 | "$P_CLI debug_level=3 force_version=tls1_1" \ |
| 1347 | 0 \ |
| 1348 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1349 | -S "received FALLBACK_SCSV" \ |
| 1350 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1351 | -C "is a fatal alert message (msg 86)" |
| 1352 | |
| 1353 | run_test "Fallback SCSV: explicitly disabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1354 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1355 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1356 | 0 \ |
| 1357 | -C "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1358 | -S "received FALLBACK_SCSV" \ |
| 1359 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1360 | -C "is a fatal alert message (msg 86)" |
| 1361 | |
| 1362 | run_test "Fallback SCSV: enabled" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1363 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1364 | "$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] | 1365 | 1 \ |
| 1366 | -c "adding FALLBACK_SCSV" \ |
| 1367 | -s "received FALLBACK_SCSV" \ |
| 1368 | -s "inapropriate fallback" \ |
| 1369 | -c "is a fatal alert message (msg 86)" |
| 1370 | |
| 1371 | run_test "Fallback SCSV: enabled, max version" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1372 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1373 | "$P_CLI debug_level=3 fallback=1" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1374 | 0 \ |
| 1375 | -c "adding FALLBACK_SCSV" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1376 | -s "received FALLBACK_SCSV" \ |
| 1377 | -S "inapropriate fallback" \ |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 1378 | -C "is a fatal alert message (msg 86)" |
| 1379 | |
| 1380 | requires_openssl_with_fallback_scsv |
| 1381 | run_test "Fallback SCSV: default, openssl server" \ |
| 1382 | "$O_SRV" \ |
| 1383 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ |
| 1384 | 0 \ |
| 1385 | -C "adding FALLBACK_SCSV" \ |
| 1386 | -C "is a fatal alert message (msg 86)" |
| 1387 | |
| 1388 | requires_openssl_with_fallback_scsv |
| 1389 | run_test "Fallback SCSV: enabled, openssl server" \ |
| 1390 | "$O_SRV" \ |
| 1391 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ |
| 1392 | 1 \ |
| 1393 | -c "adding FALLBACK_SCSV" \ |
| 1394 | -c "is a fatal alert message (msg 86)" |
| 1395 | |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1396 | requires_openssl_with_fallback_scsv |
| 1397 | run_test "Fallback SCSV: disabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1398 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1399 | "$O_CLI -tls1_1" \ |
| 1400 | 0 \ |
| 1401 | -S "received FALLBACK_SCSV" \ |
| 1402 | -S "inapropriate fallback" |
| 1403 | |
| 1404 | requires_openssl_with_fallback_scsv |
| 1405 | run_test "Fallback SCSV: enabled, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1406 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1407 | "$O_CLI -tls1_1 -fallback_scsv" \ |
| 1408 | 1 \ |
| 1409 | -s "received FALLBACK_SCSV" \ |
| 1410 | -s "inapropriate fallback" |
| 1411 | |
| 1412 | requires_openssl_with_fallback_scsv |
| 1413 | run_test "Fallback SCSV: enabled, max version, openssl client" \ |
Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 1414 | "$P_SRV debug_level=2" \ |
Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 1415 | "$O_CLI -fallback_scsv" \ |
| 1416 | 0 \ |
| 1417 | -s "received FALLBACK_SCSV" \ |
| 1418 | -S "inapropriate fallback" |
| 1419 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1420 | # Test sending and receiving empty application data records |
| 1421 | |
| 1422 | run_test "Encrypt then MAC: empty application data record" \ |
| 1423 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 1424 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 1425 | 0 \ |
| 1426 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1427 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1428 | -c "0 bytes written in 1 fragments" |
| 1429 | |
Manuel Pégourié-Gonnard | 98a879a | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 1430 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1431 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 1432 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 1433 | 0 \ |
| 1434 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1435 | -c "0 bytes written in 1 fragments" |
| 1436 | |
| 1437 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 1438 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 1439 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 1440 | 0 \ |
| 1441 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 1442 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1443 | -c "0 bytes written in 1 fragments" |
| 1444 | |
Manuel Pégourié-Gonnard | 98a879a | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 1445 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 1446 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 1447 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 1448 | 0 \ |
| 1449 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 1450 | -c "0 bytes written in 1 fragments" |
| 1451 | |
Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 1452 | ## ClientHello generated with |
| 1453 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." |
| 1454 | ## then manually twiddling the ciphersuite list. |
| 1455 | ## The ClientHello content is spelled out below as a hex string as |
| 1456 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". |
| 1457 | ## The expected response is an inappropriate_fallback alert. |
| 1458 | requires_openssl_with_fallback_scsv |
| 1459 | run_test "Fallback SCSV: beginning of list" \ |
| 1460 | "$P_SRV debug_level=2" \ |
| 1461 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ |
| 1462 | 0 \ |
| 1463 | -s "received FALLBACK_SCSV" \ |
| 1464 | -s "inapropriate fallback" |
| 1465 | |
| 1466 | requires_openssl_with_fallback_scsv |
| 1467 | run_test "Fallback SCSV: end of list" \ |
| 1468 | "$P_SRV debug_level=2" \ |
| 1469 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ |
| 1470 | 0 \ |
| 1471 | -s "received FALLBACK_SCSV" \ |
| 1472 | -s "inapropriate fallback" |
| 1473 | |
| 1474 | ## Here the expected response is a valid ServerHello prefix, up to the random. |
| 1475 | requires_openssl_with_fallback_scsv |
| 1476 | run_test "Fallback SCSV: not in list" \ |
| 1477 | "$P_SRV debug_level=2" \ |
| 1478 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ |
| 1479 | 0 \ |
| 1480 | -S "received FALLBACK_SCSV" \ |
| 1481 | -S "inapropriate fallback" |
| 1482 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1483 | # Tests for CBC 1/n-1 record splitting |
| 1484 | |
| 1485 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 1486 | "$P_SRV" \ |
| 1487 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1488 | request_size=123 force_version=tls1_2" \ |
| 1489 | 0 \ |
| 1490 | -s "Read from client: 123 bytes read" \ |
| 1491 | -S "Read from client: 1 bytes read" \ |
| 1492 | -S "122 bytes read" |
| 1493 | |
| 1494 | run_test "CBC Record splitting: TLS 1.1, no splitting" \ |
| 1495 | "$P_SRV" \ |
| 1496 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1497 | request_size=123 force_version=tls1_1" \ |
| 1498 | 0 \ |
| 1499 | -s "Read from client: 123 bytes read" \ |
| 1500 | -S "Read from client: 1 bytes read" \ |
| 1501 | -S "122 bytes read" |
| 1502 | |
| 1503 | run_test "CBC Record splitting: TLS 1.0, splitting" \ |
| 1504 | "$P_SRV" \ |
| 1505 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1506 | request_size=123 force_version=tls1" \ |
| 1507 | 0 \ |
| 1508 | -S "Read from client: 123 bytes read" \ |
| 1509 | -s "Read from client: 1 bytes read" \ |
| 1510 | -s "122 bytes read" |
| 1511 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 1512 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1513 | run_test "CBC Record splitting: SSLv3, splitting" \ |
Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1514 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 1515 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1516 | request_size=123 force_version=ssl3" \ |
| 1517 | 0 \ |
| 1518 | -S "Read from client: 123 bytes read" \ |
| 1519 | -s "Read from client: 1 bytes read" \ |
| 1520 | -s "122 bytes read" |
| 1521 | |
| 1522 | 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] | 1523 | "$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] | 1524 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 1525 | request_size=123 force_version=tls1" \ |
| 1526 | 0 \ |
| 1527 | -s "Read from client: 123 bytes read" \ |
| 1528 | -S "Read from client: 1 bytes read" \ |
| 1529 | -S "122 bytes read" |
| 1530 | |
| 1531 | run_test "CBC Record splitting: TLS 1.0, splitting disabled" \ |
| 1532 | "$P_SRV" \ |
| 1533 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1534 | request_size=123 force_version=tls1 recsplit=0" \ |
| 1535 | 0 \ |
| 1536 | -s "Read from client: 123 bytes read" \ |
| 1537 | -S "Read from client: 1 bytes read" \ |
| 1538 | -S "122 bytes read" |
| 1539 | |
Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 1540 | run_test "CBC Record splitting: TLS 1.0, splitting, nbio" \ |
| 1541 | "$P_SRV nbio=2" \ |
| 1542 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 1543 | request_size=123 force_version=tls1" \ |
| 1544 | 0 \ |
| 1545 | -S "Read from client: 123 bytes read" \ |
| 1546 | -s "Read from client: 1 bytes read" \ |
| 1547 | -s "122 bytes read" |
| 1548 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1549 | # Tests for Session Tickets |
| 1550 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1551 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1552 | "$P_SRV debug_level=3 tickets=1" \ |
| 1553 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1554 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1555 | -c "client hello, adding session ticket extension" \ |
| 1556 | -s "found session ticket extension" \ |
| 1557 | -s "server hello, adding session ticket extension" \ |
| 1558 | -c "found session_ticket extension" \ |
| 1559 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1560 | -S "session successfully restored from cache" \ |
| 1561 | -s "session successfully restored from ticket" \ |
| 1562 | -s "a session has been resumed" \ |
| 1563 | -c "a session has been resumed" |
| 1564 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1565 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1566 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 1567 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 1568 | 0 \ |
| 1569 | -c "client hello, adding session ticket extension" \ |
| 1570 | -s "found session ticket extension" \ |
| 1571 | -s "server hello, adding session ticket extension" \ |
| 1572 | -c "found session_ticket extension" \ |
| 1573 | -c "parse new session ticket" \ |
| 1574 | -S "session successfully restored from cache" \ |
| 1575 | -s "session successfully restored from ticket" \ |
| 1576 | -s "a session has been resumed" \ |
| 1577 | -c "a session has been resumed" |
| 1578 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1579 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1580 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 1581 | "$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] | 1582 | 0 \ |
| 1583 | -c "client hello, adding session ticket extension" \ |
| 1584 | -s "found session ticket extension" \ |
| 1585 | -s "server hello, adding session ticket extension" \ |
| 1586 | -c "found session_ticket extension" \ |
| 1587 | -c "parse new session ticket" \ |
| 1588 | -S "session successfully restored from cache" \ |
| 1589 | -S "session successfully restored from ticket" \ |
| 1590 | -S "a session has been resumed" \ |
| 1591 | -C "a session has been resumed" |
| 1592 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1593 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1594 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1595 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1596 | 0 \ |
| 1597 | -c "client hello, adding session ticket extension" \ |
| 1598 | -c "found session_ticket extension" \ |
| 1599 | -c "parse new session ticket" \ |
| 1600 | -c "a session has been resumed" |
| 1601 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1602 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1603 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1604 | "( $O_CLI -sess_out $SESSION; \ |
| 1605 | $O_CLI -sess_in $SESSION; \ |
| 1606 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 1607 | 0 \ |
| 1608 | -s "found session ticket extension" \ |
| 1609 | -s "server hello, adding session ticket extension" \ |
| 1610 | -S "session successfully restored from cache" \ |
| 1611 | -s "session successfully restored from ticket" \ |
| 1612 | -s "a session has been resumed" |
| 1613 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1614 | # Tests for Session Tickets with DTLS |
| 1615 | |
| 1616 | run_test "Session resume using tickets, DTLS: basic" \ |
| 1617 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1618 | "$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] | 1619 | 0 \ |
| 1620 | -c "client hello, adding session ticket extension" \ |
| 1621 | -s "found session ticket extension" \ |
| 1622 | -s "server hello, adding session ticket extension" \ |
| 1623 | -c "found session_ticket extension" \ |
| 1624 | -c "parse new session ticket" \ |
| 1625 | -S "session successfully restored from cache" \ |
| 1626 | -s "session successfully restored from ticket" \ |
| 1627 | -s "a session has been resumed" \ |
| 1628 | -c "a session has been resumed" |
| 1629 | |
| 1630 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 1631 | "$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] | 1632 | "$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] | 1633 | 0 \ |
| 1634 | -c "client hello, adding session ticket extension" \ |
| 1635 | -s "found session ticket extension" \ |
| 1636 | -s "server hello, adding session ticket extension" \ |
| 1637 | -c "found session_ticket extension" \ |
| 1638 | -c "parse new session ticket" \ |
| 1639 | -S "session successfully restored from cache" \ |
| 1640 | -s "session successfully restored from ticket" \ |
| 1641 | -s "a session has been resumed" \ |
| 1642 | -c "a session has been resumed" |
| 1643 | |
| 1644 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 1645 | "$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] | 1646 | "$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] | 1647 | 0 \ |
| 1648 | -c "client hello, adding session ticket extension" \ |
| 1649 | -s "found session ticket extension" \ |
| 1650 | -s "server hello, adding session ticket extension" \ |
| 1651 | -c "found session_ticket extension" \ |
| 1652 | -c "parse new session ticket" \ |
| 1653 | -S "session successfully restored from cache" \ |
| 1654 | -S "session successfully restored from ticket" \ |
| 1655 | -S "a session has been resumed" \ |
| 1656 | -C "a session has been resumed" |
| 1657 | |
| 1658 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 1659 | "$O_SRV -dtls1" \ |
| 1660 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 1661 | 0 \ |
| 1662 | -c "client hello, adding session ticket extension" \ |
| 1663 | -c "found session_ticket extension" \ |
| 1664 | -c "parse new session ticket" \ |
| 1665 | -c "a session has been resumed" |
| 1666 | |
| 1667 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 1668 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 1669 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1670 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1671 | rm -f $SESSION )" \ |
| 1672 | 0 \ |
| 1673 | -s "found session ticket extension" \ |
| 1674 | -s "server hello, adding session ticket extension" \ |
| 1675 | -S "session successfully restored from cache" \ |
| 1676 | -s "session successfully restored from ticket" \ |
| 1677 | -s "a session has been resumed" |
| 1678 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1679 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1680 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1681 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1682 | "$P_SRV debug_level=3 tickets=0" \ |
| 1683 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1684 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1685 | -c "client hello, adding session ticket extension" \ |
| 1686 | -s "found session ticket extension" \ |
| 1687 | -S "server hello, adding session ticket extension" \ |
| 1688 | -C "found session_ticket extension" \ |
| 1689 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1690 | -s "session successfully restored from cache" \ |
| 1691 | -S "session successfully restored from ticket" \ |
| 1692 | -s "a session has been resumed" \ |
| 1693 | -c "a session has been resumed" |
| 1694 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1695 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1696 | "$P_SRV debug_level=3 tickets=1" \ |
| 1697 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1698 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1699 | -C "client hello, adding session ticket extension" \ |
| 1700 | -S "found session ticket extension" \ |
| 1701 | -S "server hello, adding session ticket extension" \ |
| 1702 | -C "found session_ticket extension" \ |
| 1703 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1704 | -s "session successfully restored from cache" \ |
| 1705 | -S "session successfully restored from ticket" \ |
| 1706 | -s "a session has been resumed" \ |
| 1707 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1708 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1709 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1710 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 1711 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1712 | 0 \ |
| 1713 | -S "session successfully restored from cache" \ |
| 1714 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1715 | -S "a session has been resumed" \ |
| 1716 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 1717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1718 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1719 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 1720 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 1721 | 0 \ |
| 1722 | -s "session successfully restored from cache" \ |
| 1723 | -S "session successfully restored from ticket" \ |
| 1724 | -s "a session has been resumed" \ |
| 1725 | -c "a session has been resumed" |
| 1726 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 1727 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1728 | "$P_SRV debug_level=3 tickets=0" \ |
| 1729 | "$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] | 1730 | 0 \ |
| 1731 | -s "session successfully restored from cache" \ |
| 1732 | -S "session successfully restored from ticket" \ |
| 1733 | -s "a session has been resumed" \ |
| 1734 | -c "a session has been resumed" |
| 1735 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1736 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1737 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 1738 | "$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] | 1739 | 0 \ |
| 1740 | -S "session successfully restored from cache" \ |
| 1741 | -S "session successfully restored from ticket" \ |
| 1742 | -S "a session has been resumed" \ |
| 1743 | -C "a session has been resumed" |
| 1744 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1745 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1746 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 1747 | "$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] | 1748 | 0 \ |
| 1749 | -s "session successfully restored from cache" \ |
| 1750 | -S "session successfully restored from ticket" \ |
| 1751 | -s "a session has been resumed" \ |
| 1752 | -c "a session has been resumed" |
| 1753 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1754 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1755 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1756 | "( $O_CLI -sess_out $SESSION; \ |
| 1757 | $O_CLI -sess_in $SESSION; \ |
| 1758 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1759 | 0 \ |
| 1760 | -s "found session ticket extension" \ |
| 1761 | -S "server hello, adding session ticket extension" \ |
| 1762 | -s "session successfully restored from cache" \ |
| 1763 | -S "session successfully restored from ticket" \ |
| 1764 | -s "a session has been resumed" |
| 1765 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1766 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1767 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1768 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 1769 | 0 \ |
| 1770 | -C "found session_ticket extension" \ |
| 1771 | -C "parse new session ticket" \ |
| 1772 | -c "a session has been resumed" |
| 1773 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 1774 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 1775 | |
| 1776 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 1777 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1778 | "$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] | 1779 | 0 \ |
| 1780 | -c "client hello, adding session ticket extension" \ |
| 1781 | -s "found session ticket extension" \ |
| 1782 | -S "server hello, adding session ticket extension" \ |
| 1783 | -C "found session_ticket extension" \ |
| 1784 | -C "parse new session ticket" \ |
| 1785 | -s "session successfully restored from cache" \ |
| 1786 | -S "session successfully restored from ticket" \ |
| 1787 | -s "a session has been resumed" \ |
| 1788 | -c "a session has been resumed" |
| 1789 | |
| 1790 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 1791 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1792 | "$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] | 1793 | 0 \ |
| 1794 | -C "client hello, adding session ticket extension" \ |
| 1795 | -S "found session ticket extension" \ |
| 1796 | -S "server hello, adding session ticket extension" \ |
| 1797 | -C "found session_ticket extension" \ |
| 1798 | -C "parse new session ticket" \ |
| 1799 | -s "session successfully restored from cache" \ |
| 1800 | -S "session successfully restored from ticket" \ |
| 1801 | -s "a session has been resumed" \ |
| 1802 | -c "a session has been resumed" |
| 1803 | |
| 1804 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 1805 | "$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] | 1806 | "$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] | 1807 | 0 \ |
| 1808 | -S "session successfully restored from cache" \ |
| 1809 | -S "session successfully restored from ticket" \ |
| 1810 | -S "a session has been resumed" \ |
| 1811 | -C "a session has been resumed" |
| 1812 | |
| 1813 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 1814 | "$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] | 1815 | "$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] | 1816 | 0 \ |
| 1817 | -s "session successfully restored from cache" \ |
| 1818 | -S "session successfully restored from ticket" \ |
| 1819 | -s "a session has been resumed" \ |
| 1820 | -c "a session has been resumed" |
| 1821 | |
| 1822 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 1823 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 1824 | "$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] | 1825 | 0 \ |
| 1826 | -s "session successfully restored from cache" \ |
| 1827 | -S "session successfully restored from ticket" \ |
| 1828 | -s "a session has been resumed" \ |
| 1829 | -c "a session has been resumed" |
| 1830 | |
| 1831 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 1832 | "$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] | 1833 | "$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] | 1834 | 0 \ |
| 1835 | -S "session successfully restored from cache" \ |
| 1836 | -S "session successfully restored from ticket" \ |
| 1837 | -S "a session has been resumed" \ |
| 1838 | -C "a session has been resumed" |
| 1839 | |
| 1840 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 1841 | "$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] | 1842 | "$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] | 1843 | 0 \ |
| 1844 | -s "session successfully restored from cache" \ |
| 1845 | -S "session successfully restored from ticket" \ |
| 1846 | -s "a session has been resumed" \ |
| 1847 | -c "a session has been resumed" |
| 1848 | |
| 1849 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 1850 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 1851 | "( $O_CLI -dtls1 -sess_out $SESSION; \ |
| 1852 | $O_CLI -dtls1 -sess_in $SESSION; \ |
| 1853 | rm -f $SESSION )" \ |
| 1854 | 0 \ |
| 1855 | -s "found session ticket extension" \ |
| 1856 | -S "server hello, adding session ticket extension" \ |
| 1857 | -s "session successfully restored from cache" \ |
| 1858 | -S "session successfully restored from ticket" \ |
| 1859 | -s "a session has been resumed" |
| 1860 | |
| 1861 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 1862 | "$O_SRV -dtls1" \ |
| 1863 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 1864 | 0 \ |
| 1865 | -C "found session_ticket extension" \ |
| 1866 | -C "parse new session ticket" \ |
| 1867 | -c "a session has been resumed" |
| 1868 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1869 | # Tests for Max Fragment Length extension |
| 1870 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1871 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then |
| 1872 | printf "${CONFIG_H} defines MBEDTLS_SSL_MAX_CONTENT_LEN to be less than 4096. Fragment length tests will fail.\n" |
Hanno Becker | 6428f8d | 2017-09-22 16:58:50 +0100 | [diff] [blame] | 1873 | exit 1 |
| 1874 | fi |
| 1875 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1876 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
| 1877 | printf "Using non-default maximum content length $MAX_CONTENT_LEN\n" |
| 1878 | fi |
| 1879 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1880 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1881 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1882 | "$P_SRV debug_level=3" \ |
| 1883 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1884 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1885 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1886 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1887 | -C "client hello, adding max_fragment_length extension" \ |
| 1888 | -S "found max fragment length extension" \ |
| 1889 | -S "server hello, max_fragment_length extension" \ |
| 1890 | -C "found max_fragment_length extension" |
| 1891 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1892 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1893 | run_test "Max fragment length: enabled, default, larger message" \ |
| 1894 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1895 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1896 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1897 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1898 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1899 | -C "client hello, adding max_fragment_length extension" \ |
| 1900 | -S "found max fragment length extension" \ |
| 1901 | -S "server hello, max_fragment_length extension" \ |
| 1902 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1903 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1904 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1905 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1906 | |
| 1907 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1908 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 1909 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1910 | "$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] | 1911 | 1 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1912 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
| 1913 | -s "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1914 | -C "client hello, adding max_fragment_length extension" \ |
| 1915 | -S "found max fragment length extension" \ |
| 1916 | -S "server hello, max_fragment_length extension" \ |
| 1917 | -C "found max_fragment_length extension" \ |
| 1918 | -c "fragment larger than.*maximum " |
| 1919 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1920 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 1921 | # (session fragment length will be 16384 regardless of mbedtls |
| 1922 | # content length configuration.) |
| 1923 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1924 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1925 | run_test "Max fragment length: disabled, larger message" \ |
| 1926 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1927 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1928 | 0 \ |
| 1929 | -C "Maximum fragment length is 16384" \ |
| 1930 | -S "Maximum fragment length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1931 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 1932 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 1933 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 1934 | |
| 1935 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 1936 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 1937 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1938 | "$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] | 1939 | 1 \ |
| 1940 | -C "Maximum fragment length is 16384" \ |
| 1941 | -S "Maximum fragment length is 16384" \ |
| 1942 | -c "fragment larger than.*maximum " |
| 1943 | |
| 1944 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1945 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1946 | "$P_SRV debug_level=3" \ |
| 1947 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1948 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1949 | -c "Maximum fragment length is 4096" \ |
| 1950 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1951 | -c "client hello, adding max_fragment_length extension" \ |
| 1952 | -s "found max fragment length extension" \ |
| 1953 | -s "server hello, max_fragment_length extension" \ |
| 1954 | -c "found max_fragment_length extension" |
| 1955 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1956 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1957 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1958 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 1959 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1960 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 1961 | -c "Maximum fragment length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1962 | -s "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 1963 | -C "client hello, adding max_fragment_length extension" \ |
| 1964 | -S "found max fragment length extension" \ |
| 1965 | -S "server hello, max_fragment_length extension" \ |
| 1966 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1967 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1968 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 1969 | requires_gnutls |
| 1970 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1971 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1972 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1973 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1974 | -c "Maximum fragment length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 1975 | -c "client hello, adding max_fragment_length extension" \ |
| 1976 | -c "found max_fragment_length extension" |
| 1977 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1978 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1979 | run_test "Max fragment length: client, message just fits" \ |
| 1980 | "$P_SRV debug_level=3" \ |
| 1981 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 1982 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1983 | -c "Maximum fragment length is 2048" \ |
| 1984 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1985 | -c "client hello, adding max_fragment_length extension" \ |
| 1986 | -s "found max fragment length extension" \ |
| 1987 | -s "server hello, max_fragment_length extension" \ |
| 1988 | -c "found max_fragment_length extension" \ |
| 1989 | -c "2048 bytes written in 1 fragments" \ |
| 1990 | -s "2048 bytes read" |
| 1991 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 1992 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1993 | run_test "Max fragment length: client, larger message" \ |
| 1994 | "$P_SRV debug_level=3" \ |
| 1995 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 1996 | 0 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 1997 | -c "Maximum fragment length is 2048" \ |
| 1998 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 1999 | -c "client hello, adding max_fragment_length extension" \ |
| 2000 | -s "found max fragment length extension" \ |
| 2001 | -s "server hello, max_fragment_length extension" \ |
| 2002 | -c "found max_fragment_length extension" \ |
| 2003 | -c "2345 bytes written in 2 fragments" \ |
| 2004 | -s "2048 bytes read" \ |
| 2005 | -s "297 bytes read" |
| 2006 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2007 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 2008 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2009 | "$P_SRV debug_level=3 dtls=1" \ |
| 2010 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 2011 | 1 \ |
Manuel Pégourié-Gonnard | a2cda6b | 2015-08-31 18:30:52 +0200 | [diff] [blame] | 2012 | -c "Maximum fragment length is 2048" \ |
| 2013 | -s "Maximum fragment length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 2014 | -c "client hello, adding max_fragment_length extension" \ |
| 2015 | -s "found max fragment length extension" \ |
| 2016 | -s "server hello, max_fragment_length extension" \ |
| 2017 | -c "found max_fragment_length extension" \ |
| 2018 | -c "fragment larger than.*maximum" |
| 2019 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2020 | # Tests for renegotiation |
| 2021 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2022 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2023 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2024 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2025 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2026 | 0 \ |
| 2027 | -C "client hello, adding renegotiation extension" \ |
| 2028 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2029 | -S "found renegotiation extension" \ |
| 2030 | -s "server hello, secure renegotiation extension" \ |
| 2031 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2032 | -C "=> renegotiate" \ |
| 2033 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2034 | -S "write hello request" |
| 2035 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2036 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2037 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2038 | "$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] | 2039 | "$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] | 2040 | 0 \ |
| 2041 | -c "client hello, adding renegotiation extension" \ |
| 2042 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2043 | -s "found renegotiation extension" \ |
| 2044 | -s "server hello, secure renegotiation extension" \ |
| 2045 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2046 | -c "=> renegotiate" \ |
| 2047 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2048 | -S "write hello request" |
| 2049 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2050 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2051 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2052 | "$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] | 2053 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2054 | 0 \ |
| 2055 | -c "client hello, adding renegotiation extension" \ |
| 2056 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2057 | -s "found renegotiation extension" \ |
| 2058 | -s "server hello, secure renegotiation extension" \ |
| 2059 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2060 | -c "=> renegotiate" \ |
| 2061 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2062 | -s "write hello request" |
| 2063 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2064 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2065 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2066 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2067 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2068 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 2069 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 2070 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2071 | 0 \ |
| 2072 | -c "client hello, adding renegotiation extension" \ |
| 2073 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2074 | -s "found renegotiation extension" \ |
| 2075 | -s "server hello, secure renegotiation extension" \ |
| 2076 | -c "found renegotiation extension" \ |
| 2077 | -c "=> renegotiate" \ |
| 2078 | -s "=> renegotiate" \ |
| 2079 | -S "write hello request" \ |
| 2080 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2081 | |
| 2082 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 2083 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 2084 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2085 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 2086 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 2087 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 2088 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2089 | 0 \ |
| 2090 | -c "client hello, adding renegotiation extension" \ |
| 2091 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2092 | -s "found renegotiation extension" \ |
| 2093 | -s "server hello, secure renegotiation extension" \ |
| 2094 | -c "found renegotiation extension" \ |
| 2095 | -c "=> renegotiate" \ |
| 2096 | -s "=> renegotiate" \ |
| 2097 | -s "write hello request" \ |
| 2098 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 2099 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2100 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2101 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2102 | "$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] | 2103 | "$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] | 2104 | 0 \ |
| 2105 | -c "client hello, adding renegotiation extension" \ |
| 2106 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2107 | -s "found renegotiation extension" \ |
| 2108 | -s "server hello, secure renegotiation extension" \ |
| 2109 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2110 | -c "=> renegotiate" \ |
| 2111 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2112 | -s "write hello request" |
| 2113 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2114 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2115 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2116 | "$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] | 2117 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2118 | 1 \ |
| 2119 | -c "client hello, adding renegotiation extension" \ |
| 2120 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2121 | -S "found renegotiation extension" \ |
| 2122 | -s "server hello, secure renegotiation extension" \ |
| 2123 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2124 | -c "=> renegotiate" \ |
| 2125 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2126 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 2127 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2128 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2129 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2130 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2131 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2132 | "$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] | 2133 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2134 | 0 \ |
| 2135 | -C "client hello, adding renegotiation extension" \ |
| 2136 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2137 | -S "found renegotiation extension" \ |
| 2138 | -s "server hello, secure renegotiation extension" \ |
| 2139 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 2140 | -C "=> renegotiate" \ |
| 2141 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2142 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 2143 | -S "SSL - An unexpected message was received from our peer" \ |
| 2144 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 2145 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2146 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2147 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2148 | "$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] | 2149 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2150 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2151 | 0 \ |
| 2152 | -C "client hello, adding renegotiation extension" \ |
| 2153 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2154 | -S "found renegotiation extension" \ |
| 2155 | -s "server hello, secure renegotiation extension" \ |
| 2156 | -c "found renegotiation extension" \ |
| 2157 | -C "=> renegotiate" \ |
| 2158 | -S "=> renegotiate" \ |
| 2159 | -s "write hello request" \ |
| 2160 | -S "SSL - An unexpected message was received from our peer" \ |
| 2161 | -S "failed" |
| 2162 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2163 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2164 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2165 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2166 | "$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] | 2167 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2168 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2169 | 0 \ |
| 2170 | -C "client hello, adding renegotiation extension" \ |
| 2171 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2172 | -S "found renegotiation extension" \ |
| 2173 | -s "server hello, secure renegotiation extension" \ |
| 2174 | -c "found renegotiation extension" \ |
| 2175 | -C "=> renegotiate" \ |
| 2176 | -S "=> renegotiate" \ |
| 2177 | -s "write hello request" \ |
| 2178 | -S "SSL - An unexpected message was received from our peer" \ |
| 2179 | -S "failed" |
| 2180 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2181 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2182 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2183 | "$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] | 2184 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2185 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2186 | 0 \ |
| 2187 | -C "client hello, adding renegotiation extension" \ |
| 2188 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2189 | -S "found renegotiation extension" \ |
| 2190 | -s "server hello, secure renegotiation extension" \ |
| 2191 | -c "found renegotiation extension" \ |
| 2192 | -C "=> renegotiate" \ |
| 2193 | -S "=> renegotiate" \ |
| 2194 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 2195 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2196 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2197 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2198 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2199 | "$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] | 2200 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2201 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 2202 | 0 \ |
| 2203 | -c "client hello, adding renegotiation extension" \ |
| 2204 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2205 | -s "found renegotiation extension" \ |
| 2206 | -s "server hello, secure renegotiation extension" \ |
| 2207 | -c "found renegotiation extension" \ |
| 2208 | -c "=> renegotiate" \ |
| 2209 | -s "=> renegotiate" \ |
| 2210 | -s "write hello request" \ |
| 2211 | -S "SSL - An unexpected message was received from our peer" \ |
| 2212 | -S "failed" |
| 2213 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2214 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2215 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2216 | "$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] | 2217 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 2218 | 0 \ |
| 2219 | -C "client hello, adding renegotiation extension" \ |
| 2220 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2221 | -S "found renegotiation extension" \ |
| 2222 | -s "server hello, secure renegotiation extension" \ |
| 2223 | -c "found renegotiation extension" \ |
| 2224 | -S "record counter limit reached: renegotiate" \ |
| 2225 | -C "=> renegotiate" \ |
| 2226 | -S "=> renegotiate" \ |
| 2227 | -S "write hello request" \ |
| 2228 | -S "SSL - An unexpected message was received from our peer" \ |
| 2229 | -S "failed" |
| 2230 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 2231 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2232 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2233 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2234 | "$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] | 2235 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2236 | 0 \ |
| 2237 | -c "client hello, adding renegotiation extension" \ |
| 2238 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2239 | -s "found renegotiation extension" \ |
| 2240 | -s "server hello, secure renegotiation extension" \ |
| 2241 | -c "found renegotiation extension" \ |
| 2242 | -s "record counter limit reached: renegotiate" \ |
| 2243 | -c "=> renegotiate" \ |
| 2244 | -s "=> renegotiate" \ |
| 2245 | -s "write hello request" \ |
| 2246 | -S "SSL - An unexpected message was received from our peer" \ |
| 2247 | -S "failed" |
| 2248 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2249 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2250 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2251 | "$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] | 2252 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2253 | 0 \ |
| 2254 | -c "client hello, adding renegotiation extension" \ |
| 2255 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2256 | -s "found renegotiation extension" \ |
| 2257 | -s "server hello, secure renegotiation extension" \ |
| 2258 | -c "found renegotiation extension" \ |
| 2259 | -s "record counter limit reached: renegotiate" \ |
| 2260 | -c "=> renegotiate" \ |
| 2261 | -s "=> renegotiate" \ |
| 2262 | -s "write hello request" \ |
| 2263 | -S "SSL - An unexpected message was received from our peer" \ |
| 2264 | -S "failed" |
| 2265 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2266 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 2267 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2268 | "$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] | 2269 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 2270 | 0 \ |
| 2271 | -C "client hello, adding renegotiation extension" \ |
| 2272 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2273 | -S "found renegotiation extension" \ |
| 2274 | -s "server hello, secure renegotiation extension" \ |
| 2275 | -c "found renegotiation extension" \ |
| 2276 | -S "record counter limit reached: renegotiate" \ |
| 2277 | -C "=> renegotiate" \ |
| 2278 | -S "=> renegotiate" \ |
| 2279 | -S "write hello request" \ |
| 2280 | -S "SSL - An unexpected message was received from our peer" \ |
| 2281 | -S "failed" |
| 2282 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2283 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2284 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2285 | "$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] | 2286 | "$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] | 2287 | 0 \ |
| 2288 | -c "client hello, adding renegotiation extension" \ |
| 2289 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2290 | -s "found renegotiation extension" \ |
| 2291 | -s "server hello, secure renegotiation extension" \ |
| 2292 | -c "found renegotiation extension" \ |
| 2293 | -c "=> renegotiate" \ |
| 2294 | -s "=> renegotiate" \ |
| 2295 | -S "write hello request" |
| 2296 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2297 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2298 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 2299 | "$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] | 2300 | "$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] | 2301 | 0 \ |
| 2302 | -c "client hello, adding renegotiation extension" \ |
| 2303 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2304 | -s "found renegotiation extension" \ |
| 2305 | -s "server hello, secure renegotiation extension" \ |
| 2306 | -c "found renegotiation extension" \ |
| 2307 | -c "=> renegotiate" \ |
| 2308 | -s "=> renegotiate" \ |
| 2309 | -s "write hello request" |
| 2310 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2311 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2312 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 2313 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2314 | "$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] | 2315 | 0 \ |
| 2316 | -c "client hello, adding renegotiation extension" \ |
| 2317 | -c "found renegotiation extension" \ |
| 2318 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2319 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2320 | -C "error" \ |
| 2321 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2322 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2323 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2324 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2325 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 2326 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2327 | "$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] | 2328 | 0 \ |
| 2329 | -c "client hello, adding renegotiation extension" \ |
| 2330 | -c "found renegotiation extension" \ |
| 2331 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2332 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 2333 | -C "error" \ |
| 2334 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2335 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2336 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2337 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2338 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 2339 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2340 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2341 | 1 \ |
| 2342 | -c "client hello, adding renegotiation extension" \ |
| 2343 | -C "found renegotiation extension" \ |
| 2344 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2345 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2346 | -c "error" \ |
| 2347 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2348 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2349 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2350 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2351 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 2352 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2353 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2354 | allow_legacy=0" \ |
| 2355 | 1 \ |
| 2356 | -c "client hello, adding renegotiation extension" \ |
| 2357 | -C "found renegotiation extension" \ |
| 2358 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2359 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2360 | -c "error" \ |
| 2361 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 2362 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2363 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2364 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2365 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 2366 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2367 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 2368 | allow_legacy=1" \ |
| 2369 | 0 \ |
| 2370 | -c "client hello, adding renegotiation extension" \ |
| 2371 | -C "found renegotiation extension" \ |
| 2372 | -c "=> renegotiate" \ |
| 2373 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2374 | -C "error" \ |
| 2375 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2376 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2377 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 2378 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 2379 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 2380 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 2381 | 0 \ |
| 2382 | -c "client hello, adding renegotiation extension" \ |
| 2383 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2384 | -s "found renegotiation extension" \ |
| 2385 | -s "server hello, secure renegotiation extension" \ |
| 2386 | -c "found renegotiation extension" \ |
| 2387 | -c "=> renegotiate" \ |
| 2388 | -s "=> renegotiate" \ |
| 2389 | -S "write hello request" |
| 2390 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2391 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 2392 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 2393 | "$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] | 2394 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 2395 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 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 | -c "=> renegotiate" \ |
| 2403 | -s "=> renegotiate" \ |
| 2404 | -s "write hello request" |
| 2405 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2406 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2407 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 2408 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 2409 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 2410 | 0 \ |
| 2411 | -c "client hello, adding renegotiation extension" \ |
| 2412 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 2413 | -s "found renegotiation extension" \ |
| 2414 | -s "server hello, secure renegotiation extension" \ |
| 2415 | -s "record counter limit reached: renegotiate" \ |
| 2416 | -c "=> renegotiate" \ |
| 2417 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2418 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 2419 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 2420 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 2421 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2422 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 2423 | "$G_SRV -u --mtu 4096" \ |
| 2424 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 2425 | 0 \ |
| 2426 | -c "client hello, adding renegotiation extension" \ |
| 2427 | -c "found renegotiation extension" \ |
| 2428 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2429 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 2430 | -C "error" \ |
| 2431 | -s "Extra-header:" |
| 2432 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2433 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 2434 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2435 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2436 | run_test "Renego ext: gnutls server strict, client default" \ |
| 2437 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 2438 | "$P_CLI debug_level=3" \ |
| 2439 | 0 \ |
| 2440 | -c "found renegotiation extension" \ |
| 2441 | -C "error" \ |
| 2442 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2443 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2444 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2445 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 2446 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2447 | "$P_CLI debug_level=3" \ |
| 2448 | 0 \ |
| 2449 | -C "found renegotiation extension" \ |
| 2450 | -C "error" \ |
| 2451 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 2452 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2453 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2454 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 2455 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 2456 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 2457 | 1 \ |
| 2458 | -C "found renegotiation extension" \ |
| 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 |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2463 | run_test "Renego ext: gnutls client strict, server default" \ |
| 2464 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2465 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2466 | 0 \ |
| 2467 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2468 | -s "server hello, secure renegotiation extension" |
| 2469 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2470 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2471 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 2472 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2473 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2474 | 0 \ |
| 2475 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2476 | -S "server hello, secure renegotiation extension" |
| 2477 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 2478 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2479 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 2480 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2481 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 2482 | 1 \ |
| 2483 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 2484 | -S "server hello, secure renegotiation extension" |
| 2485 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2486 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 2487 | |
| 2488 | requires_gnutls |
| 2489 | run_test "DER format: no trailing bytes" \ |
| 2490 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 2491 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2492 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2493 | 0 \ |
| 2494 | -c "Handshake was completed" \ |
| 2495 | |
| 2496 | requires_gnutls |
| 2497 | run_test "DER format: with a trailing zero byte" \ |
| 2498 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 2499 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2500 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2501 | 0 \ |
| 2502 | -c "Handshake was completed" \ |
| 2503 | |
| 2504 | requires_gnutls |
| 2505 | run_test "DER format: with a trailing random byte" \ |
| 2506 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 2507 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2508 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2509 | 0 \ |
| 2510 | -c "Handshake was completed" \ |
| 2511 | |
| 2512 | requires_gnutls |
| 2513 | run_test "DER format: with 2 trailing random bytes" \ |
| 2514 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 2515 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2516 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2517 | 0 \ |
| 2518 | -c "Handshake was completed" \ |
| 2519 | |
| 2520 | requires_gnutls |
| 2521 | run_test "DER format: with 4 trailing random bytes" \ |
| 2522 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 2523 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2524 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2525 | 0 \ |
| 2526 | -c "Handshake was completed" \ |
| 2527 | |
| 2528 | requires_gnutls |
| 2529 | run_test "DER format: with 8 trailing random bytes" \ |
| 2530 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 2531 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2532 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2533 | 0 \ |
| 2534 | -c "Handshake was completed" \ |
| 2535 | |
| 2536 | requires_gnutls |
| 2537 | run_test "DER format: with 9 trailing random bytes" \ |
| 2538 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 2539 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 2540 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 2541 | 0 \ |
| 2542 | -c "Handshake was completed" \ |
| 2543 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2544 | # Tests for auth_mode |
| 2545 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2546 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2547 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2548 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2549 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2550 | 1 \ |
| 2551 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2552 | -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] | 2553 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2554 | -c "X509 - Certificate verification failed" |
| 2555 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2556 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2557 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 2558 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2559 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2560 | 0 \ |
| 2561 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2562 | -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] | 2563 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2564 | -C "X509 - Certificate verification failed" |
| 2565 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 2566 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 2567 | "$P_SRV" \ |
| 2568 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 2569 | 0 \ |
| 2570 | -c "x509_verify_cert() returned" \ |
| 2571 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2572 | -c "! Certificate verification flags"\ |
| 2573 | -C "! mbedtls_ssl_handshake returned" \ |
| 2574 | -C "X509 - Certificate verification failed" \ |
| 2575 | -C "SSL - No CA Chain is set, but required to operate" |
| 2576 | |
| 2577 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 2578 | "$P_SRV" \ |
| 2579 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 2580 | 1 \ |
| 2581 | -c "x509_verify_cert() returned" \ |
| 2582 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 2583 | -c "! Certificate verification flags"\ |
| 2584 | -c "! mbedtls_ssl_handshake returned" \ |
| 2585 | -c "SSL - No CA Chain is set, but required to operate" |
| 2586 | |
| 2587 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 2588 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 2589 | # the client informs the server about the supported curves - it does, though, in the |
| 2590 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 2591 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 2592 | # different means to have the server ignoring the client's supported curve list. |
| 2593 | |
| 2594 | requires_config_enabled MBEDTLS_ECP_C |
| 2595 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 2596 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2597 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2598 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 2599 | 1 \ |
| 2600 | -c "bad certificate (EC key curve)"\ |
| 2601 | -c "! Certificate verification flags"\ |
| 2602 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 2603 | |
| 2604 | requires_config_enabled MBEDTLS_ECP_C |
| 2605 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 2606 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 2607 | crt_file=data_files/server5.ku-ka.crt" \ |
| 2608 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 2609 | 1 \ |
| 2610 | -c "bad certificate (EC key curve)"\ |
| 2611 | -c "! Certificate verification flags"\ |
| 2612 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 2613 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2614 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 2615 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2616 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2617 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2618 | 0 \ |
| 2619 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2620 | -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] | 2621 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2622 | -C "X509 - Certificate verification failed" |
| 2623 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 2624 | run_test "Authentication: client SHA256, server required" \ |
| 2625 | "$P_SRV auth_mode=required" \ |
| 2626 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2627 | key_file=data_files/server6.key \ |
| 2628 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 2629 | 0 \ |
| 2630 | -c "Supported Signature Algorithm found: 4," \ |
| 2631 | -c "Supported Signature Algorithm found: 5," |
| 2632 | |
| 2633 | run_test "Authentication: client SHA384, server required" \ |
| 2634 | "$P_SRV auth_mode=required" \ |
| 2635 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 2636 | key_file=data_files/server6.key \ |
| 2637 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 2638 | 0 \ |
| 2639 | -c "Supported Signature Algorithm found: 4," \ |
| 2640 | -c "Supported Signature Algorithm found: 5," |
| 2641 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2642 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 2643 | run_test "Authentication: client has no cert, server required (SSLv3)" \ |
| 2644 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ |
| 2645 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ |
| 2646 | key_file=data_files/server5.key" \ |
| 2647 | 1 \ |
| 2648 | -S "skip write certificate request" \ |
| 2649 | -C "skip parse certificate request" \ |
| 2650 | -c "got a certificate request" \ |
| 2651 | -c "got no certificate to send" \ |
| 2652 | -S "x509_verify_cert() returned" \ |
| 2653 | -s "client has no certificate" \ |
| 2654 | -s "! mbedtls_ssl_handshake returned" \ |
| 2655 | -c "! mbedtls_ssl_handshake returned" \ |
| 2656 | -s "No client certification received from the client, but required by the authentication mode" |
| 2657 | |
| 2658 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 2659 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2660 | "$P_CLI debug_level=3 crt_file=none \ |
| 2661 | key_file=data_files/server5.key" \ |
| 2662 | 1 \ |
| 2663 | -S "skip write certificate request" \ |
| 2664 | -C "skip parse certificate request" \ |
| 2665 | -c "got a certificate request" \ |
| 2666 | -c "= write certificate$" \ |
| 2667 | -C "skip write certificate$" \ |
| 2668 | -S "x509_verify_cert() returned" \ |
| 2669 | -s "client has no certificate" \ |
| 2670 | -s "! mbedtls_ssl_handshake returned" \ |
| 2671 | -c "! mbedtls_ssl_handshake returned" \ |
| 2672 | -s "No client certification received from the client, but required by the authentication mode" |
| 2673 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2674 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2675 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2676 | "$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] | 2677 | key_file=data_files/server5.key" \ |
| 2678 | 1 \ |
| 2679 | -S "skip write certificate request" \ |
| 2680 | -C "skip parse certificate request" \ |
| 2681 | -c "got a certificate request" \ |
| 2682 | -C "skip write certificate" \ |
| 2683 | -C "skip write certificate verify" \ |
| 2684 | -S "skip parse certificate verify" \ |
| 2685 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2686 | -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] | 2687 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2688 | -s "send alert level=2 message=48" \ |
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 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 2691 | # We don't check that the client receives the alert because it might |
| 2692 | # detect that its write end of the connection is closed and abort |
| 2693 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2694 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2695 | run_test "Authentication: client cert not trusted, server required" \ |
| 2696 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2697 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2698 | key_file=data_files/server5.key" \ |
| 2699 | 1 \ |
| 2700 | -S "skip write certificate request" \ |
| 2701 | -C "skip parse certificate request" \ |
| 2702 | -c "got a certificate request" \ |
| 2703 | -C "skip write certificate" \ |
| 2704 | -C "skip write certificate verify" \ |
| 2705 | -S "skip parse certificate verify" \ |
| 2706 | -s "x509_verify_cert() returned" \ |
| 2707 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2708 | -s "! mbedtls_ssl_handshake returned" \ |
| 2709 | -c "! mbedtls_ssl_handshake returned" \ |
| 2710 | -s "X509 - Certificate verification failed" |
| 2711 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2712 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2713 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2714 | "$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] | 2715 | key_file=data_files/server5.key" \ |
| 2716 | 0 \ |
| 2717 | -S "skip write certificate request" \ |
| 2718 | -C "skip parse certificate request" \ |
| 2719 | -c "got a certificate request" \ |
| 2720 | -C "skip write certificate" \ |
| 2721 | -C "skip write certificate verify" \ |
| 2722 | -S "skip parse certificate verify" \ |
| 2723 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2724 | -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] | 2725 | -S "! mbedtls_ssl_handshake returned" \ |
| 2726 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2727 | -S "X509 - Certificate verification failed" |
| 2728 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2729 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2730 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 2731 | "$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] | 2732 | key_file=data_files/server5.key" \ |
| 2733 | 0 \ |
| 2734 | -s "skip write certificate request" \ |
| 2735 | -C "skip parse certificate request" \ |
| 2736 | -c "got no certificate request" \ |
| 2737 | -c "skip write certificate" \ |
| 2738 | -c "skip write certificate verify" \ |
| 2739 | -s "skip parse certificate verify" \ |
| 2740 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2741 | -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] | 2742 | -S "! mbedtls_ssl_handshake returned" \ |
| 2743 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 2744 | -S "X509 - Certificate verification failed" |
| 2745 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2746 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2747 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 2748 | "$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] | 2749 | 0 \ |
| 2750 | -S "skip write certificate request" \ |
| 2751 | -C "skip parse certificate request" \ |
| 2752 | -c "got a certificate request" \ |
| 2753 | -C "skip write certificate$" \ |
| 2754 | -C "got no certificate to send" \ |
| 2755 | -S "SSLv3 client has no certificate" \ |
| 2756 | -c "skip write certificate verify" \ |
| 2757 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2758 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2759 | -S "! mbedtls_ssl_handshake returned" \ |
| 2760 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2761 | -S "X509 - Certificate verification failed" |
| 2762 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2763 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2764 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2765 | "$O_CLI" \ |
| 2766 | 0 \ |
| 2767 | -S "skip write certificate request" \ |
| 2768 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2769 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2770 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2771 | -S "X509 - Certificate verification failed" |
| 2772 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2773 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2774 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2775 | "$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] | 2776 | 0 \ |
| 2777 | -C "skip parse certificate request" \ |
| 2778 | -c "got a certificate request" \ |
| 2779 | -C "skip write certificate$" \ |
| 2780 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2781 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2782 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 2783 | run_test "Authentication: client no cert, openssl server required" \ |
| 2784 | "$O_SRV -Verify 10" \ |
| 2785 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 2786 | 1 \ |
| 2787 | -C "skip parse certificate request" \ |
| 2788 | -c "got a certificate request" \ |
| 2789 | -C "skip write certificate$" \ |
| 2790 | -c "skip write certificate verify" \ |
| 2791 | -c "! mbedtls_ssl_handshake returned" |
| 2792 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2793 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2794 | run_test "Authentication: client no cert, ssl3" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2795 | "$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] | 2796 | "$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] | 2797 | 0 \ |
| 2798 | -S "skip write certificate request" \ |
| 2799 | -C "skip parse certificate request" \ |
| 2800 | -c "got a certificate request" \ |
| 2801 | -C "skip write certificate$" \ |
| 2802 | -c "skip write certificate verify" \ |
| 2803 | -c "got no certificate to send" \ |
| 2804 | -s "SSLv3 client has no certificate" \ |
| 2805 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 2806 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 2807 | -S "! mbedtls_ssl_handshake returned" \ |
| 2808 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 2809 | -S "X509 - Certificate verification failed" |
| 2810 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 2811 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 2812 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2813 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2814 | MAX_IM_CA='8' |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2815 | MAX_IM_CA_CONFIG=$( ../scripts/config.pl get MBEDTLS_X509_MAX_INTERMEDIATE_CA) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2816 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2817 | if [ -n "$MAX_IM_CA_CONFIG" ] && [ "$MAX_IM_CA_CONFIG" -ne "$MAX_IM_CA" ]; then |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2818 | printf "The ${CONFIG_H} file contains a value for the configuration of\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2819 | printf "MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script’s\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2820 | printf "test value of ${MAX_IM_CA}. \n" |
| 2821 | printf "\n" |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 2822 | printf "The tests assume this value and if it changes, the tests in this\n" |
| 2823 | printf "script should also be adjusted.\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2824 | printf "\n" |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 2825 | |
| 2826 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 2827 | fi |
| 2828 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2829 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2830 | run_test "Authentication: server max_int chain, client default" \ |
| 2831 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 2832 | key_file=data_files/dir-maxpath/09.key" \ |
| 2833 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2834 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2835 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2836 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2837 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2838 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 2839 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2840 | key_file=data_files/dir-maxpath/10.key" \ |
| 2841 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 2842 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2843 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2844 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2845 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2846 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 2847 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2848 | key_file=data_files/dir-maxpath/10.key" \ |
| 2849 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2850 | auth_mode=optional" \ |
| 2851 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2852 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2853 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2854 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2855 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 2856 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 2857 | key_file=data_files/dir-maxpath/10.key" \ |
| 2858 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 2859 | auth_mode=none" \ |
| 2860 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2861 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2862 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2863 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2864 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 2865 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 2866 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2867 | key_file=data_files/dir-maxpath/10.key" \ |
| 2868 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2869 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2870 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2871 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2872 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 2873 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 2874 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2875 | key_file=data_files/dir-maxpath/10.key" \ |
| 2876 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2877 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2878 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2879 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2880 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 2881 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2882 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 2883 | key_file=data_files/dir-maxpath/10.key" \ |
| 2884 | 1 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2885 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2886 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2887 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2888 | run_test "Authentication: client max_int chain, server required" \ |
| 2889 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 2890 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 2891 | key_file=data_files/dir-maxpath/09.key" \ |
| 2892 | 0 \ |
Antonin Décimo | d5f4759 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 2893 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 2894 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 2895 | # Tests for CA list in CertificateRequest messages |
| 2896 | |
| 2897 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 2898 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 2899 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2900 | key_file=data_files/server6.key" \ |
| 2901 | 0 \ |
| 2902 | -s "requested DN" |
| 2903 | |
| 2904 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 2905 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2906 | "$P_CLI crt_file=data_files/server6.crt \ |
| 2907 | key_file=data_files/server6.key" \ |
| 2908 | 0 \ |
| 2909 | -S "requested DN" |
| 2910 | |
| 2911 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 2912 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 2913 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 2914 | key_file=data_files/server5.key" \ |
| 2915 | 1 \ |
| 2916 | -S "requested DN" \ |
| 2917 | -s "x509_verify_cert() returned" \ |
| 2918 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 2919 | -s "! mbedtls_ssl_handshake returned" \ |
| 2920 | -c "! mbedtls_ssl_handshake returned" \ |
| 2921 | -s "X509 - Certificate verification failed" |
| 2922 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 2923 | # Tests for certificate selection based on SHA verson |
| 2924 | |
| 2925 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 2926 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2927 | key_file=data_files/server5.key \ |
| 2928 | crt_file2=data_files/server5-sha1.crt \ |
| 2929 | key_file2=data_files/server5.key" \ |
| 2930 | "$P_CLI force_version=tls1_2" \ |
| 2931 | 0 \ |
| 2932 | -c "signed using.*ECDSA with SHA256" \ |
| 2933 | -C "signed using.*ECDSA with SHA1" |
| 2934 | |
| 2935 | run_test "Certificate hash: client TLS 1.1 -> SHA-1" \ |
| 2936 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2937 | key_file=data_files/server5.key \ |
| 2938 | crt_file2=data_files/server5-sha1.crt \ |
| 2939 | key_file2=data_files/server5.key" \ |
| 2940 | "$P_CLI force_version=tls1_1" \ |
| 2941 | 0 \ |
| 2942 | -C "signed using.*ECDSA with SHA256" \ |
| 2943 | -c "signed using.*ECDSA with SHA1" |
| 2944 | |
| 2945 | run_test "Certificate hash: client TLS 1.0 -> SHA-1" \ |
| 2946 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2947 | key_file=data_files/server5.key \ |
| 2948 | crt_file2=data_files/server5-sha1.crt \ |
| 2949 | key_file2=data_files/server5.key" \ |
| 2950 | "$P_CLI force_version=tls1" \ |
| 2951 | 0 \ |
| 2952 | -C "signed using.*ECDSA with SHA256" \ |
| 2953 | -c "signed using.*ECDSA with SHA1" |
| 2954 | |
| 2955 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ |
| 2956 | "$P_SRV crt_file=data_files/server5.crt \ |
| 2957 | key_file=data_files/server5.key \ |
| 2958 | crt_file2=data_files/server6.crt \ |
| 2959 | key_file2=data_files/server6.key" \ |
| 2960 | "$P_CLI force_version=tls1_1" \ |
| 2961 | 0 \ |
| 2962 | -c "serial number.*09" \ |
| 2963 | -c "signed using.*ECDSA with SHA256" \ |
| 2964 | -C "signed using.*ECDSA with SHA1" |
| 2965 | |
| 2966 | run_test "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ |
| 2967 | "$P_SRV crt_file=data_files/server6.crt \ |
| 2968 | key_file=data_files/server6.key \ |
| 2969 | crt_file2=data_files/server5.crt \ |
| 2970 | key_file2=data_files/server5.key" \ |
| 2971 | "$P_CLI force_version=tls1_1" \ |
| 2972 | 0 \ |
| 2973 | -c "serial number.*0A" \ |
| 2974 | -c "signed using.*ECDSA with SHA256" \ |
| 2975 | -C "signed using.*ECDSA with SHA1" |
| 2976 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2977 | # tests for SNI |
| 2978 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2979 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2980 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2981 | 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] | 2982 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2983 | 0 \ |
| 2984 | -S "parse ServerName extension" \ |
| 2985 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 2986 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2987 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2988 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2989 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2990 | 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] | 2991 | 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] | 2992 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 2993 | 0 \ |
| 2994 | -s "parse ServerName extension" \ |
| 2995 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 2996 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 2997 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2998 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 2999 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3000 | 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] | 3001 | 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] | 3002 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3003 | 0 \ |
| 3004 | -s "parse ServerName extension" \ |
| 3005 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3006 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3007 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3008 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 3009 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 3010 | 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] | 3011 | 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] | 3012 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3013 | 1 \ |
| 3014 | -s "parse ServerName extension" \ |
| 3015 | -s "ssl_sni_wrapper() returned" \ |
| 3016 | -s "mbedtls_ssl_handshake returned" \ |
| 3017 | -c "mbedtls_ssl_handshake returned" \ |
| 3018 | -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] | 3019 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3020 | run_test "SNI: client auth no override: optional" \ |
| 3021 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3022 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3023 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3024 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3025 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3026 | -S "skip write certificate request" \ |
| 3027 | -C "skip parse certificate request" \ |
| 3028 | -c "got a certificate request" \ |
| 3029 | -C "skip write certificate" \ |
| 3030 | -C "skip write certificate verify" \ |
| 3031 | -S "skip parse certificate verify" |
| 3032 | |
| 3033 | run_test "SNI: client auth override: none -> optional" \ |
| 3034 | "$P_SRV debug_level=3 auth_mode=none \ |
| 3035 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3036 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3037 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3038 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3039 | -S "skip write certificate request" \ |
| 3040 | -C "skip parse certificate request" \ |
| 3041 | -c "got a certificate request" \ |
| 3042 | -C "skip write certificate" \ |
| 3043 | -C "skip write certificate verify" \ |
| 3044 | -S "skip parse certificate verify" |
| 3045 | |
| 3046 | run_test "SNI: client auth override: optional -> none" \ |
| 3047 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3048 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3049 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3050 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3051 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 3052 | -s "skip write certificate request" \ |
| 3053 | -C "skip parse certificate request" \ |
| 3054 | -c "got no certificate request" \ |
| 3055 | -c "skip write certificate" \ |
| 3056 | -c "skip write certificate verify" \ |
| 3057 | -s "skip parse certificate verify" |
| 3058 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3059 | run_test "SNI: CA no override" \ |
| 3060 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3061 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3062 | ca_file=data_files/test-ca.crt \ |
| 3063 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3064 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3065 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3066 | 1 \ |
| 3067 | -S "skip write certificate request" \ |
| 3068 | -C "skip parse certificate request" \ |
| 3069 | -c "got a certificate request" \ |
| 3070 | -C "skip write certificate" \ |
| 3071 | -C "skip write certificate verify" \ |
| 3072 | -S "skip parse certificate verify" \ |
| 3073 | -s "x509_verify_cert() returned" \ |
| 3074 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3075 | -S "The certificate has been revoked (is on a CRL)" |
| 3076 | |
| 3077 | run_test "SNI: CA override" \ |
| 3078 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3079 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3080 | ca_file=data_files/test-ca.crt \ |
| 3081 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3082 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3083 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3084 | 0 \ |
| 3085 | -S "skip write certificate request" \ |
| 3086 | -C "skip parse certificate request" \ |
| 3087 | -c "got a certificate request" \ |
| 3088 | -C "skip write certificate" \ |
| 3089 | -C "skip write certificate verify" \ |
| 3090 | -S "skip parse certificate verify" \ |
| 3091 | -S "x509_verify_cert() returned" \ |
| 3092 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3093 | -S "The certificate has been revoked (is on a CRL)" |
| 3094 | |
| 3095 | run_test "SNI: CA override with CRL" \ |
| 3096 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3097 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3098 | ca_file=data_files/test-ca.crt \ |
| 3099 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3100 | "$P_CLI debug_level=3 server_name=localhost \ |
| 3101 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3102 | 1 \ |
| 3103 | -S "skip write certificate request" \ |
| 3104 | -C "skip parse certificate request" \ |
| 3105 | -c "got a certificate request" \ |
| 3106 | -C "skip write certificate" \ |
| 3107 | -C "skip write certificate verify" \ |
| 3108 | -S "skip parse certificate verify" \ |
| 3109 | -s "x509_verify_cert() returned" \ |
| 3110 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3111 | -s "The certificate has been revoked (is on a CRL)" |
| 3112 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3113 | # Tests for SNI and DTLS |
| 3114 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3115 | run_test "SNI: DTLS, no SNI callback" \ |
| 3116 | "$P_SRV debug_level=3 dtls=1 \ |
| 3117 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 3118 | "$P_CLI server_name=localhost dtls=1" \ |
| 3119 | 0 \ |
| 3120 | -S "parse ServerName extension" \ |
| 3121 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 3122 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 3123 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3124 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3125 | "$P_SRV debug_level=3 dtls=1 \ |
| 3126 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3127 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3128 | "$P_CLI server_name=localhost dtls=1" \ |
| 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=localhost" |
| 3133 | |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 3134 | run_test "SNI: DTLS, matching cert 2" \ |
| 3135 | "$P_SRV debug_level=3 dtls=1 \ |
| 3136 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3137 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3138 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 3139 | 0 \ |
| 3140 | -s "parse ServerName extension" \ |
| 3141 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 3142 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 3143 | |
| 3144 | run_test "SNI: DTLS, no matching cert" \ |
| 3145 | "$P_SRV debug_level=3 dtls=1 \ |
| 3146 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3147 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 3148 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 3149 | 1 \ |
| 3150 | -s "parse ServerName extension" \ |
| 3151 | -s "ssl_sni_wrapper() returned" \ |
| 3152 | -s "mbedtls_ssl_handshake returned" \ |
| 3153 | -c "mbedtls_ssl_handshake returned" \ |
| 3154 | -c "SSL - A fatal alert message was received from our peer" |
| 3155 | |
| 3156 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 3157 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3158 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3159 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 3160 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3161 | 0 \ |
| 3162 | -S "skip write certificate request" \ |
| 3163 | -C "skip parse certificate request" \ |
| 3164 | -c "got a certificate request" \ |
| 3165 | -C "skip write certificate" \ |
| 3166 | -C "skip write certificate verify" \ |
| 3167 | -S "skip parse certificate verify" |
| 3168 | |
| 3169 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 3170 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 3171 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3172 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 3173 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3174 | 0 \ |
| 3175 | -S "skip write certificate request" \ |
| 3176 | -C "skip parse certificate request" \ |
| 3177 | -c "got a certificate request" \ |
| 3178 | -C "skip write certificate" \ |
| 3179 | -C "skip write certificate verify" \ |
| 3180 | -S "skip parse certificate verify" |
| 3181 | |
| 3182 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 3183 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3184 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3185 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 3186 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 3187 | 0 \ |
| 3188 | -s "skip write certificate request" \ |
| 3189 | -C "skip parse certificate request" \ |
| 3190 | -c "got no certificate request" \ |
| 3191 | -c "skip write certificate" \ |
| 3192 | -c "skip write certificate verify" \ |
| 3193 | -s "skip parse certificate verify" |
| 3194 | |
| 3195 | run_test "SNI: DTLS, CA no override" \ |
| 3196 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3197 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3198 | ca_file=data_files/test-ca.crt \ |
| 3199 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 3200 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3201 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3202 | 1 \ |
| 3203 | -S "skip write certificate request" \ |
| 3204 | -C "skip parse certificate request" \ |
| 3205 | -c "got a certificate request" \ |
| 3206 | -C "skip write certificate" \ |
| 3207 | -C "skip write certificate verify" \ |
| 3208 | -S "skip parse certificate verify" \ |
| 3209 | -s "x509_verify_cert() returned" \ |
| 3210 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3211 | -S "The certificate has been revoked (is on a CRL)" |
| 3212 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3213 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3214 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 3215 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 3216 | ca_file=data_files/test-ca.crt \ |
| 3217 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 3218 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3219 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3220 | 0 \ |
| 3221 | -S "skip write certificate request" \ |
| 3222 | -C "skip parse certificate request" \ |
| 3223 | -c "got a certificate request" \ |
| 3224 | -C "skip write certificate" \ |
| 3225 | -C "skip write certificate verify" \ |
| 3226 | -S "skip parse certificate verify" \ |
| 3227 | -S "x509_verify_cert() returned" \ |
| 3228 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3229 | -S "The certificate has been revoked (is on a CRL)" |
| 3230 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 3231 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 3232 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 3233 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 3234 | ca_file=data_files/test-ca.crt \ |
| 3235 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 3236 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 3237 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 3238 | 1 \ |
| 3239 | -S "skip write certificate request" \ |
| 3240 | -C "skip parse certificate request" \ |
| 3241 | -c "got a certificate request" \ |
| 3242 | -C "skip write certificate" \ |
| 3243 | -C "skip write certificate verify" \ |
| 3244 | -S "skip parse certificate verify" \ |
| 3245 | -s "x509_verify_cert() returned" \ |
| 3246 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 3247 | -s "The certificate has been revoked (is on a CRL)" |
| 3248 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3249 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 3250 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3251 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3252 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3253 | "$P_CLI nbio=2 tickets=0" \ |
| 3254 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3255 | -S "mbedtls_ssl_handshake returned" \ |
| 3256 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3257 | -c "Read from server: .* bytes read" |
| 3258 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3259 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3260 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 3261 | "$P_CLI nbio=2 tickets=0" \ |
| 3262 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3263 | -S "mbedtls_ssl_handshake returned" \ |
| 3264 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3265 | -c "Read from server: .* bytes read" |
| 3266 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3267 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3268 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3269 | "$P_CLI nbio=2 tickets=1" \ |
| 3270 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3271 | -S "mbedtls_ssl_handshake returned" \ |
| 3272 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3273 | -c "Read from server: .* bytes read" |
| 3274 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3275 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3276 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3277 | "$P_CLI nbio=2 tickets=1" \ |
| 3278 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3279 | -S "mbedtls_ssl_handshake returned" \ |
| 3280 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3281 | -c "Read from server: .* bytes read" |
| 3282 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3283 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3284 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 3285 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3286 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3287 | -S "mbedtls_ssl_handshake returned" \ |
| 3288 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3289 | -c "Read from server: .* bytes read" |
| 3290 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3291 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3292 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 3293 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 3294 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3295 | -S "mbedtls_ssl_handshake returned" \ |
| 3296 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3297 | -c "Read from server: .* bytes read" |
| 3298 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3299 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3300 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 3301 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 3302 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3303 | -S "mbedtls_ssl_handshake returned" \ |
| 3304 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 3305 | -c "Read from server: .* bytes read" |
| 3306 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 3307 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 3308 | |
| 3309 | run_test "Event-driven I/O: basic handshake" \ |
| 3310 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3311 | "$P_CLI event=1 tickets=0" \ |
| 3312 | 0 \ |
| 3313 | -S "mbedtls_ssl_handshake returned" \ |
| 3314 | -C "mbedtls_ssl_handshake returned" \ |
| 3315 | -c "Read from server: .* bytes read" |
| 3316 | |
| 3317 | run_test "Event-driven I/O: client auth" \ |
| 3318 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 3319 | "$P_CLI event=1 tickets=0" \ |
| 3320 | 0 \ |
| 3321 | -S "mbedtls_ssl_handshake returned" \ |
| 3322 | -C "mbedtls_ssl_handshake returned" \ |
| 3323 | -c "Read from server: .* bytes read" |
| 3324 | |
| 3325 | run_test "Event-driven I/O: ticket" \ |
| 3326 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3327 | "$P_CLI event=1 tickets=1" \ |
| 3328 | 0 \ |
| 3329 | -S "mbedtls_ssl_handshake returned" \ |
| 3330 | -C "mbedtls_ssl_handshake returned" \ |
| 3331 | -c "Read from server: .* bytes read" |
| 3332 | |
| 3333 | run_test "Event-driven I/O: ticket + client auth" \ |
| 3334 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3335 | "$P_CLI event=1 tickets=1" \ |
| 3336 | 0 \ |
| 3337 | -S "mbedtls_ssl_handshake returned" \ |
| 3338 | -C "mbedtls_ssl_handshake returned" \ |
| 3339 | -c "Read from server: .* bytes read" |
| 3340 | |
| 3341 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 3342 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 3343 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3344 | 0 \ |
| 3345 | -S "mbedtls_ssl_handshake returned" \ |
| 3346 | -C "mbedtls_ssl_handshake returned" \ |
| 3347 | -c "Read from server: .* bytes read" |
| 3348 | |
| 3349 | run_test "Event-driven I/O: ticket + resume" \ |
| 3350 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 3351 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 3352 | 0 \ |
| 3353 | -S "mbedtls_ssl_handshake returned" \ |
| 3354 | -C "mbedtls_ssl_handshake returned" \ |
| 3355 | -c "Read from server: .* bytes read" |
| 3356 | |
| 3357 | run_test "Event-driven I/O: session-id resume" \ |
| 3358 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 3359 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 3360 | 0 \ |
| 3361 | -S "mbedtls_ssl_handshake returned" \ |
| 3362 | -C "mbedtls_ssl_handshake returned" \ |
| 3363 | -c "Read from server: .* bytes read" |
| 3364 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 3365 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 3366 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 3367 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3368 | 0 \ |
| 3369 | -c "Read from server: .* bytes read" |
| 3370 | |
| 3371 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 3372 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 3373 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 3374 | 0 \ |
| 3375 | -c "Read from server: .* bytes read" |
| 3376 | |
| 3377 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 3378 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 3379 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3380 | 0 \ |
| 3381 | -c "Read from server: .* bytes read" |
| 3382 | |
| 3383 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 3384 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 3385 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 3386 | 0 \ |
| 3387 | -c "Read from server: .* bytes read" |
| 3388 | |
| 3389 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 3390 | "$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] | 3391 | "$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] | 3392 | 0 \ |
| 3393 | -c "Read from server: .* bytes read" |
| 3394 | |
| 3395 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 3396 | "$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] | 3397 | "$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] | 3398 | 0 \ |
| 3399 | -c "Read from server: .* bytes read" |
| 3400 | |
| 3401 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 3402 | "$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] | 3403 | "$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] | 3404 | 0 \ |
| 3405 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3406 | |
| 3407 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 3408 | # During session resumption, the client will send its ApplicationData record |
| 3409 | # within the same datagram as the Finished messages. In this situation, the |
| 3410 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 3411 | # because the ApplicationData request has already been queued internally. |
| 3412 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 3413 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 3414 | "$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] | 3415 | "$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] | 3416 | 0 \ |
| 3417 | -c "Read from server: .* bytes read" |
| 3418 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3419 | # Tests for version negotiation |
| 3420 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3421 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3422 | "$P_SRV" \ |
| 3423 | "$P_CLI" \ |
| 3424 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3425 | -S "mbedtls_ssl_handshake returned" \ |
| 3426 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3427 | -s "Protocol is TLSv1.2" \ |
| 3428 | -c "Protocol is TLSv1.2" |
| 3429 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3430 | run_test "Version check: cli max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3431 | "$P_SRV" \ |
| 3432 | "$P_CLI max_version=tls1_1" \ |
| 3433 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3434 | -S "mbedtls_ssl_handshake returned" \ |
| 3435 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3436 | -s "Protocol is TLSv1.1" \ |
| 3437 | -c "Protocol is TLSv1.1" |
| 3438 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3439 | run_test "Version check: srv max 1.1 -> 1.1" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3440 | "$P_SRV max_version=tls1_1" \ |
| 3441 | "$P_CLI" \ |
| 3442 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3443 | -S "mbedtls_ssl_handshake returned" \ |
| 3444 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3445 | -s "Protocol is TLSv1.1" \ |
| 3446 | -c "Protocol is TLSv1.1" |
| 3447 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3448 | 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] | 3449 | "$P_SRV max_version=tls1_1" \ |
| 3450 | "$P_CLI max_version=tls1_1" \ |
| 3451 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3452 | -S "mbedtls_ssl_handshake returned" \ |
| 3453 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3454 | -s "Protocol is TLSv1.1" \ |
| 3455 | -c "Protocol is TLSv1.1" |
| 3456 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3457 | 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] | 3458 | "$P_SRV min_version=tls1_1" \ |
| 3459 | "$P_CLI max_version=tls1_1" \ |
| 3460 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3461 | -S "mbedtls_ssl_handshake returned" \ |
| 3462 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3463 | -s "Protocol is TLSv1.1" \ |
| 3464 | -c "Protocol is TLSv1.1" |
| 3465 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3466 | 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] | 3467 | "$P_SRV max_version=tls1_1" \ |
| 3468 | "$P_CLI min_version=tls1_1" \ |
| 3469 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3470 | -S "mbedtls_ssl_handshake returned" \ |
| 3471 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3472 | -s "Protocol is TLSv1.1" \ |
| 3473 | -c "Protocol is TLSv1.1" |
| 3474 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3475 | 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] | 3476 | "$P_SRV max_version=tls1_1" \ |
| 3477 | "$P_CLI min_version=tls1_2" \ |
| 3478 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3479 | -s "mbedtls_ssl_handshake returned" \ |
| 3480 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3481 | -c "SSL - Handshake protocol not within min/max boundaries" |
| 3482 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3483 | 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] | 3484 | "$P_SRV min_version=tls1_2" \ |
| 3485 | "$P_CLI max_version=tls1_1" \ |
| 3486 | 1 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3487 | -s "mbedtls_ssl_handshake returned" \ |
| 3488 | -c "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 3489 | -s "SSL - Handshake protocol not within min/max boundaries" |
| 3490 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3491 | # Tests for ALPN extension |
| 3492 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3493 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3494 | "$P_SRV debug_level=3" \ |
| 3495 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3496 | 0 \ |
| 3497 | -C "client hello, adding alpn extension" \ |
| 3498 | -S "found alpn extension" \ |
| 3499 | -C "got an alert message, type: \\[2:120]" \ |
| 3500 | -S "server hello, adding alpn extension" \ |
| 3501 | -C "found alpn extension " \ |
| 3502 | -C "Application Layer Protocol is" \ |
| 3503 | -S "Application Layer Protocol is" |
| 3504 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3505 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3506 | "$P_SRV debug_level=3" \ |
| 3507 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3508 | 0 \ |
| 3509 | -c "client hello, adding alpn extension" \ |
| 3510 | -s "found alpn extension" \ |
| 3511 | -C "got an alert message, type: \\[2:120]" \ |
| 3512 | -S "server hello, adding alpn extension" \ |
| 3513 | -C "found alpn extension " \ |
| 3514 | -c "Application Layer Protocol is (none)" \ |
| 3515 | -S "Application Layer Protocol is" |
| 3516 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3517 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3518 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3519 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3520 | 0 \ |
| 3521 | -C "client hello, adding alpn extension" \ |
| 3522 | -S "found alpn extension" \ |
| 3523 | -C "got an alert message, type: \\[2:120]" \ |
| 3524 | -S "server hello, adding alpn extension" \ |
| 3525 | -C "found alpn extension " \ |
| 3526 | -C "Application Layer Protocol is" \ |
| 3527 | -s "Application Layer Protocol is (none)" |
| 3528 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3529 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3530 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3531 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3532 | 0 \ |
| 3533 | -c "client hello, adding alpn extension" \ |
| 3534 | -s "found alpn extension" \ |
| 3535 | -C "got an alert message, type: \\[2:120]" \ |
| 3536 | -s "server hello, adding alpn extension" \ |
| 3537 | -c "found alpn extension" \ |
| 3538 | -c "Application Layer Protocol is abc" \ |
| 3539 | -s "Application Layer Protocol is abc" |
| 3540 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3541 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3542 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3543 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3544 | 0 \ |
| 3545 | -c "client hello, adding alpn extension" \ |
| 3546 | -s "found alpn extension" \ |
| 3547 | -C "got an alert message, type: \\[2:120]" \ |
| 3548 | -s "server hello, adding alpn extension" \ |
| 3549 | -c "found alpn extension" \ |
| 3550 | -c "Application Layer Protocol is abc" \ |
| 3551 | -s "Application Layer Protocol is abc" |
| 3552 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3553 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3554 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 3555 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3556 | 0 \ |
| 3557 | -c "client hello, adding alpn extension" \ |
| 3558 | -s "found alpn extension" \ |
| 3559 | -C "got an alert message, type: \\[2:120]" \ |
| 3560 | -s "server hello, adding alpn extension" \ |
| 3561 | -c "found alpn extension" \ |
| 3562 | -c "Application Layer Protocol is 1234" \ |
| 3563 | -s "Application Layer Protocol is 1234" |
| 3564 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3565 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3566 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 3567 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 3568 | 1 \ |
| 3569 | -c "client hello, adding alpn extension" \ |
| 3570 | -s "found alpn extension" \ |
| 3571 | -c "got an alert message, type: \\[2:120]" \ |
| 3572 | -S "server hello, adding alpn extension" \ |
| 3573 | -C "found alpn extension" \ |
| 3574 | -C "Application Layer Protocol is 1234" \ |
| 3575 | -S "Application Layer Protocol is 1234" |
| 3576 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 3577 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3578 | # Tests for keyUsage in leaf certificates, part 1: |
| 3579 | # server-side certificate/suite selection |
| 3580 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3581 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3582 | "$P_SRV key_file=data_files/server2.key \ |
| 3583 | crt_file=data_files/server2.ku-ds.crt" \ |
| 3584 | "$P_CLI" \ |
| 3585 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 3586 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3587 | |
| 3588 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3589 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3590 | "$P_SRV key_file=data_files/server2.key \ |
| 3591 | crt_file=data_files/server2.ku-ke.crt" \ |
| 3592 | "$P_CLI" \ |
| 3593 | 0 \ |
| 3594 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 3595 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3596 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3597 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3598 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3599 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3600 | 1 \ |
| 3601 | -C "Ciphersuite is " |
| 3602 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3603 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3604 | "$P_SRV key_file=data_files/server5.key \ |
| 3605 | crt_file=data_files/server5.ku-ds.crt" \ |
| 3606 | "$P_CLI" \ |
| 3607 | 0 \ |
| 3608 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 3609 | |
| 3610 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3611 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3612 | "$P_SRV key_file=data_files/server5.key \ |
| 3613 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3614 | "$P_CLI" \ |
| 3615 | 0 \ |
| 3616 | -c "Ciphersuite is TLS-ECDH-" |
| 3617 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3618 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3619 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3620 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 3621 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3622 | 1 \ |
| 3623 | -C "Ciphersuite is " |
| 3624 | |
| 3625 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3626 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3627 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3628 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3629 | "$O_SRV -key data_files/server2.key \ |
| 3630 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3631 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3632 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3633 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3634 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3635 | -C "Processing of the Certificate handshake message failed" \ |
| 3636 | -c "Ciphersuite is TLS-" |
| 3637 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3638 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3639 | "$O_SRV -key data_files/server2.key \ |
| 3640 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3641 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3642 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3643 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3644 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3645 | -C "Processing of the Certificate handshake message failed" \ |
| 3646 | -c "Ciphersuite is TLS-" |
| 3647 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3648 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3649 | "$O_SRV -key data_files/server2.key \ |
| 3650 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3651 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3652 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3653 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3654 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3655 | -C "Processing of the Certificate handshake message failed" \ |
| 3656 | -c "Ciphersuite is TLS-" |
| 3657 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3658 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3659 | "$O_SRV -key data_files/server2.key \ |
| 3660 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3661 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3662 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3663 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3664 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3665 | -c "Processing of the Certificate handshake message failed" \ |
| 3666 | -C "Ciphersuite is TLS-" |
| 3667 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3668 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 3669 | "$O_SRV -key data_files/server2.key \ |
| 3670 | -cert data_files/server2.ku-ke.crt" \ |
| 3671 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3672 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3673 | 0 \ |
| 3674 | -c "bad certificate (usage extensions)" \ |
| 3675 | -C "Processing of the Certificate handshake message failed" \ |
| 3676 | -c "Ciphersuite is TLS-" \ |
| 3677 | -c "! Usage does not match the keyUsage extension" |
| 3678 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3679 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3680 | "$O_SRV -key data_files/server2.key \ |
| 3681 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3682 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3683 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 3684 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3685 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3686 | -C "Processing of the Certificate handshake message failed" \ |
| 3687 | -c "Ciphersuite is TLS-" |
| 3688 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3689 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3690 | "$O_SRV -key data_files/server2.key \ |
| 3691 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3692 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3693 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3694 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3695 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 3696 | -c "Processing of the Certificate handshake message failed" \ |
| 3697 | -C "Ciphersuite is TLS-" |
| 3698 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 3699 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 3700 | "$O_SRV -key data_files/server2.key \ |
| 3701 | -cert data_files/server2.ku-ds.crt" \ |
| 3702 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 3703 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 3704 | 0 \ |
| 3705 | -c "bad certificate (usage extensions)" \ |
| 3706 | -C "Processing of the Certificate handshake message failed" \ |
| 3707 | -c "Ciphersuite is TLS-" \ |
| 3708 | -c "! Usage does not match the keyUsage extension" |
| 3709 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3710 | # Tests for keyUsage in leaf certificates, part 3: |
| 3711 | # server-side checking of client cert |
| 3712 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3713 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3714 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3715 | "$O_CLI -key data_files/server2.key \ |
| 3716 | -cert data_files/server2.ku-ds.crt" \ |
| 3717 | 0 \ |
| 3718 | -S "bad certificate (usage extensions)" \ |
| 3719 | -S "Processing of the Certificate handshake message failed" |
| 3720 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3721 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3722 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3723 | "$O_CLI -key data_files/server2.key \ |
| 3724 | -cert data_files/server2.ku-ke.crt" \ |
| 3725 | 0 \ |
| 3726 | -s "bad certificate (usage extensions)" \ |
| 3727 | -S "Processing of the Certificate handshake message failed" |
| 3728 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3729 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3730 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3731 | "$O_CLI -key data_files/server2.key \ |
| 3732 | -cert data_files/server2.ku-ke.crt" \ |
| 3733 | 1 \ |
| 3734 | -s "bad certificate (usage extensions)" \ |
| 3735 | -s "Processing of the Certificate handshake message failed" |
| 3736 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3737 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3738 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3739 | "$O_CLI -key data_files/server5.key \ |
| 3740 | -cert data_files/server5.ku-ds.crt" \ |
| 3741 | 0 \ |
| 3742 | -S "bad certificate (usage extensions)" \ |
| 3743 | -S "Processing of the Certificate handshake message failed" |
| 3744 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3745 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3746 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 3747 | "$O_CLI -key data_files/server5.key \ |
| 3748 | -cert data_files/server5.ku-ka.crt" \ |
| 3749 | 0 \ |
| 3750 | -s "bad certificate (usage extensions)" \ |
| 3751 | -S "Processing of the Certificate handshake message failed" |
| 3752 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3753 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 3754 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3755 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3756 | "$P_SRV key_file=data_files/server5.key \ |
| 3757 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3758 | "$P_CLI" \ |
| 3759 | 0 |
| 3760 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3761 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3762 | "$P_SRV key_file=data_files/server5.key \ |
| 3763 | crt_file=data_files/server5.eku-srv.crt" \ |
| 3764 | "$P_CLI" \ |
| 3765 | 0 |
| 3766 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3767 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3768 | "$P_SRV key_file=data_files/server5.key \ |
| 3769 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 3770 | "$P_CLI" \ |
| 3771 | 0 |
| 3772 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3773 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3774 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3775 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 3776 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3777 | 1 |
| 3778 | |
| 3779 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 3780 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3781 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3782 | "$O_SRV -key data_files/server5.key \ |
| 3783 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3784 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3785 | 0 \ |
| 3786 | -C "bad certificate (usage extensions)" \ |
| 3787 | -C "Processing of the Certificate handshake message failed" \ |
| 3788 | -c "Ciphersuite is TLS-" |
| 3789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3790 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3791 | "$O_SRV -key data_files/server5.key \ |
| 3792 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3793 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3794 | 0 \ |
| 3795 | -C "bad certificate (usage extensions)" \ |
| 3796 | -C "Processing of the Certificate handshake message failed" \ |
| 3797 | -c "Ciphersuite is TLS-" |
| 3798 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3799 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3800 | "$O_SRV -key data_files/server5.key \ |
| 3801 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3802 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3803 | 0 \ |
| 3804 | -C "bad certificate (usage extensions)" \ |
| 3805 | -C "Processing of the Certificate handshake message failed" \ |
| 3806 | -c "Ciphersuite is TLS-" |
| 3807 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3808 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3809 | "$O_SRV -key data_files/server5.key \ |
| 3810 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3811 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3812 | 1 \ |
| 3813 | -c "bad certificate (usage extensions)" \ |
| 3814 | -c "Processing of the Certificate handshake message failed" \ |
| 3815 | -C "Ciphersuite is TLS-" |
| 3816 | |
| 3817 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 3818 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3819 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3820 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3821 | "$O_CLI -key data_files/server5.key \ |
| 3822 | -cert data_files/server5.eku-cli.crt" \ |
| 3823 | 0 \ |
| 3824 | -S "bad certificate (usage extensions)" \ |
| 3825 | -S "Processing of the Certificate handshake message failed" |
| 3826 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3827 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3828 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3829 | "$O_CLI -key data_files/server5.key \ |
| 3830 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 3831 | 0 \ |
| 3832 | -S "bad certificate (usage extensions)" \ |
| 3833 | -S "Processing of the Certificate handshake message failed" |
| 3834 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3835 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3836 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3837 | "$O_CLI -key data_files/server5.key \ |
| 3838 | -cert data_files/server5.eku-cs_any.crt" \ |
| 3839 | 0 \ |
| 3840 | -S "bad certificate (usage extensions)" \ |
| 3841 | -S "Processing of the Certificate handshake message failed" |
| 3842 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3843 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3844 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3845 | "$O_CLI -key data_files/server5.key \ |
| 3846 | -cert data_files/server5.eku-cs.crt" \ |
| 3847 | 0 \ |
| 3848 | -s "bad certificate (usage extensions)" \ |
| 3849 | -S "Processing of the Certificate handshake message failed" |
| 3850 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3851 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3852 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 3853 | "$O_CLI -key data_files/server5.key \ |
| 3854 | -cert data_files/server5.eku-cs.crt" \ |
| 3855 | 1 \ |
| 3856 | -s "bad certificate (usage extensions)" \ |
| 3857 | -s "Processing of the Certificate handshake message failed" |
| 3858 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3859 | # Tests for DHM parameters loading |
| 3860 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3861 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3862 | "$P_SRV" \ |
| 3863 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3864 | debug_level=3" \ |
| 3865 | 0 \ |
| 3866 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 3867 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3868 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3869 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3870 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3871 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3872 | debug_level=3" \ |
| 3873 | 0 \ |
| 3874 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 3875 | -c "value of 'DHM: G ' (2 bits)" |
| 3876 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 3877 | # Tests for DHM client-side size checking |
| 3878 | |
| 3879 | run_test "DHM size: server default, client default, OK" \ |
| 3880 | "$P_SRV" \ |
| 3881 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3882 | debug_level=1" \ |
| 3883 | 0 \ |
| 3884 | -C "DHM prime too short:" |
| 3885 | |
| 3886 | run_test "DHM size: server default, client 2048, OK" \ |
| 3887 | "$P_SRV" \ |
| 3888 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3889 | debug_level=1 dhmlen=2048" \ |
| 3890 | 0 \ |
| 3891 | -C "DHM prime too short:" |
| 3892 | |
| 3893 | run_test "DHM size: server 1024, client default, OK" \ |
| 3894 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 3895 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3896 | debug_level=1" \ |
| 3897 | 0 \ |
| 3898 | -C "DHM prime too short:" |
| 3899 | |
| 3900 | run_test "DHM size: server 1000, client default, rejected" \ |
| 3901 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 3902 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3903 | debug_level=1" \ |
| 3904 | 1 \ |
| 3905 | -c "DHM prime too short:" |
| 3906 | |
| 3907 | run_test "DHM size: server default, client 2049, rejected" \ |
| 3908 | "$P_SRV" \ |
| 3909 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 3910 | debug_level=1 dhmlen=2049" \ |
| 3911 | 1 \ |
| 3912 | -c "DHM prime too short:" |
| 3913 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3914 | # Tests for PSK callback |
| 3915 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3916 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3917 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 3918 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3919 | psk_identity=foo psk=abc123" \ |
| 3920 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3921 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3922 | -S "SSL - Unknown identity received" \ |
| 3923 | -S "SSL - Verification of the message MAC failed" |
| 3924 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3925 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 3926 | "$P_SRV" \ |
| 3927 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3928 | psk_identity=foo psk=abc123" \ |
| 3929 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3930 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3931 | -S "SSL - Unknown identity received" \ |
| 3932 | -S "SSL - Verification of the message MAC failed" |
| 3933 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3934 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3935 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 3936 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3937 | psk_identity=foo psk=abc123" \ |
| 3938 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3939 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3940 | -s "SSL - Unknown identity received" \ |
| 3941 | -S "SSL - Verification of the message MAC failed" |
| 3942 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3943 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3944 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3945 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3946 | psk_identity=abc psk=dead" \ |
| 3947 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3948 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3949 | -S "SSL - Unknown identity received" \ |
| 3950 | -S "SSL - Verification of the message MAC failed" |
| 3951 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3952 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3953 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3954 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3955 | psk_identity=def psk=beef" \ |
| 3956 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3957 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3958 | -S "SSL - Unknown identity received" \ |
| 3959 | -S "SSL - Verification of the message MAC failed" |
| 3960 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3961 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3962 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3963 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3964 | psk_identity=ghi psk=beef" \ |
| 3965 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3966 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3967 | -s "SSL - Unknown identity received" \ |
| 3968 | -S "SSL - Verification of the message MAC failed" |
| 3969 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3970 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3971 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 3972 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 3973 | psk_identity=abc psk=beef" \ |
| 3974 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 3975 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 3976 | -S "SSL - Unknown identity received" \ |
| 3977 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 3978 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3979 | # Tests for EC J-PAKE |
| 3980 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3981 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3982 | run_test "ECJPAKE: client not configured" \ |
| 3983 | "$P_SRV debug_level=3" \ |
| 3984 | "$P_CLI debug_level=3" \ |
| 3985 | 0 \ |
| 3986 | -C "add ciphersuite: c0ff" \ |
| 3987 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 3988 | -S "found ecjpake kkpp extension" \ |
| 3989 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3990 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 3991 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 3992 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3993 | -S "None of the common ciphersuites is usable" |
| 3994 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 3995 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 3996 | run_test "ECJPAKE: server not configured" \ |
| 3997 | "$P_SRV debug_level=3" \ |
| 3998 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 3999 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4000 | 1 \ |
| 4001 | -c "add ciphersuite: c0ff" \ |
| 4002 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4003 | -s "found ecjpake kkpp extension" \ |
| 4004 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4005 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4006 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4007 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 4008 | -s "None of the common ciphersuites is usable" |
| 4009 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4010 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4011 | run_test "ECJPAKE: working, TLS" \ |
| 4012 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4013 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 4014 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 4015 | 0 \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4016 | -c "add ciphersuite: c0ff" \ |
| 4017 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4018 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4019 | -s "found ecjpake kkpp extension" \ |
| 4020 | -S "skip ecjpake kkpp extension" \ |
| 4021 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 4022 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 4023 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4024 | -S "None of the common ciphersuites is usable" \ |
| 4025 | -S "SSL - Verification of the message MAC failed" |
| 4026 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4027 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4028 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4029 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 4030 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 4031 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 4032 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4033 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4034 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4035 | -s "SSL - Verification of the message MAC failed" |
| 4036 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4037 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4038 | run_test "ECJPAKE: working, DTLS" \ |
| 4039 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4040 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4041 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4042 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4043 | -c "re-using cached ecjpake parameters" \ |
| 4044 | -S "SSL - Verification of the message MAC failed" |
| 4045 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4046 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4047 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 4048 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 4049 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 4050 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4051 | 0 \ |
| 4052 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4053 | -S "SSL - Verification of the message MAC failed" |
| 4054 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 4055 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4056 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4057 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 4058 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 4059 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 4060 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4061 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 4062 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 4063 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 4064 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4065 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 4066 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 4067 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 4068 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 4069 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 4070 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 4071 | 0 |
| 4072 | |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4073 | # Tests for ciphersuites per version |
| 4074 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4075 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4076 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4077 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4078 | run_test "Per-version suites: SSL3" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4079 | "$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] | 4080 | "$P_CLI force_version=ssl3" \ |
| 4081 | 0 \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4082 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4083 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4084 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 |
| 4085 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4086 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4087 | run_test "Per-version suites: TLS 1.0" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4088 | "$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] | 4089 | "$P_CLI force_version=tls1 arc4=1" \ |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4090 | 0 \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4091 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4092 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4093 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 4094 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4095 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4096 | run_test "Per-version suites: TLS 1.1" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4097 | "$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] | 4098 | "$P_CLI force_version=tls1_1" \ |
| 4099 | 0 \ |
| 4100 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" |
| 4101 | |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4102 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 4103 | requires_config_enabled MBEDTLS_CAMELLIA_C |
| 4104 | requires_config_enabled MBEDTLS_AES_C |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4105 | run_test "Per-version suites: TLS 1.2" \ |
Manuel Pégourié-Gonnard | f1e62e8 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 4106 | "$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] | 4107 | "$P_CLI force_version=tls1_2" \ |
| 4108 | 0 \ |
| 4109 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" |
| 4110 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 4111 | # Test for ClientHello without extensions |
| 4112 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 4113 | requires_gnutls |
Manuel Pégourié-Gonnard | d20ae89 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 4114 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 7c9add2 | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 4115 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 4116 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 4117 | 0 \ |
| 4118 | -s "dumping 'client hello extensions' (0 bytes)" |
| 4119 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4120 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4121 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4122 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4123 | "$P_SRV" \ |
| 4124 | "$P_CLI request_size=100" \ |
| 4125 | 0 \ |
| 4126 | -s "Read from client: 100 bytes read$" |
| 4127 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4128 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 4129 | "$P_SRV" \ |
| 4130 | "$P_CLI request_size=500" \ |
| 4131 | 0 \ |
| 4132 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 4133 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4134 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4135 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4136 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4137 | run_test "Small client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4138 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4139 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4140 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4141 | 0 \ |
| 4142 | -s "Read from client: 1 bytes read" |
| 4143 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4144 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4145 | run_test "Small client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4146 | "$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] | 4147 | "$P_CLI request_size=1 force_version=ssl3 \ |
| 4148 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4149 | 0 \ |
| 4150 | -s "Read from client: 1 bytes read" |
| 4151 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4152 | run_test "Small client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4153 | "$P_SRV" \ |
| 4154 | "$P_CLI request_size=1 force_version=tls1 \ |
| 4155 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4156 | 0 \ |
| 4157 | -s "Read from client: 1 bytes read" |
| 4158 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4159 | 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] | 4160 | "$P_SRV" \ |
| 4161 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ |
| 4162 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4163 | 0 \ |
| 4164 | -s "Read from client: 1 bytes read" |
| 4165 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4166 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4167 | run_test "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4168 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4169 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4170 | 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] | 4171 | 0 \ |
| 4172 | -s "Read from client: 1 bytes read" |
| 4173 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4174 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4175 | 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] | 4176 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4177 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4178 | 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] | 4179 | 0 \ |
| 4180 | -s "Read from client: 1 bytes read" |
| 4181 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4182 | run_test "Small client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4183 | "$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] | 4184 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4185 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4186 | 0 \ |
| 4187 | -s "Read from client: 1 bytes read" |
| 4188 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4189 | run_test "Small client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4190 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4191 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4192 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4193 | 0 \ |
| 4194 | -s "Read from client: 1 bytes read" |
| 4195 | |
| 4196 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4197 | run_test "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4198 | "$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] | 4199 | "$P_CLI request_size=1 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4200 | 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] | 4201 | 0 \ |
| 4202 | -s "Read from client: 1 bytes read" |
| 4203 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4204 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4205 | 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] | 4206 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4207 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4208 | trunc_hmac=1 etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4209 | 0 \ |
| 4210 | -s "Read from client: 1 bytes read" |
| 4211 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4212 | run_test "Small client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4213 | "$P_SRV" \ |
| 4214 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4215 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4216 | 0 \ |
| 4217 | -s "Read from client: 1 bytes read" |
| 4218 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4219 | 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] | 4220 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4221 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4222 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4223 | 0 \ |
| 4224 | -s "Read from client: 1 bytes read" |
| 4225 | |
| 4226 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4227 | run_test "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4228 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4229 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4230 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4231 | 0 \ |
| 4232 | -s "Read from client: 1 bytes read" |
| 4233 | |
| 4234 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4235 | 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] | 4236 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4237 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4238 | 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] | 4239 | 0 \ |
| 4240 | -s "Read from client: 1 bytes read" |
| 4241 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4242 | run_test "Small client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4243 | "$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] | 4244 | "$P_CLI request_size=1 force_version=tls1_1 \ |
| 4245 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4246 | 0 \ |
| 4247 | -s "Read from client: 1 bytes read" |
| 4248 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4249 | run_test "Small client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4250 | "$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] | 4251 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4252 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4253 | 0 \ |
| 4254 | -s "Read from client: 1 bytes read" |
| 4255 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4256 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4257 | run_test "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4258 | "$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] | 4259 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4260 | 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] | 4261 | 0 \ |
| 4262 | -s "Read from client: 1 bytes read" |
| 4263 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4264 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4265 | 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] | 4266 | "$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] | 4267 | "$P_CLI request_size=1 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4268 | 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] | 4269 | 0 \ |
| 4270 | -s "Read from client: 1 bytes read" |
| 4271 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4272 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4273 | "$P_SRV" \ |
| 4274 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4275 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4276 | 0 \ |
| 4277 | -s "Read from client: 1 bytes read" |
| 4278 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4279 | 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] | 4280 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4281 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4282 | 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] | 4283 | 0 \ |
| 4284 | -s "Read from client: 1 bytes read" |
| 4285 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4286 | 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] | 4287 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4288 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4289 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4290 | 0 \ |
| 4291 | -s "Read from client: 1 bytes read" |
| 4292 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4293 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4294 | run_test "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4295 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4296 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4297 | 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] | 4298 | 0 \ |
| 4299 | -s "Read from client: 1 bytes read" |
| 4300 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4301 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4302 | 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] | 4303 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4304 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4305 | 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] | 4306 | 0 \ |
| 4307 | -s "Read from client: 1 bytes read" |
| 4308 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4309 | run_test "Small client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4310 | "$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] | 4311 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4312 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4313 | 0 \ |
| 4314 | -s "Read from client: 1 bytes read" |
| 4315 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4316 | 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] | 4317 | "$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] | 4318 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4319 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4320 | 0 \ |
| 4321 | -s "Read from client: 1 bytes read" |
| 4322 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4323 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4324 | run_test "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4325 | "$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] | 4326 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4327 | 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] | 4328 | 0 \ |
| 4329 | -s "Read from client: 1 bytes read" |
| 4330 | |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 4331 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4332 | 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] | 4333 | "$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] | 4334 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4335 | 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] | 4336 | 0 \ |
| 4337 | -s "Read from client: 1 bytes read" |
| 4338 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4339 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 4340 | "$P_SRV" \ |
| 4341 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4342 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4343 | 0 \ |
| 4344 | -s "Read from client: 1 bytes read" |
| 4345 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4346 | 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] | 4347 | "$P_SRV" \ |
| 4348 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 4349 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4350 | 0 \ |
| 4351 | -s "Read from client: 1 bytes read" |
| 4352 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4353 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4354 | |
| 4355 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4356 | run_test "Small client packet DTLS 1.0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4357 | "$P_SRV dtls=1 force_version=dtls1" \ |
| 4358 | "$P_CLI dtls=1 request_size=1 \ |
| 4359 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4360 | 0 \ |
| 4361 | -s "Read from client: 1 bytes read" |
| 4362 | |
| 4363 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4364 | run_test "Small client packet DTLS 1.0, without EtM" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4365 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ |
| 4366 | "$P_CLI dtls=1 request_size=1 \ |
| 4367 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4368 | 0 \ |
| 4369 | -s "Read from client: 1 bytes read" |
| 4370 | |
| 4371 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4372 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4373 | run_test "Small client packet DTLS 1.0, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4374 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ |
| 4375 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4376 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4377 | 0 \ |
| 4378 | -s "Read from client: 1 bytes read" |
| 4379 | |
| 4380 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4381 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4382 | run_test "Small client packet DTLS 1.0, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4383 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4384 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4385 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4386 | 0 \ |
| 4387 | -s "Read from client: 1 bytes read" |
| 4388 | |
| 4389 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4390 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4391 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 4392 | "$P_CLI dtls=1 request_size=1 \ |
| 4393 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4394 | 0 \ |
| 4395 | -s "Read from client: 1 bytes read" |
| 4396 | |
| 4397 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4398 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4399 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4400 | "$P_CLI dtls=1 request_size=1 \ |
| 4401 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4402 | 0 \ |
| 4403 | -s "Read from client: 1 bytes read" |
| 4404 | |
| 4405 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4406 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4407 | run_test "Small client packet DTLS 1.2, truncated hmac" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4408 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4409 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4410 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4411 | 0 \ |
| 4412 | -s "Read from client: 1 bytes read" |
| 4413 | |
| 4414 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4415 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4416 | run_test "Small client packet DTLS 1.2, without EtM, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4417 | "$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] | 4418 | "$P_CLI dtls=1 request_size=1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4419 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 4420 | 0 \ |
| 4421 | -s "Read from client: 1 bytes read" |
| 4422 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4423 | # Tests for small server packets |
| 4424 | |
| 4425 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4426 | run_test "Small server packet SSLv3 BlockCipher" \ |
| 4427 | "$P_SRV response_size=1 min_version=ssl3" \ |
| 4428 | "$P_CLI force_version=ssl3 \ |
| 4429 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4430 | 0 \ |
| 4431 | -c "Read from server: 1 bytes read" |
| 4432 | |
| 4433 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4434 | run_test "Small server packet SSLv3 StreamCipher" \ |
| 4435 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4436 | "$P_CLI force_version=ssl3 \ |
| 4437 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4438 | 0 \ |
| 4439 | -c "Read from server: 1 bytes read" |
| 4440 | |
| 4441 | run_test "Small server packet TLS 1.0 BlockCipher" \ |
| 4442 | "$P_SRV response_size=1" \ |
| 4443 | "$P_CLI force_version=tls1 \ |
| 4444 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4445 | 0 \ |
| 4446 | -c "Read from server: 1 bytes read" |
| 4447 | |
| 4448 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM" \ |
| 4449 | "$P_SRV response_size=1" \ |
| 4450 | "$P_CLI force_version=tls1 etm=0 \ |
| 4451 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4452 | 0 \ |
| 4453 | -c "Read from server: 1 bytes read" |
| 4454 | |
| 4455 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4456 | run_test "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ |
| 4457 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4458 | "$P_CLI force_version=tls1 \ |
| 4459 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4460 | 0 \ |
| 4461 | -c "Read from server: 1 bytes read" |
| 4462 | |
| 4463 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4464 | run_test "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ |
| 4465 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4466 | "$P_CLI force_version=tls1 \ |
| 4467 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4468 | 0 \ |
| 4469 | -c "Read from server: 1 bytes read" |
| 4470 | |
| 4471 | run_test "Small server packet TLS 1.0 StreamCipher" \ |
| 4472 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4473 | "$P_CLI force_version=tls1 \ |
| 4474 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4475 | 0 \ |
| 4476 | -c "Read from server: 1 bytes read" |
| 4477 | |
| 4478 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM" \ |
| 4479 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4480 | "$P_CLI force_version=tls1 \ |
| 4481 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4482 | 0 \ |
| 4483 | -c "Read from server: 1 bytes read" |
| 4484 | |
| 4485 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4486 | run_test "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 4487 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4488 | "$P_CLI force_version=tls1 \ |
| 4489 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4490 | 0 \ |
| 4491 | -c "Read from server: 1 bytes read" |
| 4492 | |
| 4493 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4494 | run_test "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 4495 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4496 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 4497 | trunc_hmac=1 etm=0" \ |
| 4498 | 0 \ |
| 4499 | -c "Read from server: 1 bytes read" |
| 4500 | |
| 4501 | run_test "Small server packet TLS 1.1 BlockCipher" \ |
| 4502 | "$P_SRV response_size=1" \ |
| 4503 | "$P_CLI force_version=tls1_1 \ |
| 4504 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4505 | 0 \ |
| 4506 | -c "Read from server: 1 bytes read" |
| 4507 | |
| 4508 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM" \ |
| 4509 | "$P_SRV response_size=1" \ |
| 4510 | "$P_CLI force_version=tls1_1 \ |
| 4511 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4512 | 0 \ |
| 4513 | -c "Read from server: 1 bytes read" |
| 4514 | |
| 4515 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4516 | run_test "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ |
| 4517 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4518 | "$P_CLI force_version=tls1_1 \ |
| 4519 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4520 | 0 \ |
| 4521 | -c "Read from server: 1 bytes read" |
| 4522 | |
| 4523 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4524 | run_test "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 4525 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4526 | "$P_CLI force_version=tls1_1 \ |
| 4527 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4528 | 0 \ |
| 4529 | -c "Read from server: 1 bytes read" |
| 4530 | |
| 4531 | run_test "Small server packet TLS 1.1 StreamCipher" \ |
| 4532 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4533 | "$P_CLI force_version=tls1_1 \ |
| 4534 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4535 | 0 \ |
| 4536 | -c "Read from server: 1 bytes read" |
| 4537 | |
| 4538 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM" \ |
| 4539 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4540 | "$P_CLI force_version=tls1_1 \ |
| 4541 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4542 | 0 \ |
| 4543 | -c "Read from server: 1 bytes read" |
| 4544 | |
| 4545 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4546 | run_test "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ |
| 4547 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4548 | "$P_CLI force_version=tls1_1 \ |
| 4549 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4550 | 0 \ |
| 4551 | -c "Read from server: 1 bytes read" |
| 4552 | |
| 4553 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4554 | run_test "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 4555 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4556 | "$P_CLI force_version=tls1_1 \ |
| 4557 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4558 | 0 \ |
| 4559 | -c "Read from server: 1 bytes read" |
| 4560 | |
| 4561 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 4562 | "$P_SRV response_size=1" \ |
| 4563 | "$P_CLI force_version=tls1_2 \ |
| 4564 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4565 | 0 \ |
| 4566 | -c "Read from server: 1 bytes read" |
| 4567 | |
| 4568 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 4569 | "$P_SRV response_size=1" \ |
| 4570 | "$P_CLI force_version=tls1_2 \ |
| 4571 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 4572 | 0 \ |
| 4573 | -c "Read from server: 1 bytes read" |
| 4574 | |
| 4575 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 4576 | "$P_SRV response_size=1" \ |
| 4577 | "$P_CLI force_version=tls1_2 \ |
| 4578 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 4579 | 0 \ |
| 4580 | -c "Read from server: 1 bytes read" |
| 4581 | |
| 4582 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4583 | run_test "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ |
| 4584 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4585 | "$P_CLI force_version=tls1_2 \ |
| 4586 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4587 | 0 \ |
| 4588 | -c "Read from server: 1 bytes read" |
| 4589 | |
| 4590 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4591 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 4592 | "$P_SRV response_size=1 trunc_hmac=1" \ |
| 4593 | "$P_CLI force_version=tls1_2 \ |
| 4594 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 4595 | 0 \ |
| 4596 | -c "Read from server: 1 bytes read" |
| 4597 | |
| 4598 | run_test "Small server packet TLS 1.2 StreamCipher" \ |
| 4599 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4600 | "$P_CLI force_version=tls1_2 \ |
| 4601 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4602 | 0 \ |
| 4603 | -c "Read from server: 1 bytes read" |
| 4604 | |
| 4605 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM" \ |
| 4606 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4607 | "$P_CLI force_version=tls1_2 \ |
| 4608 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4609 | 0 \ |
| 4610 | -c "Read from server: 1 bytes read" |
| 4611 | |
| 4612 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4613 | run_test "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ |
| 4614 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4615 | "$P_CLI force_version=tls1_2 \ |
| 4616 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4617 | 0 \ |
| 4618 | -c "Read from server: 1 bytes read" |
| 4619 | |
| 4620 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4621 | run_test "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 4622 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 4623 | "$P_CLI force_version=tls1_2 \ |
| 4624 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 4625 | 0 \ |
| 4626 | -c "Read from server: 1 bytes read" |
| 4627 | |
| 4628 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 4629 | "$P_SRV response_size=1" \ |
| 4630 | "$P_CLI force_version=tls1_2 \ |
| 4631 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4632 | 0 \ |
| 4633 | -c "Read from server: 1 bytes read" |
| 4634 | |
| 4635 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 4636 | "$P_SRV response_size=1" \ |
| 4637 | "$P_CLI force_version=tls1_2 \ |
| 4638 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4639 | 0 \ |
| 4640 | -c "Read from server: 1 bytes read" |
| 4641 | |
| 4642 | # Tests for small server packets in DTLS |
| 4643 | |
| 4644 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4645 | run_test "Small server packet DTLS 1.0" \ |
| 4646 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ |
| 4647 | "$P_CLI dtls=1 \ |
| 4648 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4649 | 0 \ |
| 4650 | -c "Read from server: 1 bytes read" |
| 4651 | |
| 4652 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4653 | run_test "Small server packet DTLS 1.0, without EtM" \ |
| 4654 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ |
| 4655 | "$P_CLI dtls=1 \ |
| 4656 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4657 | 0 \ |
| 4658 | -c "Read from server: 1 bytes read" |
| 4659 | |
| 4660 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4661 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4662 | run_test "Small server packet DTLS 1.0, truncated hmac" \ |
| 4663 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ |
| 4664 | "$P_CLI dtls=1 trunc_hmac=1 \ |
| 4665 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4666 | 0 \ |
| 4667 | -c "Read from server: 1 bytes read" |
| 4668 | |
| 4669 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4670 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4671 | run_test "Small server packet DTLS 1.0, without EtM, truncated MAC" \ |
| 4672 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ |
| 4673 | "$P_CLI dtls=1 \ |
| 4674 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4675 | 0 \ |
| 4676 | -c "Read from server: 1 bytes read" |
| 4677 | |
| 4678 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4679 | run_test "Small server packet DTLS 1.2" \ |
| 4680 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 4681 | "$P_CLI dtls=1 \ |
| 4682 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4683 | 0 \ |
| 4684 | -c "Read from server: 1 bytes read" |
| 4685 | |
| 4686 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4687 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 4688 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 4689 | "$P_CLI dtls=1 \ |
| 4690 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4691 | 0 \ |
| 4692 | -c "Read from server: 1 bytes read" |
| 4693 | |
| 4694 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4695 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4696 | run_test "Small server packet DTLS 1.2, truncated hmac" \ |
| 4697 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ |
| 4698 | "$P_CLI dtls=1 \ |
| 4699 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
| 4700 | 0 \ |
| 4701 | -c "Read from server: 1 bytes read" |
| 4702 | |
| 4703 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 4704 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 4705 | run_test "Small server packet DTLS 1.2, without EtM, truncated MAC" \ |
| 4706 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ |
| 4707 | "$P_CLI dtls=1 \ |
| 4708 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ |
| 4709 | 0 \ |
| 4710 | -c "Read from server: 1 bytes read" |
| 4711 | |
Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 4712 | # A test for extensions in SSLv3 |
| 4713 | |
| 4714 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4715 | run_test "SSLv3 with extensions, server side" \ |
| 4716 | "$P_SRV min_version=ssl3 debug_level=3" \ |
| 4717 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ |
| 4718 | 0 \ |
| 4719 | -S "dumping 'client hello extensions'" \ |
| 4720 | -S "server hello, total extension length:" |
| 4721 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4722 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4723 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4724 | # How many fragments do we expect to write $1 bytes? |
| 4725 | fragments_for_write() { |
| 4726 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 4727 | } |
| 4728 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4729 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4730 | run_test "Large client packet SSLv3 BlockCipher" \ |
Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 4731 | "$P_SRV min_version=ssl3" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4732 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4733 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4734 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4735 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4736 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4737 | |
Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4738 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4739 | run_test "Large client packet SSLv3 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4740 | "$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] | 4741 | "$P_CLI request_size=16384 force_version=ssl3 \ |
| 4742 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4743 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4744 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4745 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4746 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4747 | run_test "Large client packet TLS 1.0 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4748 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4749 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4750 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4751 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4752 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4753 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4754 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4755 | 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] | 4756 | "$P_SRV" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4757 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
| 4758 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4759 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4760 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4761 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4762 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4763 | run_test "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4764 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4765 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4766 | 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] | 4767 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4768 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4769 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4770 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4771 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4772 | 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] | 4773 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4774 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4775 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4776 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4777 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4778 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4779 | run_test "Large client packet TLS 1.0 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4780 | "$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] | 4781 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4782 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4783 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4784 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4785 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4786 | run_test "Large client packet TLS 1.0 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4787 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4788 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4789 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4790 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4791 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4792 | |
| 4793 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4794 | run_test "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4795 | "$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] | 4796 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4797 | 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] | 4798 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4799 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4800 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4801 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4802 | 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] | 4803 | "$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] | 4804 | "$P_CLI request_size=16384 force_version=tls1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4805 | 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] | 4806 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4807 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4808 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4809 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4810 | run_test "Large client packet TLS 1.1 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4811 | "$P_SRV" \ |
| 4812 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4813 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4814 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4815 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4816 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4817 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4818 | run_test "Large client packet TLS 1.1 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4819 | "$P_SRV" \ |
| 4820 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ |
| 4821 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4822 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4823 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4824 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4825 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4826 | run_test "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4827 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4828 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4829 | 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] | 4830 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4831 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4832 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4833 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4834 | 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] | 4835 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4836 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4837 | 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] | 4838 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4839 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4840 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4841 | run_test "Large client packet TLS 1.1 StreamCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4842 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4843 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
| 4844 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4845 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4846 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4847 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4848 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4849 | run_test "Large client packet TLS 1.1 StreamCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4850 | "$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] | 4851 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4852 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4853 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4854 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4855 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4856 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4857 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4858 | run_test "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4859 | "$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] | 4860 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4861 | 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] | 4862 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4863 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4864 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4865 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4866 | 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] | 4867 | "$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] | 4868 | "$P_CLI request_size=16384 force_version=tls1_1 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4869 | 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] | 4870 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4871 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4872 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4873 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4874 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4875 | "$P_SRV" \ |
| 4876 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4877 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4878 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4879 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4880 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4881 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4882 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4883 | "$P_SRV" \ |
| 4884 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 4885 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4886 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4887 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4888 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4889 | 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] | 4890 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 4891 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4892 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4893 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4894 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4895 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4896 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4897 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4898 | run_test "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4899 | "$P_SRV trunc_hmac=1" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4900 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4901 | 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] | 4902 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4903 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4904 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4905 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4906 | 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] | 4907 | "$P_SRV trunc_hmac=1" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4908 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4909 | 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] | 4910 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4911 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4912 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4913 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4914 | run_test "Large client packet TLS 1.2 StreamCipher" \ |
Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 4915 | "$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] | 4916 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4917 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4918 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4919 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4920 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4921 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4922 | 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] | 4923 | "$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] | 4924 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4925 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 4926 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4927 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4928 | |
Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 4929 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4930 | run_test "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4931 | "$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] | 4932 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4933 | 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] | 4934 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4935 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4936 | |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 4937 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4938 | 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] | 4939 | "$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] | 4940 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 4941 | 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] | 4942 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4943 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4944 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4945 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4946 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4947 | "$P_SRV" \ |
| 4948 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4949 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 4950 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4951 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4952 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4953 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4954 | 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] | 4955 | "$P_SRV" \ |
| 4956 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 4957 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 4958 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4959 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 4960 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 4961 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4962 | # Test for large server packets |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4963 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4964 | run_test "Large server packet SSLv3 StreamCipher" \ |
| 4965 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4966 | "$P_CLI force_version=ssl3 \ |
| 4967 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 4968 | 0 \ |
| 4969 | -c "Read from server: 16384 bytes read" |
| 4970 | |
Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 4971 | # Checking next 4 tests logs for 1n-1 split against BEAST too |
| 4972 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 |
| 4973 | run_test "Large server packet SSLv3 BlockCipher" \ |
| 4974 | "$P_SRV response_size=16384 min_version=ssl3" \ |
| 4975 | "$P_CLI force_version=ssl3 recsplit=0 \ |
| 4976 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4977 | 0 \ |
| 4978 | -c "Read from server: 1 bytes read"\ |
| 4979 | -c "16383 bytes read"\ |
| 4980 | -C "Read from server: 16384 bytes read" |
| 4981 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 4982 | run_test "Large server packet TLS 1.0 BlockCipher" \ |
| 4983 | "$P_SRV response_size=16384" \ |
| 4984 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 4985 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4986 | 0 \ |
| 4987 | -c "Read from server: 1 bytes read"\ |
| 4988 | -c "16383 bytes read"\ |
| 4989 | -C "Read from server: 16384 bytes read" |
| 4990 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 4991 | run_test "Large server packet TLS 1.0 BlockCipher, without EtM" \ |
| 4992 | "$P_SRV response_size=16384" \ |
| 4993 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ |
| 4994 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 4995 | 0 \ |
| 4996 | -c "Read from server: 1 bytes read"\ |
| 4997 | -c "16383 bytes read"\ |
| 4998 | -C "Read from server: 16384 bytes read" |
| 4999 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5000 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5001 | run_test "Large server packet TLS 1.0 BlockCipher truncated MAC" \ |
| 5002 | "$P_SRV response_size=16384" \ |
| 5003 | "$P_CLI force_version=tls1 recsplit=0 \ |
| 5004 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5005 | trunc_hmac=1" \ |
| 5006 | 0 \ |
| 5007 | -c "Read from server: 1 bytes read"\ |
| 5008 | -c "16383 bytes read"\ |
| 5009 | -C "Read from server: 16384 bytes read" |
| 5010 | |
| 5011 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5012 | run_test "Large server packet TLS 1.0 StreamCipher truncated MAC" \ |
| 5013 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5014 | "$P_CLI force_version=tls1 \ |
| 5015 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5016 | trunc_hmac=1" \ |
| 5017 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5018 | -s "16384 bytes written in 1 fragments" \ |
| 5019 | -c "Read from server: 16384 bytes read" |
| 5020 | |
| 5021 | run_test "Large server packet TLS 1.0 StreamCipher" \ |
| 5022 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5023 | "$P_CLI force_version=tls1 \ |
| 5024 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5025 | 0 \ |
| 5026 | -s "16384 bytes written in 1 fragments" \ |
| 5027 | -c "Read from server: 16384 bytes read" |
| 5028 | |
| 5029 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM" \ |
| 5030 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5031 | "$P_CLI force_version=tls1 \ |
| 5032 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5033 | 0 \ |
| 5034 | -s "16384 bytes written in 1 fragments" \ |
| 5035 | -c "Read from server: 16384 bytes read" |
| 5036 | |
| 5037 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5038 | run_test "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ |
| 5039 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5040 | "$P_CLI force_version=tls1 \ |
| 5041 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5042 | 0 \ |
| 5043 | -s "16384 bytes written in 1 fragments" \ |
| 5044 | -c "Read from server: 16384 bytes read" |
| 5045 | |
| 5046 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5047 | run_test "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ |
| 5048 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5049 | "$P_CLI force_version=tls1 \ |
| 5050 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5051 | 0 \ |
| 5052 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5053 | -c "Read from server: 16384 bytes read" |
| 5054 | |
| 5055 | run_test "Large server packet TLS 1.1 BlockCipher" \ |
| 5056 | "$P_SRV response_size=16384" \ |
| 5057 | "$P_CLI force_version=tls1_1 \ |
| 5058 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5059 | 0 \ |
| 5060 | -c "Read from server: 16384 bytes read" |
| 5061 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5062 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM" \ |
| 5063 | "$P_SRV response_size=16384" \ |
| 5064 | "$P_CLI force_version=tls1_1 etm=0 \ |
| 5065 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5066 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5067 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5068 | -c "Read from server: 16384 bytes read" |
| 5069 | |
| 5070 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5071 | run_test "Large server packet TLS 1.1 BlockCipher truncated MAC" \ |
| 5072 | "$P_SRV response_size=16384" \ |
| 5073 | "$P_CLI force_version=tls1_1 \ |
| 5074 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5075 | trunc_hmac=1" \ |
| 5076 | 0 \ |
| 5077 | -c "Read from server: 16384 bytes read" |
| 5078 | |
| 5079 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5080 | run_test "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ |
| 5081 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5082 | "$P_CLI force_version=tls1_1 \ |
| 5083 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5084 | 0 \ |
| 5085 | -s "16384 bytes written in 1 fragments" \ |
| 5086 | -c "Read from server: 16384 bytes read" |
| 5087 | |
| 5088 | run_test "Large server packet TLS 1.1 StreamCipher" \ |
| 5089 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5090 | "$P_CLI force_version=tls1_1 \ |
| 5091 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5092 | 0 \ |
| 5093 | -c "Read from server: 16384 bytes read" |
| 5094 | |
| 5095 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM" \ |
| 5096 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5097 | "$P_CLI force_version=tls1_1 \ |
| 5098 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5099 | 0 \ |
| 5100 | -s "16384 bytes written in 1 fragments" \ |
| 5101 | -c "Read from server: 16384 bytes read" |
| 5102 | |
| 5103 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5104 | run_test "Large server packet TLS 1.1 StreamCipher truncated MAC" \ |
| 5105 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5106 | "$P_CLI force_version=tls1_1 \ |
| 5107 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5108 | trunc_hmac=1" \ |
| 5109 | 0 \ |
| 5110 | -c "Read from server: 16384 bytes read" |
| 5111 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5112 | run_test "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ |
| 5113 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5114 | "$P_CLI force_version=tls1_1 \ |
| 5115 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5116 | 0 \ |
| 5117 | -s "16384 bytes written in 1 fragments" \ |
| 5118 | -c "Read from server: 16384 bytes read" |
| 5119 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5120 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5121 | "$P_SRV response_size=16384" \ |
| 5122 | "$P_CLI force_version=tls1_2 \ |
| 5123 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5124 | 0 \ |
| 5125 | -c "Read from server: 16384 bytes read" |
| 5126 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5127 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5128 | "$P_SRV response_size=16384" \ |
| 5129 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5130 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5131 | 0 \ |
| 5132 | -s "16384 bytes written in 1 fragments" \ |
| 5133 | -c "Read from server: 16384 bytes read" |
| 5134 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5135 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5136 | "$P_SRV response_size=16384" \ |
| 5137 | "$P_CLI force_version=tls1_2 \ |
| 5138 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5139 | 0 \ |
| 5140 | -c "Read from server: 16384 bytes read" |
| 5141 | |
| 5142 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5143 | run_test "Large server packet TLS 1.2 BlockCipher truncated MAC" \ |
| 5144 | "$P_SRV response_size=16384" \ |
| 5145 | "$P_CLI force_version=tls1_2 \ |
| 5146 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ |
| 5147 | trunc_hmac=1" \ |
| 5148 | 0 \ |
| 5149 | -c "Read from server: 16384 bytes read" |
| 5150 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5151 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5152 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5153 | "$P_CLI force_version=tls1_2 \ |
| 5154 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5155 | 0 \ |
| 5156 | -s "16384 bytes written in 1 fragments" \ |
| 5157 | -c "Read from server: 16384 bytes read" |
| 5158 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5159 | run_test "Large server packet TLS 1.2 StreamCipher" \ |
| 5160 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5161 | "$P_CLI force_version=tls1_2 \ |
| 5162 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5163 | 0 \ |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5164 | -s "16384 bytes written in 1 fragments" \ |
| 5165 | -c "Read from server: 16384 bytes read" |
| 5166 | |
| 5167 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM" \ |
| 5168 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5169 | "$P_CLI force_version=tls1_2 \ |
| 5170 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ |
| 5171 | 0 \ |
| 5172 | -s "16384 bytes written in 1 fragments" \ |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5173 | -c "Read from server: 16384 bytes read" |
| 5174 | |
| 5175 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5176 | run_test "Large server packet TLS 1.2 StreamCipher truncated MAC" \ |
| 5177 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ |
| 5178 | "$P_CLI force_version=tls1_2 \ |
| 5179 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ |
| 5180 | trunc_hmac=1" \ |
| 5181 | 0 \ |
| 5182 | -c "Read from server: 16384 bytes read" |
| 5183 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5184 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC |
| 5185 | run_test "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ |
| 5186 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ |
| 5187 | "$P_CLI force_version=tls1_2 \ |
| 5188 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ |
| 5189 | 0 \ |
| 5190 | -s "16384 bytes written in 1 fragments" \ |
| 5191 | -c "Read from server: 16384 bytes read" |
| 5192 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5193 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5194 | "$P_SRV response_size=16384" \ |
| 5195 | "$P_CLI force_version=tls1_2 \ |
| 5196 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5197 | 0 \ |
| 5198 | -c "Read from server: 16384 bytes read" |
| 5199 | |
| 5200 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5201 | "$P_SRV response_size=16384" \ |
| 5202 | "$P_CLI force_version=tls1_2 \ |
| 5203 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5204 | 0 \ |
| 5205 | -c "Read from server: 16384 bytes read" |
| 5206 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5207 | # Tests for restartable ECC |
| 5208 | |
| 5209 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5210 | run_test "EC restart: TLS, default" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5211 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5212 | "$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] | 5213 | 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] | 5214 | debug_level=1" \ |
| 5215 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5216 | -C "x509_verify_cert.*4b00" \ |
| 5217 | -C "mbedtls_pk_verify.*4b00" \ |
| 5218 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5219 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5220 | |
| 5221 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5222 | run_test "EC restart: TLS, max_ops=0" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5223 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5224 | "$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] | 5225 | 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] | 5226 | debug_level=1 ec_max_ops=0" \ |
| 5227 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5228 | -C "x509_verify_cert.*4b00" \ |
| 5229 | -C "mbedtls_pk_verify.*4b00" \ |
| 5230 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5231 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5232 | |
| 5233 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5234 | run_test "EC restart: TLS, max_ops=65535" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5235 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5236 | "$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] | 5237 | 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] | 5238 | debug_level=1 ec_max_ops=65535" \ |
| 5239 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5240 | -C "x509_verify_cert.*4b00" \ |
| 5241 | -C "mbedtls_pk_verify.*4b00" \ |
| 5242 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5243 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5244 | |
| 5245 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5246 | run_test "EC restart: TLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5247 | "$P_SRV auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5248 | "$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] | 5249 | 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] | 5250 | debug_level=1 ec_max_ops=1000" \ |
| 5251 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5252 | -c "x509_verify_cert.*4b00" \ |
| 5253 | -c "mbedtls_pk_verify.*4b00" \ |
| 5254 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5255 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5256 | |
| 5257 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5258 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
| 5259 | "$P_SRV auth_mode=required \ |
| 5260 | crt_file=data_files/server5-badsign.crt \ |
| 5261 | key_file=data_files/server5.key" \ |
| 5262 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5263 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5264 | debug_level=1 ec_max_ops=1000" \ |
| 5265 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5266 | -c "x509_verify_cert.*4b00" \ |
| 5267 | -C "mbedtls_pk_verify.*4b00" \ |
| 5268 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5269 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5270 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5271 | -c "! mbedtls_ssl_handshake returned" \ |
| 5272 | -c "X509 - Certificate verification failed" |
| 5273 | |
| 5274 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5275 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
| 5276 | "$P_SRV auth_mode=required \ |
| 5277 | crt_file=data_files/server5-badsign.crt \ |
| 5278 | key_file=data_files/server5.key" \ |
| 5279 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5280 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5281 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5282 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5283 | -c "x509_verify_cert.*4b00" \ |
| 5284 | -c "mbedtls_pk_verify.*4b00" \ |
| 5285 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5286 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5287 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5288 | -C "! mbedtls_ssl_handshake returned" \ |
| 5289 | -C "X509 - Certificate verification failed" |
| 5290 | |
| 5291 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5292 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
| 5293 | "$P_SRV auth_mode=required \ |
| 5294 | crt_file=data_files/server5-badsign.crt \ |
| 5295 | key_file=data_files/server5.key" \ |
| 5296 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5297 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5298 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 5299 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5300 | -C "x509_verify_cert.*4b00" \ |
| 5301 | -c "mbedtls_pk_verify.*4b00" \ |
| 5302 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5303 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5304 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5305 | -C "! mbedtls_ssl_handshake returned" \ |
| 5306 | -C "X509 - Certificate verification failed" |
| 5307 | |
| 5308 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5309 | run_test "EC restart: DTLS, max_ops=1000" \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 5310 | "$P_SRV auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5311 | "$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] | 5312 | 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] | 5313 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 5314 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5315 | -c "x509_verify_cert.*4b00" \ |
| 5316 | -c "mbedtls_pk_verify.*4b00" \ |
| 5317 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5318 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5319 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5320 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5321 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
| 5322 | "$P_SRV" \ |
| 5323 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5324 | debug_level=1 ec_max_ops=1000" \ |
| 5325 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5326 | -c "x509_verify_cert.*4b00" \ |
| 5327 | -c "mbedtls_pk_verify.*4b00" \ |
| 5328 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5329 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5330 | |
| 5331 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
| 5332 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
| 5333 | "$P_SRV psk=abc123" \ |
| 5334 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 5335 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 5336 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5337 | -C "x509_verify_cert.*4b00" \ |
| 5338 | -C "mbedtls_pk_verify.*4b00" \ |
| 5339 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5340 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5341 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5342 | # Tests of asynchronous private key support in SSL |
| 5343 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5344 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5345 | run_test "SSL async private: sign, delay=0" \ |
| 5346 | "$P_SRV \ |
| 5347 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5348 | "$P_CLI" \ |
| 5349 | 0 \ |
| 5350 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5351 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5352 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5353 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5354 | run_test "SSL async private: sign, delay=1" \ |
| 5355 | "$P_SRV \ |
| 5356 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5357 | "$P_CLI" \ |
| 5358 | 0 \ |
| 5359 | -s "Async sign callback: using key slot " \ |
| 5360 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5361 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5362 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 5363 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5364 | run_test "SSL async private: sign, delay=2" \ |
| 5365 | "$P_SRV \ |
| 5366 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 5367 | "$P_CLI" \ |
| 5368 | 0 \ |
| 5369 | -s "Async sign callback: using key slot " \ |
| 5370 | -U "Async sign callback: using key slot " \ |
| 5371 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 5372 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5373 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5374 | |
Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 5375 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 |
| 5376 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. |
| 5377 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5378 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 5379 | run_test "SSL async private: sign, RSA, TLS 1.1" \ |
| 5380 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ |
| 5381 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
| 5382 | "$P_CLI force_version=tls1_1" \ |
| 5383 | 0 \ |
| 5384 | -s "Async sign callback: using key slot " \ |
| 5385 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5386 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5387 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 5388 | run_test "SSL async private: sign, SNI" \ |
| 5389 | "$P_SRV debug_level=3 \ |
| 5390 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 5391 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5392 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5393 | "$P_CLI server_name=polarssl.example" \ |
| 5394 | 0 \ |
| 5395 | -s "Async sign callback: using key slot " \ |
| 5396 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5397 | -s "parse ServerName extension" \ |
| 5398 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5399 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5400 | |
| 5401 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5402 | run_test "SSL async private: decrypt, delay=0" \ |
| 5403 | "$P_SRV \ |
| 5404 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5405 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5406 | 0 \ |
| 5407 | -s "Async decrypt callback: using key slot " \ |
| 5408 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5409 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5410 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5411 | run_test "SSL async private: decrypt, delay=1" \ |
| 5412 | "$P_SRV \ |
| 5413 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5414 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5415 | 0 \ |
| 5416 | -s "Async decrypt callback: using key slot " \ |
| 5417 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5418 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5419 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5420 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5421 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 5422 | "$P_SRV psk=abc123 \ |
| 5423 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5424 | "$P_CLI psk=abc123 \ |
| 5425 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5426 | 0 \ |
| 5427 | -s "Async decrypt callback: using key slot " \ |
| 5428 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5429 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5430 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5431 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 5432 | "$P_SRV psk=abc123 \ |
| 5433 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5434 | "$P_CLI psk=abc123 \ |
| 5435 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5436 | 0 \ |
| 5437 | -s "Async decrypt callback: using key slot " \ |
| 5438 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5439 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5440 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5441 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5442 | run_test "SSL async private: sign callback not present" \ |
| 5443 | "$P_SRV \ |
| 5444 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5445 | "$P_CLI; [ \$? -eq 1 ] && |
| 5446 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5447 | 0 \ |
| 5448 | -S "Async sign callback" \ |
| 5449 | -s "! mbedtls_ssl_handshake returned" \ |
| 5450 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 5451 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 5452 | -s "Successful connection" |
| 5453 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5454 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5455 | run_test "SSL async private: decrypt callback not present" \ |
| 5456 | "$P_SRV debug_level=1 \ |
| 5457 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 5458 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 5459 | [ \$? -eq 1 ] && $P_CLI" \ |
| 5460 | 0 \ |
| 5461 | -S "Async decrypt callback" \ |
| 5462 | -s "! mbedtls_ssl_handshake returned" \ |
| 5463 | -s "got no RSA private key" \ |
| 5464 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5465 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5466 | |
| 5467 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5468 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5469 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5470 | "$P_SRV \ |
| 5471 | async_operations=s async_private_delay1=1 \ |
| 5472 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5473 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5474 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5475 | 0 \ |
| 5476 | -s "Async sign callback: using key slot 0," \ |
| 5477 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5478 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5479 | |
| 5480 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5481 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5482 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5483 | "$P_SRV \ |
| 5484 | async_operations=s async_private_delay2=1 \ |
| 5485 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5486 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5487 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5488 | 0 \ |
| 5489 | -s "Async sign callback: using key slot 0," \ |
| 5490 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5491 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5492 | |
| 5493 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5494 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 5495 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5496 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 5497 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5498 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5499 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5500 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5501 | 0 \ |
| 5502 | -s "Async sign callback: using key slot 1," \ |
| 5503 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5504 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5505 | |
| 5506 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5507 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5508 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5509 | "$P_SRV \ |
| 5510 | async_operations=s async_private_delay1=1 \ |
| 5511 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5512 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5513 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5514 | 0 \ |
| 5515 | -s "Async sign callback: no key matches this certificate." |
| 5516 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5517 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5518 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5519 | "$P_SRV \ |
| 5520 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5521 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5522 | "$P_CLI" \ |
| 5523 | 1 \ |
| 5524 | -s "Async sign callback: injected error" \ |
| 5525 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5526 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5527 | -s "! mbedtls_ssl_handshake returned" |
| 5528 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5529 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5530 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5531 | "$P_SRV \ |
| 5532 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5533 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5534 | "$P_CLI" \ |
| 5535 | 1 \ |
| 5536 | -s "Async sign callback: using key slot " \ |
| 5537 | -S "Async resume" \ |
| 5538 | -s "Async cancel" |
| 5539 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5540 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5541 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5542 | "$P_SRV \ |
| 5543 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5544 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5545 | "$P_CLI" \ |
| 5546 | 1 \ |
| 5547 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5548 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 5549 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5550 | -s "! mbedtls_ssl_handshake returned" |
| 5551 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5552 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5553 | run_test "SSL async private: decrypt, error in start" \ |
| 5554 | "$P_SRV \ |
| 5555 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5556 | async_private_error=1" \ |
| 5557 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5558 | 1 \ |
| 5559 | -s "Async decrypt callback: injected error" \ |
| 5560 | -S "Async resume" \ |
| 5561 | -S "Async cancel" \ |
| 5562 | -s "! mbedtls_ssl_handshake returned" |
| 5563 | |
| 5564 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5565 | run_test "SSL async private: decrypt, cancel after start" \ |
| 5566 | "$P_SRV \ |
| 5567 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5568 | async_private_error=2" \ |
| 5569 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5570 | 1 \ |
| 5571 | -s "Async decrypt callback: using key slot " \ |
| 5572 | -S "Async resume" \ |
| 5573 | -s "Async cancel" |
| 5574 | |
| 5575 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5576 | run_test "SSL async private: decrypt, error in resume" \ |
| 5577 | "$P_SRV \ |
| 5578 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5579 | async_private_error=3" \ |
| 5580 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5581 | 1 \ |
| 5582 | -s "Async decrypt callback: using key slot " \ |
| 5583 | -s "Async resume callback: decrypt done but injected error" \ |
| 5584 | -S "Async cancel" \ |
| 5585 | -s "! mbedtls_ssl_handshake returned" |
| 5586 | |
| 5587 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5588 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5589 | "$P_SRV \ |
| 5590 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5591 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5592 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5593 | 0 \ |
| 5594 | -s "Async cancel" \ |
| 5595 | -s "! mbedtls_ssl_handshake returned" \ |
| 5596 | -s "Async resume" \ |
| 5597 | -s "Successful connection" |
| 5598 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5599 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5600 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5601 | "$P_SRV \ |
| 5602 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 5603 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5604 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 5605 | 0 \ |
| 5606 | -s "! mbedtls_ssl_handshake returned" \ |
| 5607 | -s "Async resume" \ |
| 5608 | -s "Successful connection" |
| 5609 | |
| 5610 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5611 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5612 | 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] | 5613 | "$P_SRV \ |
| 5614 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 5615 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5616 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5617 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5618 | [ \$? -eq 1 ] && |
| 5619 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5620 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 5621 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5622 | -S "Async resume" \ |
| 5623 | -s "Async cancel" \ |
| 5624 | -s "! mbedtls_ssl_handshake returned" \ |
| 5625 | -s "Async sign callback: no key matches this certificate." \ |
| 5626 | -s "Successful connection" |
| 5627 | |
| 5628 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5629 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 5630 | 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] | 5631 | "$P_SRV \ |
| 5632 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 5633 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5634 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 5635 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 5636 | [ \$? -eq 1 ] && |
| 5637 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 5638 | 0 \ |
| 5639 | -s "Async resume" \ |
| 5640 | -s "! mbedtls_ssl_handshake returned" \ |
| 5641 | -s "Async sign callback: no key matches this certificate." \ |
| 5642 | -s "Successful connection" |
| 5643 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5644 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5645 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5646 | run_test "SSL async private: renegotiation: client-initiated; sign" \ |
| 5647 | "$P_SRV \ |
| 5648 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5649 | exchanges=2 renegotiation=1" \ |
| 5650 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5651 | 0 \ |
| 5652 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5653 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5654 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5655 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5656 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5657 | run_test "SSL async private: renegotiation: server-initiated; sign" \ |
| 5658 | "$P_SRV \ |
| 5659 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5660 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5661 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 5662 | 0 \ |
| 5663 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5664 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5665 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5666 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5667 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5668 | run_test "SSL async private: renegotiation: client-initiated; decrypt" \ |
| 5669 | "$P_SRV \ |
| 5670 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5671 | exchanges=2 renegotiation=1" \ |
| 5672 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 5673 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5674 | 0 \ |
| 5675 | -s "Async decrypt callback: using key slot " \ |
| 5676 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5677 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5678 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5679 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 5680 | run_test "SSL async private: renegotiation: server-initiated; decrypt" \ |
| 5681 | "$P_SRV \ |
| 5682 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 5683 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 5684 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 5685 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5686 | 0 \ |
| 5687 | -s "Async decrypt callback: using key slot " \ |
| 5688 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5689 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5690 | # Tests for ECC extensions (rfc 4492) |
| 5691 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5692 | requires_config_enabled MBEDTLS_AES_C |
| 5693 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5694 | requires_config_enabled MBEDTLS_SHA256_C |
| 5695 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5696 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 5697 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5698 | "$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] | 5699 | 0 \ |
| 5700 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 5701 | -C "client hello, adding supported_point_formats extension" \ |
| 5702 | -S "found supported elliptic curves extension" \ |
| 5703 | -S "found supported point formats extension" |
| 5704 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5705 | requires_config_enabled MBEDTLS_AES_C |
| 5706 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5707 | requires_config_enabled MBEDTLS_SHA256_C |
| 5708 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5709 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5710 | "$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] | 5711 | "$P_CLI debug_level=3" \ |
| 5712 | 0 \ |
| 5713 | -C "found supported_point_formats extension" \ |
| 5714 | -S "server hello, supported_point_formats extension" |
| 5715 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5716 | requires_config_enabled MBEDTLS_AES_C |
| 5717 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5718 | requires_config_enabled MBEDTLS_SHA256_C |
| 5719 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5720 | run_test "Force an ECC ciphersuite in the client side" \ |
| 5721 | "$P_SRV debug_level=3" \ |
| 5722 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5723 | 0 \ |
| 5724 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 5725 | -c "client hello, adding supported_point_formats extension" \ |
| 5726 | -s "found supported elliptic curves extension" \ |
| 5727 | -s "found supported point formats extension" |
| 5728 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 5729 | requires_config_enabled MBEDTLS_AES_C |
| 5730 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 5731 | requires_config_enabled MBEDTLS_SHA256_C |
| 5732 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 5733 | run_test "Force an ECC ciphersuite in the server side" \ |
| 5734 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 5735 | "$P_CLI debug_level=3" \ |
| 5736 | 0 \ |
| 5737 | -c "found supported_point_formats extension" \ |
| 5738 | -s "server hello, supported_point_formats extension" |
| 5739 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5740 | # Tests for DTLS HelloVerifyRequest |
| 5741 | |
| 5742 | run_test "DTLS cookie: enabled" \ |
| 5743 | "$P_SRV dtls=1 debug_level=2" \ |
| 5744 | "$P_CLI dtls=1 debug_level=2" \ |
| 5745 | 0 \ |
| 5746 | -s "cookie verification failed" \ |
| 5747 | -s "cookie verification passed" \ |
| 5748 | -S "cookie verification skipped" \ |
| 5749 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5750 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5751 | -S "SSL - The requested feature is not available" |
| 5752 | |
| 5753 | run_test "DTLS cookie: disabled" \ |
| 5754 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 5755 | "$P_CLI dtls=1 debug_level=2" \ |
| 5756 | 0 \ |
| 5757 | -S "cookie verification failed" \ |
| 5758 | -S "cookie verification passed" \ |
| 5759 | -s "cookie verification skipped" \ |
| 5760 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5761 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5762 | -S "SSL - The requested feature is not available" |
| 5763 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5764 | run_test "DTLS cookie: default (failing)" \ |
| 5765 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 5766 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 5767 | 1 \ |
| 5768 | -s "cookie verification failed" \ |
| 5769 | -S "cookie verification passed" \ |
| 5770 | -S "cookie verification skipped" \ |
| 5771 | -C "received hello verify request" \ |
| 5772 | -S "hello verification requested" \ |
| 5773 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5774 | |
| 5775 | requires_ipv6 |
| 5776 | run_test "DTLS cookie: enabled, IPv6" \ |
| 5777 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 5778 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 5779 | 0 \ |
| 5780 | -s "cookie verification failed" \ |
| 5781 | -s "cookie verification passed" \ |
| 5782 | -S "cookie verification skipped" \ |
| 5783 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5784 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 5785 | -S "SSL - The requested feature is not available" |
| 5786 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5787 | run_test "DTLS cookie: enabled, nbio" \ |
| 5788 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 5789 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 5790 | 0 \ |
| 5791 | -s "cookie verification failed" \ |
| 5792 | -s "cookie verification passed" \ |
| 5793 | -S "cookie verification skipped" \ |
| 5794 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 5795 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 5796 | -S "SSL - The requested feature is not available" |
| 5797 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5798 | # Tests for client reconnecting from the same port with DTLS |
| 5799 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5800 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5801 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 5802 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 5803 | "$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] | 5804 | 0 \ |
| 5805 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5806 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5807 | -S "Client initiated reconnection from same port" |
| 5808 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5809 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5810 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 5811 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 5812 | "$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] | 5813 | 0 \ |
| 5814 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5815 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5816 | -s "Client initiated reconnection from same port" |
| 5817 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 5818 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 5819 | 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] | 5820 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 5821 | "$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] | 5822 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5823 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 5824 | -s "Client initiated reconnection from same port" |
| 5825 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 5826 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 5827 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 5828 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 5829 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 5830 | 0 \ |
| 5831 | -S "The operation timed out" \ |
| 5832 | -s "Client initiated reconnection from same port" |
| 5833 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5834 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 5835 | "$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] | 5836 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 5837 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 5838 | -s "The operation timed out" \ |
| 5839 | -S "Client initiated reconnection from same port" |
| 5840 | |
Manuel Pégourié-Gonnard | b85ce9e | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 5841 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 5842 | -p "$P_PXY inject_clihlo=1" \ |
| 5843 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 5844 | "$P_CLI dtls=1 exchanges=2" \ |
| 5845 | 0 \ |
| 5846 | -s "possible client reconnect from the same port" \ |
| 5847 | -S "Client initiated reconnection from same port" |
| 5848 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5849 | # Tests for various cases of client authentication with DTLS |
| 5850 | # (focused on handshake flows and message parsing) |
| 5851 | |
| 5852 | run_test "DTLS client auth: required" \ |
| 5853 | "$P_SRV dtls=1 auth_mode=required" \ |
| 5854 | "$P_CLI dtls=1" \ |
| 5855 | 0 \ |
| 5856 | -s "Verifying peer X.509 certificate... ok" |
| 5857 | |
| 5858 | run_test "DTLS client auth: optional, client has no cert" \ |
| 5859 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 5860 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 5861 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5862 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5863 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5864 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5865 | "$P_SRV dtls=1 auth_mode=none" \ |
| 5866 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 5867 | 0 \ |
| 5868 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 5869 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 5870 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 5871 | run_test "DTLS wrong PSK: badmac alert" \ |
| 5872 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 5873 | "$P_CLI dtls=1 psk=abc124" \ |
| 5874 | 1 \ |
| 5875 | -s "SSL - Verification of the message MAC failed" \ |
| 5876 | -c "SSL - A fatal alert message was received from our peer" |
| 5877 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 5878 | # Tests for receiving fragmented handshake messages with DTLS |
| 5879 | |
| 5880 | requires_gnutls |
| 5881 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 5882 | "$G_SRV -u --mtu 2048 -a" \ |
| 5883 | "$P_CLI dtls=1 debug_level=2" \ |
| 5884 | 0 \ |
| 5885 | -C "found fragmented DTLS handshake message" \ |
| 5886 | -C "error" |
| 5887 | |
| 5888 | requires_gnutls |
| 5889 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 5890 | "$G_SRV -u --mtu 512" \ |
| 5891 | "$P_CLI dtls=1 debug_level=2" \ |
| 5892 | 0 \ |
| 5893 | -c "found fragmented DTLS handshake message" \ |
| 5894 | -C "error" |
| 5895 | |
| 5896 | requires_gnutls |
| 5897 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 5898 | "$G_SRV -u --mtu 128" \ |
| 5899 | "$P_CLI dtls=1 debug_level=2" \ |
| 5900 | 0 \ |
| 5901 | -c "found fragmented DTLS handshake message" \ |
| 5902 | -C "error" |
| 5903 | |
| 5904 | requires_gnutls |
| 5905 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 5906 | "$G_SRV -u --mtu 128" \ |
| 5907 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 5908 | 0 \ |
| 5909 | -c "found fragmented DTLS handshake message" \ |
| 5910 | -C "error" |
| 5911 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 5912 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5913 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 5914 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 5915 | "$G_SRV -u --mtu 256" \ |
| 5916 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 5917 | 0 \ |
| 5918 | -c "found fragmented DTLS handshake message" \ |
| 5919 | -c "client hello, adding renegotiation extension" \ |
| 5920 | -c "found renegotiation extension" \ |
| 5921 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5922 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 5923 | -C "error" \ |
| 5924 | -s "Extra-header:" |
| 5925 | |
| 5926 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 5927 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 5928 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 5929 | "$G_SRV -u --mtu 256" \ |
| 5930 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 5931 | 0 \ |
| 5932 | -c "found fragmented DTLS handshake message" \ |
| 5933 | -c "client hello, adding renegotiation extension" \ |
| 5934 | -c "found renegotiation extension" \ |
| 5935 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5936 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 5937 | -C "error" \ |
| 5938 | -s "Extra-header:" |
| 5939 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 5940 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 5941 | "$O_SRV -dtls1 -mtu 2048" \ |
| 5942 | "$P_CLI dtls=1 debug_level=2" \ |
| 5943 | 0 \ |
| 5944 | -C "found fragmented DTLS handshake message" \ |
| 5945 | -C "error" |
| 5946 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5947 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 5948 | "$O_SRV -dtls1 -mtu 768" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 5949 | "$P_CLI dtls=1 debug_level=2" \ |
| 5950 | 0 \ |
| 5951 | -c "found fragmented DTLS handshake message" \ |
| 5952 | -C "error" |
| 5953 | |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 5954 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 5955 | "$O_SRV -dtls1 -mtu 256" \ |
| 5956 | "$P_CLI dtls=1 debug_level=2" \ |
| 5957 | 0 \ |
| 5958 | -c "found fragmented DTLS handshake message" \ |
| 5959 | -C "error" |
| 5960 | |
| 5961 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 5962 | "$O_SRV -dtls1 -mtu 256" \ |
| 5963 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 5964 | 0 \ |
| 5965 | -c "found fragmented DTLS handshake message" \ |
| 5966 | -C "error" |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 5967 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5968 | # Tests for sending fragmented handshake messages with DTLS |
| 5969 | # |
| 5970 | # Use client auth when we need the client to send large messages, |
| 5971 | # and use large cert chains on both sides too (the long chains we have all use |
| 5972 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 5973 | # Sizes reached (UDP payload): |
| 5974 | # - 2037B for server certificate |
| 5975 | # - 1542B for client certificate |
| 5976 | # - 1013B for newsessionticket |
| 5977 | # - all others below 512B |
| 5978 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 5979 | |
| 5980 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5981 | requires_config_enabled MBEDTLS_RSA_C |
| 5982 | requires_config_enabled MBEDTLS_ECDSA_C |
| 5983 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 5984 | run_test "DTLS fragmenting: none (for reference)" \ |
| 5985 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 5986 | crt_file=data_files/server7_int-ca.crt \ |
| 5987 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 5988 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5989 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5990 | "$P_CLI dtls=1 debug_level=2 \ |
| 5991 | crt_file=data_files/server8_int-ca2.crt \ |
| 5992 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 5993 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 5994 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 5995 | 0 \ |
| 5996 | -S "found fragmented DTLS handshake message" \ |
| 5997 | -C "found fragmented DTLS handshake message" \ |
| 5998 | -C "error" |
| 5999 | |
| 6000 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6001 | requires_config_enabled MBEDTLS_RSA_C |
| 6002 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6003 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6004 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6005 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6006 | crt_file=data_files/server7_int-ca.crt \ |
| 6007 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6008 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6009 | max_frag_len=1024" \ |
| 6010 | "$P_CLI dtls=1 debug_level=2 \ |
| 6011 | crt_file=data_files/server8_int-ca2.crt \ |
| 6012 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6013 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6014 | max_frag_len=2048" \ |
| 6015 | 0 \ |
| 6016 | -S "found fragmented DTLS handshake message" \ |
| 6017 | -c "found fragmented DTLS handshake message" \ |
| 6018 | -C "error" |
| 6019 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6020 | # With the MFL extension, the server has no way of forcing |
| 6021 | # the client to not exceed a certain MTU; hence, the following |
| 6022 | # test can't be replicated with an MTU proxy such as the one |
| 6023 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6024 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6025 | requires_config_enabled MBEDTLS_RSA_C |
| 6026 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6027 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6028 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6029 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6030 | crt_file=data_files/server7_int-ca.crt \ |
| 6031 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6032 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6033 | max_frag_len=512" \ |
| 6034 | "$P_CLI dtls=1 debug_level=2 \ |
| 6035 | crt_file=data_files/server8_int-ca2.crt \ |
| 6036 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6037 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6038 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6039 | 0 \ |
| 6040 | -S "found fragmented DTLS handshake message" \ |
| 6041 | -c "found fragmented DTLS handshake message" \ |
| 6042 | -C "error" |
| 6043 | |
| 6044 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6045 | requires_config_enabled MBEDTLS_RSA_C |
| 6046 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6047 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6048 | 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] | 6049 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6050 | crt_file=data_files/server7_int-ca.crt \ |
| 6051 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6052 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6053 | max_frag_len=2048" \ |
| 6054 | "$P_CLI dtls=1 debug_level=2 \ |
| 6055 | crt_file=data_files/server8_int-ca2.crt \ |
| 6056 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6057 | hs_timeout=2500-60000 \ |
| 6058 | max_frag_len=1024" \ |
| 6059 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6060 | -S "found fragmented DTLS handshake message" \ |
| 6061 | -c "found fragmented DTLS handshake message" \ |
| 6062 | -C "error" |
| 6063 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6064 | # While not required by the standard defining the MFL extension |
| 6065 | # (according to which it only applies to records, not to datagrams), |
| 6066 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6067 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6068 | # to the peer. |
| 6069 | # The next test checks that no datagrams significantly larger than the |
| 6070 | # negotiated MFL are sent. |
| 6071 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6072 | requires_config_enabled MBEDTLS_RSA_C |
| 6073 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6074 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6075 | 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] | 6076 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6077 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6078 | crt_file=data_files/server7_int-ca.crt \ |
| 6079 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6080 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6081 | max_frag_len=2048" \ |
| 6082 | "$P_CLI dtls=1 debug_level=2 \ |
| 6083 | crt_file=data_files/server8_int-ca2.crt \ |
| 6084 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6085 | hs_timeout=2500-60000 \ |
| 6086 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6087 | 0 \ |
| 6088 | -S "found fragmented DTLS handshake message" \ |
| 6089 | -c "found fragmented DTLS handshake message" \ |
| 6090 | -C "error" |
| 6091 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6092 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6093 | requires_config_enabled MBEDTLS_RSA_C |
| 6094 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6095 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6096 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6097 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6098 | crt_file=data_files/server7_int-ca.crt \ |
| 6099 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6100 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6101 | max_frag_len=2048" \ |
| 6102 | "$P_CLI dtls=1 debug_level=2 \ |
| 6103 | crt_file=data_files/server8_int-ca2.crt \ |
| 6104 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6105 | hs_timeout=2500-60000 \ |
| 6106 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6107 | 0 \ |
| 6108 | -s "found fragmented DTLS handshake message" \ |
| 6109 | -c "found fragmented DTLS handshake message" \ |
| 6110 | -C "error" |
| 6111 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6112 | # While not required by the standard defining the MFL extension |
| 6113 | # (according to which it only applies to records, not to datagrams), |
| 6114 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6115 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6116 | # to the peer. |
| 6117 | # The next test checks that no datagrams significantly larger than the |
| 6118 | # negotiated MFL are sent. |
| 6119 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6120 | requires_config_enabled MBEDTLS_RSA_C |
| 6121 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6122 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6123 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6124 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6125 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6126 | crt_file=data_files/server7_int-ca.crt \ |
| 6127 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6128 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6129 | max_frag_len=2048" \ |
| 6130 | "$P_CLI dtls=1 debug_level=2 \ |
| 6131 | crt_file=data_files/server8_int-ca2.crt \ |
| 6132 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6133 | hs_timeout=2500-60000 \ |
| 6134 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6135 | 0 \ |
| 6136 | -s "found fragmented DTLS handshake message" \ |
| 6137 | -c "found fragmented DTLS handshake message" \ |
| 6138 | -C "error" |
| 6139 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6140 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6141 | requires_config_enabled MBEDTLS_RSA_C |
| 6142 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6143 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6144 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6145 | crt_file=data_files/server7_int-ca.crt \ |
| 6146 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6147 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6148 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6149 | "$P_CLI dtls=1 debug_level=2 \ |
| 6150 | crt_file=data_files/server8_int-ca2.crt \ |
| 6151 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6152 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6153 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6154 | 0 \ |
| 6155 | -S "found fragmented DTLS handshake message" \ |
| 6156 | -C "found fragmented DTLS handshake message" \ |
| 6157 | -C "error" |
| 6158 | |
| 6159 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6160 | requires_config_enabled MBEDTLS_RSA_C |
| 6161 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6162 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6163 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6164 | crt_file=data_files/server7_int-ca.crt \ |
| 6165 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6166 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6167 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6168 | "$P_CLI dtls=1 debug_level=2 \ |
| 6169 | crt_file=data_files/server8_int-ca2.crt \ |
| 6170 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6171 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6172 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6173 | 0 \ |
| 6174 | -s "found fragmented DTLS handshake message" \ |
| 6175 | -C "found fragmented DTLS handshake message" \ |
| 6176 | -C "error" |
| 6177 | |
| 6178 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6179 | requires_config_enabled MBEDTLS_RSA_C |
| 6180 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6181 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6182 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6183 | crt_file=data_files/server7_int-ca.crt \ |
| 6184 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6185 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6186 | mtu=512" \ |
| 6187 | "$P_CLI dtls=1 debug_level=2 \ |
| 6188 | crt_file=data_files/server8_int-ca2.crt \ |
| 6189 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6190 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6191 | mtu=2048" \ |
| 6192 | 0 \ |
| 6193 | -S "found fragmented DTLS handshake message" \ |
| 6194 | -c "found fragmented DTLS handshake message" \ |
| 6195 | -C "error" |
| 6196 | |
| 6197 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6198 | requires_config_enabled MBEDTLS_RSA_C |
| 6199 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6200 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6201 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6202 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6203 | crt_file=data_files/server7_int-ca.crt \ |
| 6204 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6205 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6206 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6207 | "$P_CLI dtls=1 debug_level=2 \ |
| 6208 | crt_file=data_files/server8_int-ca2.crt \ |
| 6209 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6210 | hs_timeout=2500-60000 \ |
| 6211 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6212 | 0 \ |
| 6213 | -s "found fragmented DTLS handshake message" \ |
| 6214 | -c "found fragmented DTLS handshake message" \ |
| 6215 | -C "error" |
| 6216 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6217 | # 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] | 6218 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6219 | requires_config_enabled MBEDTLS_RSA_C |
| 6220 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6221 | requires_config_enabled MBEDTLS_SHA256_C |
| 6222 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6223 | requires_config_enabled MBEDTLS_AES_C |
| 6224 | requires_config_enabled MBEDTLS_GCM_C |
| 6225 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6226 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6227 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6228 | crt_file=data_files/server7_int-ca.crt \ |
| 6229 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6230 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6231 | mtu=512" \ |
| 6232 | "$P_CLI dtls=1 debug_level=2 \ |
| 6233 | crt_file=data_files/server8_int-ca2.crt \ |
| 6234 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6235 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6236 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6237 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6238 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6239 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6240 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6241 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6242 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6243 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6244 | # 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] | 6245 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 6246 | # retransmissions, but in some cases (like both the server and client using |
| 6247 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 6248 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 6249 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6250 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6251 | requires_config_enabled MBEDTLS_RSA_C |
| 6252 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6253 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6254 | requires_config_enabled MBEDTLS_AES_C |
| 6255 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6256 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6257 | -p "$P_PXY mtu=508" \ |
| 6258 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6259 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6260 | key_file=data_files/server7.key \ |
| 6261 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6262 | "$P_CLI dtls=1 debug_level=2 \ |
| 6263 | crt_file=data_files/server8_int-ca2.crt \ |
| 6264 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6265 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6266 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6267 | 0 \ |
| 6268 | -s "found fragmented DTLS handshake message" \ |
| 6269 | -c "found fragmented DTLS handshake message" \ |
| 6270 | -C "error" |
| 6271 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6272 | # 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] | 6273 | only_with_valgrind |
| 6274 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6275 | requires_config_enabled MBEDTLS_RSA_C |
| 6276 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6277 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6278 | requires_config_enabled MBEDTLS_AES_C |
| 6279 | requires_config_enabled MBEDTLS_GCM_C |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6280 | run_test "DTLS fragmenting: proxy MTU: auto-reduction" \ |
| 6281 | -p "$P_PXY mtu=508" \ |
| 6282 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6283 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6284 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6285 | hs_timeout=250-10000" \ |
| 6286 | "$P_CLI dtls=1 debug_level=2 \ |
| 6287 | crt_file=data_files/server8_int-ca2.crt \ |
| 6288 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6289 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6290 | hs_timeout=250-10000" \ |
| 6291 | 0 \ |
| 6292 | -s "found fragmented DTLS handshake message" \ |
| 6293 | -c "found fragmented DTLS handshake message" \ |
| 6294 | -C "error" |
| 6295 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6296 | # 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] | 6297 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6298 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6299 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6300 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6301 | requires_config_enabled MBEDTLS_RSA_C |
| 6302 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6303 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6304 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6305 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6306 | crt_file=data_files/server7_int-ca.crt \ |
| 6307 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6308 | hs_timeout=10000-60000 \ |
| 6309 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6310 | "$P_CLI dtls=1 debug_level=2 \ |
| 6311 | crt_file=data_files/server8_int-ca2.crt \ |
| 6312 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6313 | hs_timeout=10000-60000 \ |
| 6314 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6315 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6316 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6317 | -s "found fragmented DTLS handshake message" \ |
| 6318 | -c "found fragmented DTLS handshake message" \ |
| 6319 | -C "error" |
| 6320 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6321 | # 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] | 6322 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 6323 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6324 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6325 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6326 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6327 | requires_config_enabled MBEDTLS_RSA_C |
| 6328 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6329 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6330 | requires_config_enabled MBEDTLS_AES_C |
| 6331 | requires_config_enabled MBEDTLS_GCM_C |
| 6332 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6333 | -p "$P_PXY mtu=512" \ |
| 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 | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6337 | hs_timeout=10000-60000 \ |
| 6338 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +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 | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6342 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6343 | hs_timeout=10000-60000 \ |
| 6344 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6345 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6346 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6347 | -s "found fragmented DTLS handshake message" \ |
| 6348 | -c "found fragmented DTLS handshake message" \ |
| 6349 | -C "error" |
| 6350 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6351 | not_with_valgrind # spurious autoreduction due to timeout |
| 6352 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6353 | requires_config_enabled MBEDTLS_RSA_C |
| 6354 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6355 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6356 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6357 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6358 | crt_file=data_files/server7_int-ca.crt \ |
| 6359 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6360 | hs_timeout=10000-60000 \ |
| 6361 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6362 | "$P_CLI dtls=1 debug_level=2 \ |
| 6363 | crt_file=data_files/server8_int-ca2.crt \ |
| 6364 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6365 | hs_timeout=10000-60000 \ |
| 6366 | mtu=1024 nbio=2" \ |
| 6367 | 0 \ |
| 6368 | -S "autoreduction" \ |
| 6369 | -s "found fragmented DTLS handshake message" \ |
| 6370 | -c "found fragmented DTLS handshake message" \ |
| 6371 | -C "error" |
| 6372 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6373 | # 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] | 6374 | not_with_valgrind # spurious autoreduction due to timeout |
| 6375 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6376 | requires_config_enabled MBEDTLS_RSA_C |
| 6377 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6378 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6379 | requires_config_enabled MBEDTLS_AES_C |
| 6380 | requires_config_enabled MBEDTLS_GCM_C |
| 6381 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 6382 | -p "$P_PXY mtu=512" \ |
| 6383 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6384 | crt_file=data_files/server7_int-ca.crt \ |
| 6385 | key_file=data_files/server7.key \ |
| 6386 | hs_timeout=10000-60000 \ |
| 6387 | mtu=512 nbio=2" \ |
| 6388 | "$P_CLI dtls=1 debug_level=2 \ |
| 6389 | crt_file=data_files/server8_int-ca2.crt \ |
| 6390 | key_file=data_files/server8.key \ |
| 6391 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6392 | hs_timeout=10000-60000 \ |
| 6393 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6394 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6395 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6396 | -s "found fragmented DTLS handshake message" \ |
| 6397 | -c "found fragmented DTLS handshake message" \ |
| 6398 | -C "error" |
| 6399 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6400 | # 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] | 6401 | # This ensures things still work after session_reset(). |
| 6402 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6403 | # Since we don't support reading fragmented ClientHello yet, |
| 6404 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 6405 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6406 | # An autoreduction on the client-side might happen if the server is |
| 6407 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6408 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6409 | # resumed listening, which would result in a spurious autoreduction. |
| 6410 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6411 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6412 | requires_config_enabled MBEDTLS_RSA_C |
| 6413 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6414 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6415 | requires_config_enabled MBEDTLS_AES_C |
| 6416 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6417 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 6418 | -p "$P_PXY mtu=1450" \ |
| 6419 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6420 | crt_file=data_files/server7_int-ca.crt \ |
| 6421 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6422 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6423 | mtu=1450" \ |
| 6424 | "$P_CLI dtls=1 debug_level=2 \ |
| 6425 | crt_file=data_files/server8_int-ca2.crt \ |
| 6426 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6427 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6428 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 498e632 | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 6429 | 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] | 6430 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6431 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6432 | -s "found fragmented DTLS handshake message" \ |
| 6433 | -c "found fragmented DTLS handshake message" \ |
| 6434 | -C "error" |
| 6435 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6436 | # An autoreduction on the client-side might happen if the server is |
| 6437 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6438 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6439 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6440 | requires_config_enabled MBEDTLS_RSA_C |
| 6441 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6442 | requires_config_enabled MBEDTLS_SHA256_C |
| 6443 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6444 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6445 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 6446 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 6447 | -p "$P_PXY mtu=512" \ |
| 6448 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6449 | crt_file=data_files/server7_int-ca.crt \ |
| 6450 | key_file=data_files/server7.key \ |
| 6451 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6452 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6453 | mtu=512" \ |
| 6454 | "$P_CLI dtls=1 debug_level=2 \ |
| 6455 | crt_file=data_files/server8_int-ca2.crt \ |
| 6456 | key_file=data_files/server8.key \ |
| 6457 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6458 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6459 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6460 | mtu=512" \ |
| 6461 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6462 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6463 | -s "found fragmented DTLS handshake message" \ |
| 6464 | -c "found fragmented DTLS handshake message" \ |
| 6465 | -C "error" |
| 6466 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6467 | # An autoreduction on the client-side might happen if the server is |
| 6468 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6469 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6470 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6471 | requires_config_enabled MBEDTLS_RSA_C |
| 6472 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6473 | requires_config_enabled MBEDTLS_SHA256_C |
| 6474 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6475 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6476 | requires_config_enabled MBEDTLS_AES_C |
| 6477 | requires_config_enabled MBEDTLS_GCM_C |
| 6478 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 6479 | -p "$P_PXY mtu=512" \ |
| 6480 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6481 | crt_file=data_files/server7_int-ca.crt \ |
| 6482 | key_file=data_files/server7.key \ |
| 6483 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6484 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6485 | mtu=512" \ |
| 6486 | "$P_CLI dtls=1 debug_level=2 \ |
| 6487 | crt_file=data_files/server8_int-ca2.crt \ |
| 6488 | key_file=data_files/server8.key \ |
| 6489 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6490 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6491 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6492 | mtu=512" \ |
| 6493 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6494 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6495 | -s "found fragmented DTLS handshake message" \ |
| 6496 | -c "found fragmented DTLS handshake message" \ |
| 6497 | -C "error" |
| 6498 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6499 | # An autoreduction on the client-side might happen if the server is |
| 6500 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6501 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6502 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6503 | requires_config_enabled MBEDTLS_RSA_C |
| 6504 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6505 | requires_config_enabled MBEDTLS_SHA256_C |
| 6506 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6507 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6508 | requires_config_enabled MBEDTLS_AES_C |
| 6509 | requires_config_enabled MBEDTLS_CCM_C |
| 6510 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6511 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 \ |
| 6515 | exchanges=2 renegotiation=1 \ |
| 6516 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6517 | hs_timeout=10000-60000 \ |
| 6518 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6519 | "$P_CLI dtls=1 debug_level=2 \ |
| 6520 | crt_file=data_files/server8_int-ca2.crt \ |
| 6521 | key_file=data_files/server8.key \ |
| 6522 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6523 | hs_timeout=10000-60000 \ |
| 6524 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6525 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6526 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6527 | -s "found fragmented DTLS handshake message" \ |
| 6528 | -c "found fragmented DTLS handshake message" \ |
| 6529 | -C "error" |
| 6530 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6531 | # An autoreduction on the client-side might happen if the server is |
| 6532 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6533 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6534 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6535 | requires_config_enabled MBEDTLS_RSA_C |
| 6536 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6537 | requires_config_enabled MBEDTLS_SHA256_C |
| 6538 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6539 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6540 | requires_config_enabled MBEDTLS_AES_C |
| 6541 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6542 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 6543 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6544 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6545 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6546 | crt_file=data_files/server7_int-ca.crt \ |
| 6547 | key_file=data_files/server7.key \ |
| 6548 | exchanges=2 renegotiation=1 \ |
| 6549 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6550 | hs_timeout=10000-60000 \ |
| 6551 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6552 | "$P_CLI dtls=1 debug_level=2 \ |
| 6553 | crt_file=data_files/server8_int-ca2.crt \ |
| 6554 | key_file=data_files/server8.key \ |
| 6555 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6556 | hs_timeout=10000-60000 \ |
| 6557 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6558 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6559 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6560 | -s "found fragmented DTLS handshake message" \ |
| 6561 | -c "found fragmented DTLS handshake message" \ |
| 6562 | -C "error" |
| 6563 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6564 | # An autoreduction on the client-side might happen if the server is |
| 6565 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6566 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6567 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6568 | requires_config_enabled MBEDTLS_RSA_C |
| 6569 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6570 | requires_config_enabled MBEDTLS_SHA256_C |
| 6571 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6572 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6573 | requires_config_enabled MBEDTLS_AES_C |
| 6574 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6575 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6576 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6577 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6578 | crt_file=data_files/server7_int-ca.crt \ |
| 6579 | key_file=data_files/server7.key \ |
| 6580 | exchanges=2 renegotiation=1 \ |
| 6581 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6582 | hs_timeout=10000-60000 \ |
| 6583 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6584 | "$P_CLI dtls=1 debug_level=2 \ |
| 6585 | crt_file=data_files/server8_int-ca2.crt \ |
| 6586 | key_file=data_files/server8.key \ |
| 6587 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6588 | hs_timeout=10000-60000 \ |
| 6589 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6590 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6591 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6592 | -s "found fragmented DTLS handshake message" \ |
| 6593 | -c "found fragmented DTLS handshake message" \ |
| 6594 | -C "error" |
| 6595 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6596 | # 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] | 6597 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6598 | requires_config_enabled MBEDTLS_RSA_C |
| 6599 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6600 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6601 | requires_config_enabled MBEDTLS_AES_C |
| 6602 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6603 | client_needs_more_time 2 |
| 6604 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 6605 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6606 | "$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] | 6607 | crt_file=data_files/server7_int-ca.crt \ |
| 6608 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6609 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6610 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6611 | crt_file=data_files/server8_int-ca2.crt \ |
| 6612 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6613 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6614 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 6615 | 0 \ |
| 6616 | -s "found fragmented DTLS handshake message" \ |
| 6617 | -c "found fragmented DTLS handshake message" \ |
| 6618 | -C "error" |
| 6619 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6620 | # 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] | 6621 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6622 | requires_config_enabled MBEDTLS_RSA_C |
| 6623 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6624 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6625 | requires_config_enabled MBEDTLS_AES_C |
| 6626 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6627 | client_needs_more_time 2 |
| 6628 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 6629 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 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 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6634 | "$P_CLI dtls=1 debug_level=2 \ |
| 6635 | crt_file=data_files/server8_int-ca2.crt \ |
| 6636 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6637 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6638 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 6639 | 0 \ |
| 6640 | -s "found fragmented DTLS handshake message" \ |
| 6641 | -c "found fragmented DTLS handshake message" \ |
| 6642 | -C "error" |
| 6643 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6644 | # interop tests for DTLS fragmentating with reliable connection |
| 6645 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6646 | # here and below we just want to test that the we fragment in a way that |
| 6647 | # pleases other implementations, so we don't need the peer to fragment |
| 6648 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6649 | requires_config_enabled MBEDTLS_RSA_C |
| 6650 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6651 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6652 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6653 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 6654 | "$G_SRV -u" \ |
| 6655 | "$P_CLI dtls=1 debug_level=2 \ |
| 6656 | crt_file=data_files/server8_int-ca2.crt \ |
| 6657 | key_file=data_files/server8.key \ |
| 6658 | mtu=512 force_version=dtls1_2" \ |
| 6659 | 0 \ |
| 6660 | -c "fragmenting handshake message" \ |
| 6661 | -C "error" |
| 6662 | |
| 6663 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6664 | requires_config_enabled MBEDTLS_RSA_C |
| 6665 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6666 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6667 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6668 | run_test "DTLS fragmenting: gnutls server, DTLS 1.0" \ |
| 6669 | "$G_SRV -u" \ |
| 6670 | "$P_CLI dtls=1 debug_level=2 \ |
| 6671 | crt_file=data_files/server8_int-ca2.crt \ |
| 6672 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6673 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6674 | 0 \ |
| 6675 | -c "fragmenting handshake message" \ |
| 6676 | -C "error" |
| 6677 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6678 | # We use --insecure for the GnuTLS client because it expects |
| 6679 | # the hostname / IP it connects to to be the name used in the |
| 6680 | # certificate obtained from the server. Here, however, it |
| 6681 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 6682 | # as the server name in the certificate. This will make the |
| 6683 | # certifiate validation fail, but passing --insecure makes |
| 6684 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +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_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6689 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6690 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6691 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6692 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6693 | crt_file=data_files/server7_int-ca.crt \ |
| 6694 | key_file=data_files/server7.key \ |
| 6695 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6696 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6697 | 0 \ |
| 6698 | -s "fragmenting handshake message" |
| 6699 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 6700 | # See previous test for the reason to use --insecure |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6701 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6702 | requires_config_enabled MBEDTLS_RSA_C |
| 6703 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6704 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 6705 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 6706 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6707 | run_test "DTLS fragmenting: gnutls client, DTLS 1.0" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6708 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6709 | crt_file=data_files/server7_int-ca.crt \ |
| 6710 | key_file=data_files/server7.key \ |
| 6711 | mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 6712 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 6713 | 0 \ |
| 6714 | -s "fragmenting handshake message" |
| 6715 | |
| 6716 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6717 | requires_config_enabled MBEDTLS_RSA_C |
| 6718 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6719 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6720 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 6721 | "$O_SRV -dtls1_2 -verify 10" \ |
| 6722 | "$P_CLI dtls=1 debug_level=2 \ |
| 6723 | crt_file=data_files/server8_int-ca2.crt \ |
| 6724 | key_file=data_files/server8.key \ |
| 6725 | mtu=512 force_version=dtls1_2" \ |
| 6726 | 0 \ |
| 6727 | -c "fragmenting handshake message" \ |
| 6728 | -C "error" |
| 6729 | |
| 6730 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6731 | requires_config_enabled MBEDTLS_RSA_C |
| 6732 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6733 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6734 | run_test "DTLS fragmenting: openssl server, DTLS 1.0" \ |
| 6735 | "$O_SRV -dtls1 -verify 10" \ |
| 6736 | "$P_CLI dtls=1 debug_level=2 \ |
| 6737 | crt_file=data_files/server8_int-ca2.crt \ |
| 6738 | key_file=data_files/server8.key \ |
| 6739 | mtu=512 force_version=dtls1" \ |
| 6740 | 0 \ |
| 6741 | -c "fragmenting handshake message" \ |
| 6742 | -C "error" |
| 6743 | |
| 6744 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6745 | requires_config_enabled MBEDTLS_RSA_C |
| 6746 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6747 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6748 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 6749 | "$P_SRV dtls=1 debug_level=2 \ |
| 6750 | crt_file=data_files/server7_int-ca.crt \ |
| 6751 | key_file=data_files/server7.key \ |
| 6752 | mtu=512 force_version=dtls1_2" \ |
| 6753 | "$O_CLI -dtls1_2" \ |
| 6754 | 0 \ |
| 6755 | -s "fragmenting handshake message" |
| 6756 | |
| 6757 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6758 | requires_config_enabled MBEDTLS_RSA_C |
| 6759 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6760 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6761 | run_test "DTLS fragmenting: openssl client, DTLS 1.0" \ |
| 6762 | "$P_SRV dtls=1 debug_level=2 \ |
| 6763 | crt_file=data_files/server7_int-ca.crt \ |
| 6764 | key_file=data_files/server7.key \ |
| 6765 | mtu=512 force_version=dtls1" \ |
| 6766 | "$O_CLI -dtls1" \ |
| 6767 | 0 \ |
| 6768 | -s "fragmenting handshake message" |
| 6769 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6770 | # interop tests for DTLS fragmentating with unreliable connection |
| 6771 | # |
| 6772 | # again we just want to test that the we fragment in a way that |
| 6773 | # pleases other implementations, so we don't need the peer to fragment |
| 6774 | requires_gnutls_next |
| 6775 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6776 | requires_config_enabled MBEDTLS_RSA_C |
| 6777 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6778 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6779 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6780 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 6781 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6782 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6783 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6784 | crt_file=data_files/server8_int-ca2.crt \ |
| 6785 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6786 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6787 | 0 \ |
| 6788 | -c "fragmenting handshake message" \ |
| 6789 | -C "error" |
| 6790 | |
| 6791 | requires_gnutls_next |
| 6792 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6793 | requires_config_enabled MBEDTLS_RSA_C |
| 6794 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6795 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6796 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6797 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ |
| 6798 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6799 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6800 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6801 | crt_file=data_files/server8_int-ca2.crt \ |
| 6802 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6803 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6804 | 0 \ |
| 6805 | -c "fragmenting handshake message" \ |
| 6806 | -C "error" |
| 6807 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6808 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6809 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6810 | requires_config_enabled MBEDTLS_RSA_C |
| 6811 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6812 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6813 | client_needs_more_time 4 |
| 6814 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 6815 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6816 | "$P_SRV dtls=1 debug_level=2 \ |
| 6817 | crt_file=data_files/server7_int-ca.crt \ |
| 6818 | key_file=data_files/server7.key \ |
| 6819 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6820 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6821 | 0 \ |
| 6822 | -s "fragmenting handshake message" |
| 6823 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6824 | requires_gnutls_next |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6825 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6826 | requires_config_enabled MBEDTLS_RSA_C |
| 6827 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6828 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
| 6829 | client_needs_more_time 4 |
| 6830 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ |
| 6831 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6832 | "$P_SRV dtls=1 debug_level=2 \ |
| 6833 | crt_file=data_files/server7_int-ca.crt \ |
| 6834 | key_file=data_files/server7.key \ |
| 6835 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 6836 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 6837 | 0 \ |
| 6838 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6839 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6840 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 6841 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6842 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6843 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 6844 | ## (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] | 6845 | skip_next_test |
| 6846 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6847 | requires_config_enabled MBEDTLS_RSA_C |
| 6848 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6849 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6850 | client_needs_more_time 4 |
| 6851 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 6852 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6853 | "$O_SRV -dtls1_2 -verify 10" \ |
| 6854 | "$P_CLI dtls=1 debug_level=2 \ |
| 6855 | crt_file=data_files/server8_int-ca2.crt \ |
| 6856 | key_file=data_files/server8.key \ |
| 6857 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 6858 | 0 \ |
| 6859 | -c "fragmenting handshake message" \ |
| 6860 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6861 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6862 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6863 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6864 | requires_config_enabled MBEDTLS_RSA_C |
| 6865 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6866 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6867 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6868 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ |
| 6869 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6870 | "$O_SRV -dtls1 -verify 10" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6871 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6872 | crt_file=data_files/server8_int-ca2.crt \ |
| 6873 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6874 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6875 | 0 \ |
| 6876 | -c "fragmenting handshake message" \ |
| 6877 | -C "error" |
| 6878 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6879 | skip_next_test |
| 6880 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6881 | requires_config_enabled MBEDTLS_RSA_C |
| 6882 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6883 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 6884 | client_needs_more_time 4 |
| 6885 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 6886 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 6887 | "$P_SRV dtls=1 debug_level=2 \ |
| 6888 | crt_file=data_files/server7_int-ca.crt \ |
| 6889 | key_file=data_files/server7.key \ |
| 6890 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 6891 | "$O_CLI -dtls1_2" \ |
| 6892 | 0 \ |
| 6893 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6894 | |
| 6895 | # -nbio is added to prevent s_client from blocking in case of duplicated |
| 6896 | # messages at the end of the handshake |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6897 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6898 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6899 | requires_config_enabled MBEDTLS_RSA_C |
| 6900 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6901 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6902 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6903 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ |
| 6904 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6905 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6906 | crt_file=data_files/server7_int-ca.crt \ |
| 6907 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 6908 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 6909 | "$O_CLI -nbio -dtls1" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 6910 | 0 \ |
| 6911 | -s "fragmenting handshake message" |
| 6912 | |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 6913 | # Tests for specific things with "unreliable" UDP connection |
| 6914 | |
| 6915 | not_with_valgrind # spurious resend due to timeout |
| 6916 | run_test "DTLS proxy: reference" \ |
| 6917 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6918 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 6919 | "$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] | 6920 | 0 \ |
| 6921 | -C "replayed record" \ |
| 6922 | -S "replayed record" \ |
| 6923 | -C "record from another epoch" \ |
| 6924 | -S "record from another epoch" \ |
| 6925 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 6926 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 6927 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 6928 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 6929 | -c "HTTP/1.0 200 OK" |
| 6930 | |
| 6931 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 6932 | run_test "DTLS proxy: duplicate every packet" \ |
| 6933 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | 34cbf10 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6934 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 6935 | "$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] | 6936 | 0 \ |
| 6937 | -c "replayed record" \ |
| 6938 | -s "replayed record" \ |
| 6939 | -c "record from another epoch" \ |
| 6940 | -s "record from another epoch" \ |
| 6941 | -S "resend" \ |
| 6942 | -s "Extra-header:" \ |
| 6943 | -c "HTTP/1.0 200 OK" |
| 6944 | |
| 6945 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 6946 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6947 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 6948 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6949 | 0 \ |
| 6950 | -c "replayed record" \ |
| 6951 | -S "replayed record" \ |
| 6952 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6953 | -s "record from another epoch" \ |
| 6954 | -c "resend" \ |
| 6955 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6956 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6957 | -c "HTTP/1.0 200 OK" |
| 6958 | |
| 6959 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 6960 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6961 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 6962 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6963 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6964 | -c "next record in same datagram" \ |
| 6965 | -s "next record in same datagram" |
| 6966 | |
| 6967 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 6968 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6969 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 6970 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6971 | 0 \ |
| 6972 | -c "next record in same datagram" \ |
| 6973 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6974 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6975 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 6976 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6977 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 6978 | "$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] | 6979 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6980 | -c "discarding invalid record (mac)" \ |
| 6981 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6982 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6983 | -c "HTTP/1.0 200 OK" \ |
| 6984 | -S "too many records with bad MAC" \ |
| 6985 | -S "Verification of the message MAC failed" |
| 6986 | |
| 6987 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 6988 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 6989 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 6990 | "$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] | 6991 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6992 | -C "discarding invalid record (mac)" \ |
| 6993 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6994 | -S "Extra-header:" \ |
| 6995 | -C "HTTP/1.0 200 OK" \ |
| 6996 | -s "too many records with bad MAC" \ |
| 6997 | -s "Verification of the message MAC failed" |
| 6998 | |
| 6999 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 7000 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7001 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 7002 | "$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] | 7003 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7004 | -c "discarding invalid record (mac)" \ |
| 7005 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7006 | -s "Extra-header:" \ |
| 7007 | -c "HTTP/1.0 200 OK" \ |
| 7008 | -S "too many records with bad MAC" \ |
| 7009 | -S "Verification of the message MAC failed" |
| 7010 | |
| 7011 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 7012 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7013 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 7014 | "$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] | 7015 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7016 | -c "discarding invalid record (mac)" \ |
| 7017 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7018 | -s "Extra-header:" \ |
| 7019 | -c "HTTP/1.0 200 OK" \ |
| 7020 | -s "too many records with bad MAC" \ |
| 7021 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7022 | |
| 7023 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 7024 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 7025 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 7026 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7027 | 0 \ |
| 7028 | -c "record from another epoch" \ |
| 7029 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7030 | -s "Extra-header:" \ |
| 7031 | -c "HTTP/1.0 200 OK" |
| 7032 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7033 | # Tests for reordering support with DTLS |
| 7034 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7035 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 7036 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7037 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7038 | hs_timeout=2500-60000" \ |
| 7039 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7040 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7041 | 0 \ |
| 7042 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7043 | -c "Next handshake message has been buffered - load"\ |
| 7044 | -S "Buffering HS message" \ |
| 7045 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7046 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7047 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7048 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7049 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7050 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7051 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 7052 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7053 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7054 | hs_timeout=2500-60000" \ |
| 7055 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7056 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7057 | 0 \ |
| 7058 | -c "Buffering HS message" \ |
| 7059 | -c "found fragmented DTLS handshake message"\ |
| 7060 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 7061 | -c "Next handshake message has been buffered - load"\ |
| 7062 | -S "Buffering HS message" \ |
| 7063 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7064 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7065 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7066 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7067 | -S "Remember CCS message" |
| 7068 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7069 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 7070 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 7071 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 7072 | # while keeping the ServerKeyExchange. |
| 7073 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 7074 | 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] | 7075 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7076 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7077 | hs_timeout=2500-60000" \ |
| 7078 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7079 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7080 | 0 \ |
| 7081 | -c "Buffering HS message" \ |
| 7082 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7083 | -C "attempt to make space by freeing buffered messages" \ |
| 7084 | -S "Buffering HS message" \ |
| 7085 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7086 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7087 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7088 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7089 | -S "Remember CCS message" |
| 7090 | |
| 7091 | # The size constraints ensure that the delayed certificate message can't |
| 7092 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 7093 | # when dropping it first. |
| 7094 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 7095 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 7096 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 7097 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7098 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7099 | hs_timeout=2500-60000" \ |
| 7100 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7101 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7102 | 0 \ |
| 7103 | -c "Buffering HS message" \ |
| 7104 | -c "attempt to make space by freeing buffered future messages" \ |
| 7105 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7106 | -S "Buffering HS message" \ |
| 7107 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7108 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7109 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7110 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 7111 | -S "Remember CCS message" |
| 7112 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7113 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 7114 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7115 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 7116 | hs_timeout=2500-60000" \ |
| 7117 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7118 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7119 | 0 \ |
| 7120 | -C "Buffering HS message" \ |
| 7121 | -C "Next handshake message has been buffered - load"\ |
| 7122 | -s "Buffering HS message" \ |
| 7123 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7124 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7125 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7126 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7127 | -S "Remember CCS message" |
| 7128 | |
| 7129 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 7130 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7131 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7132 | hs_timeout=2500-60000" \ |
| 7133 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7134 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7135 | 0 \ |
| 7136 | -C "Buffering HS message" \ |
| 7137 | -C "Next handshake message has been buffered - load"\ |
| 7138 | -S "Buffering HS message" \ |
| 7139 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7140 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7141 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7142 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7143 | -S "Remember CCS message" |
| 7144 | |
| 7145 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 7146 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7147 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7148 | hs_timeout=2500-60000" \ |
| 7149 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7150 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7151 | 0 \ |
| 7152 | -C "Buffering HS message" \ |
| 7153 | -C "Next handshake message has been buffered - load"\ |
| 7154 | -S "Buffering HS message" \ |
| 7155 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7156 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7157 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7158 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7159 | -s "Remember CCS message" |
| 7160 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7161 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7162 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7163 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7164 | hs_timeout=2500-60000" \ |
| 7165 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7166 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 7167 | 0 \ |
| 7168 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7169 | -s "Found buffered record from current epoch - load" \ |
| 7170 | -c "Buffer record from epoch 1" \ |
| 7171 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7172 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 7173 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 7174 | # from the server are delayed, so that the encrypted Finished message |
| 7175 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 7176 | # in afterwards, the encrypted Finished message must be freed in order |
| 7177 | # to make space for the NewSessionTicket to be reassembled. |
| 7178 | # This works only in very particular circumstances: |
| 7179 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 7180 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 7181 | # the encrypted Finished message. |
| 7182 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 7183 | # needs to be fragmented. |
| 7184 | # - All messages sent by the server must be small enough to be either sent |
| 7185 | # without fragmentation or be reassembled within the bounds of |
| 7186 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 7187 | # handshake, omitting CRTs. |
| 7188 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 240 |
| 7189 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 280 |
| 7190 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 7191 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ |
| 7192 | "$P_SRV mtu=190 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ |
| 7193 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 7194 | 0 \ |
| 7195 | -s "Buffer record from epoch 1" \ |
| 7196 | -s "Found buffered record from current epoch - load" \ |
| 7197 | -c "Buffer record from epoch 1" \ |
| 7198 | -C "Found buffered record from current epoch - load" \ |
| 7199 | -c "Enough space available after freeing future epoch record" |
| 7200 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 7201 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 7202 | |
| 7203 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7204 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 7205 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7206 | "$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] | 7207 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7208 | "$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] | 7209 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7210 | 0 \ |
| 7211 | -s "Extra-header:" \ |
| 7212 | -c "HTTP/1.0 200 OK" |
| 7213 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7214 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7215 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 7216 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7217 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7218 | "$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] | 7219 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 7220 | 0 \ |
| 7221 | -s "Extra-header:" \ |
| 7222 | -c "HTTP/1.0 200 OK" |
| 7223 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7224 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7225 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 7226 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7227 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 7228 | "$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] | 7229 | 0 \ |
| 7230 | -s "Extra-header:" \ |
| 7231 | -c "HTTP/1.0 200 OK" |
| 7232 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7233 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7234 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 7235 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7236 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 7237 | "$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] | 7238 | 0 \ |
| 7239 | -s "Extra-header:" \ |
| 7240 | -c "HTTP/1.0 200 OK" |
| 7241 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7242 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7243 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 7244 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7245 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 7246 | "$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] | 7247 | 0 \ |
| 7248 | -s "Extra-header:" \ |
| 7249 | -c "HTTP/1.0 200 OK" |
| 7250 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7251 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 7252 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 7253 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7254 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 7255 | "$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] | 7256 | 0 \ |
| 7257 | -s "Extra-header:" \ |
| 7258 | -c "HTTP/1.0 200 OK" |
| 7259 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7260 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7261 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 7262 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7263 | "$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] | 7264 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7265 | "$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] | 7266 | 0 \ |
| 7267 | -s "Extra-header:" \ |
| 7268 | -c "HTTP/1.0 200 OK" |
| 7269 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7270 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 7271 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 7272 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7273 | "$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] | 7274 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7275 | "$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] | 7276 | 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] | 7277 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7278 | 0 \ |
| 7279 | -s "a session has been resumed" \ |
| 7280 | -c "a session has been resumed" \ |
| 7281 | -s "Extra-header:" \ |
| 7282 | -c "HTTP/1.0 200 OK" |
| 7283 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7284 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 7285 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 7286 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7287 | "$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] | 7288 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7289 | "$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] | 7290 | 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] | 7291 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 7292 | 0 \ |
| 7293 | -s "a session has been resumed" \ |
| 7294 | -c "a session has been resumed" \ |
| 7295 | -s "Extra-header:" \ |
| 7296 | -c "HTTP/1.0 200 OK" |
| 7297 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7298 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7299 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7300 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7301 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7302 | "$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] | 7303 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7304 | "$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] | 7305 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 7306 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7307 | 0 \ |
| 7308 | -c "=> renegotiate" \ |
| 7309 | -s "=> renegotiate" \ |
| 7310 | -s "Extra-header:" \ |
| 7311 | -c "HTTP/1.0 200 OK" |
| 7312 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7313 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7314 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7315 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 7316 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7317 | "$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] | 7318 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7319 | "$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] | 7320 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7321 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7322 | 0 \ |
| 7323 | -c "=> renegotiate" \ |
| 7324 | -s "=> renegotiate" \ |
| 7325 | -s "Extra-header:" \ |
| 7326 | -c "HTTP/1.0 200 OK" |
| 7327 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7328 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7329 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7330 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 7331 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7332 | "$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] | 7333 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7334 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7335 | "$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] | 7336 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7337 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7338 | 0 \ |
| 7339 | -c "=> renegotiate" \ |
| 7340 | -s "=> renegotiate" \ |
| 7341 | -s "Extra-header:" \ |
| 7342 | -c "HTTP/1.0 200 OK" |
| 7343 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7344 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7345 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7346 | 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] | 7347 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7348 | "$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] | 7349 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7350 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7351 | "$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] | 7352 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 7353 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 7354 | 0 \ |
| 7355 | -c "=> renegotiate" \ |
| 7356 | -s "=> renegotiate" \ |
| 7357 | -s "Extra-header:" \ |
| 7358 | -c "HTTP/1.0 200 OK" |
| 7359 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7360 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 7361 | ## all versions installed on the CI machines), reported here: |
| 7362 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 7363 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7364 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 7365 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7366 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7367 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7368 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7369 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7370 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7371 | "$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] | 7372 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 7373 | -c "HTTP/1.0 200 OK" |
| 7374 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7375 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7376 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7377 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7378 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 7379 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7380 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7381 | "$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] | 7382 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7383 | -c "HTTP/1.0 200 OK" |
| 7384 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 7385 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7386 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7387 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7388 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 7389 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 7390 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7391 | "$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] | 7392 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7393 | -c "HTTP/1.0 200 OK" |
| 7394 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 7395 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7396 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7397 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7398 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 7399 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 7400 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7401 | "$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] | 7402 | 0 \ |
| 7403 | -s "Extra-header:" \ |
| 7404 | -c "Extra-header:" |
| 7405 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7406 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7407 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7408 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 7409 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 7410 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7411 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7412 | "$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] | 7413 | 0 \ |
| 7414 | -s "Extra-header:" \ |
| 7415 | -c "Extra-header:" |
| 7416 | |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7417 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 7418 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 7419 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 7420 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 7421 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | abb843e | 2019-02-18 16:14:03 +0100 | [diff] [blame] | 7422 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7423 | "$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] | 7424 | 0 \ |
| 7425 | -s "Extra-header:" \ |
| 7426 | -c "Extra-header:" |
| 7427 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 7428 | # Final report |
| 7429 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7430 | echo "------------------------------------------------------------------------" |
| 7431 | |
| 7432 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7433 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7434 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 7435 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7436 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 7437 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 7438 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 7439 | |
| 7440 | exit $FAILS |