| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1 | #!/bin/sh | 
|  | 2 |  | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 3 | # ssl-opt.sh | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 4 | # | 
| Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 5 | # Copyright The Mbed TLS Contributors | 
| Bence Szépkúti | c7da1fe | 2020-05-26 01:54:15 +0200 | [diff] [blame] | 6 | # SPDX-License-Identifier: Apache-2.0 | 
|  | 7 | # | 
|  | 8 | # Licensed under the Apache License, Version 2.0 (the "License"); you may | 
|  | 9 | # not use this file except in compliance with the License. | 
|  | 10 | # You may obtain a copy of the License at | 
|  | 11 | # | 
|  | 12 | # http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 13 | # | 
|  | 14 | # Unless required by applicable law or agreed to in writing, software | 
|  | 15 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | 
|  | 16 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 17 | # See the License for the specific language governing permissions and | 
|  | 18 | # limitations under the License. | 
|  | 19 | # | 
| Simon Butcher | 58eddef | 2016-05-19 23:43:11 +0100 | [diff] [blame] | 20 | # Purpose | 
|  | 21 | # | 
|  | 22 | # Executes tests to prove various TLS/SSL options and extensions. | 
|  | 23 | # | 
|  | 24 | # The goal is not to cover every ciphersuite/version, but instead to cover | 
|  | 25 | # specific options (max fragment length, truncated hmac, etc) or procedures | 
|  | 26 | # (session resumption from cache or ticket, renego, etc). | 
|  | 27 | # | 
|  | 28 | # The tests assume a build with default options, with exceptions expressed | 
|  | 29 | # with a dependency.  The tests focus on functionality and do not consider | 
|  | 30 | # performance. | 
|  | 31 | # | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 32 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 33 | set -u | 
|  | 34 |  | 
| Jaeden Amero | 6e70eb2 | 2019-07-03 13:51:04 +0100 | [diff] [blame] | 35 | # Limit the size of each log to 10 GiB, in case of failures with this script | 
|  | 36 | # where it may output seemingly unlimited length error logs. | 
|  | 37 | ulimit -f 20971520 | 
|  | 38 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 39 | ORIGINAL_PWD=$PWD | 
|  | 40 | if ! cd "$(dirname "$0")"; then | 
|  | 41 | exit 125 | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 42 | fi | 
|  | 43 |  | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 44 | # default values, can be overridden by the environment | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 45 | : ${P_SRV:=../programs/ssl/ssl_server2} | 
|  | 46 | : ${P_CLI:=../programs/ssl/ssl_client2} | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 47 | : ${P_PXY:=../programs/test/udp_proxy} | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 48 | : ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 49 | : ${GNUTLS_CLI:=gnutls-cli} | 
|  | 50 | : ${GNUTLS_SERV:=gnutls-serv} | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 51 | : ${PERL:=perl} | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 52 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 53 | guess_config_name() { | 
|  | 54 | if git diff --quiet ../include/mbedtls/config.h 2>/dev/null; then | 
|  | 55 | echo "default" | 
|  | 56 | else | 
|  | 57 | echo "unknown" | 
|  | 58 | fi | 
|  | 59 | } | 
|  | 60 | : ${MBEDTLS_TEST_OUTCOME_FILE=} | 
|  | 61 | : ${MBEDTLS_TEST_CONFIGURATION:="$(guess_config_name)"} | 
|  | 62 | : ${MBEDTLS_TEST_PLATFORM:="$(uname -s | tr -c \\n0-9A-Za-z _)-$(uname -m | tr -c \\n0-9A-Za-z _)"} | 
|  | 63 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 64 | 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] | 65 | 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] | 66 | 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] | 67 | 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] | 68 | TCP_CLIENT="$PERL scripts/tcp_client.pl" | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 69 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 70 | # alternative versions of OpenSSL and GnuTLS (no default path) | 
|  | 71 |  | 
|  | 72 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
|  | 73 | O_LEGACY_SRV="$OPENSSL_LEGACY s_server -www -cert data_files/server5.crt -key data_files/server5.key" | 
|  | 74 | O_LEGACY_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_LEGACY s_client" | 
|  | 75 | else | 
|  | 76 | O_LEGACY_SRV=false | 
|  | 77 | O_LEGACY_CLI=false | 
|  | 78 | fi | 
|  | 79 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 80 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 81 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" | 
|  | 82 | else | 
|  | 83 | G_NEXT_SRV=false | 
|  | 84 | fi | 
|  | 85 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 86 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 87 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" | 
|  | 88 | else | 
|  | 89 | G_NEXT_CLI=false | 
|  | 90 | fi | 
|  | 91 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 92 | TESTS=0 | 
|  | 93 | FAILS=0 | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 94 | SKIPS=0 | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 95 |  | 
| Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 96 | CONFIG_H='../include/mbedtls/config.h' | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 97 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 98 | MEMCHECK=0 | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 99 | FILTER='.*' | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 100 | EXCLUDE='^$' | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 101 |  | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 102 | SHOW_TEST_NUMBER=0 | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 103 | RUN_TEST_NUMBER='' | 
|  | 104 |  | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 105 | PRESERVE_LOGS=0 | 
|  | 106 |  | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 107 | # Pick a "unique" server port in the range 10000-19999, and a proxy | 
|  | 108 | # port which is this plus 10000. Each port number may be independently | 
|  | 109 | # overridden by a command line option. | 
|  | 110 | SRV_PORT=$(($$ % 10000 + 10000)) | 
|  | 111 | PXY_PORT=$((SRV_PORT + 10000)) | 
|  | 112 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 113 | print_usage() { | 
|  | 114 | echo "Usage: $0 [options]" | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 115 | printf "  -h|--help\tPrint this help.\n" | 
|  | 116 | printf "  -m|--memcheck\tCheck memory leaks and errors.\n" | 
| Gilles Peskine | 880f7f2 | 2020-08-26 22:50:38 +0200 | [diff] [blame] | 117 | printf "  -f|--filter\tOnly matching tests are executed (BRE)\n" | 
|  | 118 | printf "  -e|--exclude\tMatching tests are excluded (BRE)\n" | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 119 | 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] | 120 | 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] | 121 | printf "  -p|--preserve-logs\tPreserve logs of successful tests as well\n" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 122 | printf "     --outcome-file\tFile where test outcomes are written\n" | 
|  | 123 | printf "                \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" | 
|  | 124 | printf "     --port     \tTCP/UDP port (default: randomish 1xxxx)\n" | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 125 | printf "     --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 126 | 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] | 127 | } | 
|  | 128 |  | 
|  | 129 | get_options() { | 
|  | 130 | while [ $# -gt 0 ]; do | 
|  | 131 | case "$1" in | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 132 | -f|--filter) | 
|  | 133 | shift; FILTER=$1 | 
|  | 134 | ;; | 
|  | 135 | -e|--exclude) | 
|  | 136 | shift; EXCLUDE=$1 | 
|  | 137 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 138 | -m|--memcheck) | 
|  | 139 | MEMCHECK=1 | 
|  | 140 | ;; | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 141 | -n|--number) | 
|  | 142 | shift; RUN_TEST_NUMBER=$1 | 
|  | 143 | ;; | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 144 | -s|--show-numbers) | 
|  | 145 | SHOW_TEST_NUMBER=1 | 
|  | 146 | ;; | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 147 | -p|--preserve-logs) | 
|  | 148 | PRESERVE_LOGS=1 | 
|  | 149 | ;; | 
| Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 150 | --port) | 
|  | 151 | shift; SRV_PORT=$1 | 
|  | 152 | ;; | 
|  | 153 | --proxy-port) | 
|  | 154 | shift; PXY_PORT=$1 | 
|  | 155 | ;; | 
| Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 156 | --seed) | 
|  | 157 | shift; SEED="$1" | 
|  | 158 | ;; | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 159 | -h|--help) | 
|  | 160 | print_usage | 
|  | 161 | exit 0 | 
|  | 162 | ;; | 
|  | 163 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 164 | echo "Unknown argument: '$1'" | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 165 | print_usage | 
|  | 166 | exit 1 | 
|  | 167 | ;; | 
|  | 168 | esac | 
|  | 169 | shift | 
|  | 170 | done | 
|  | 171 | } | 
|  | 172 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 173 | # Make the outcome file path relative to the original directory, not | 
|  | 174 | # to .../tests | 
|  | 175 | case "$MBEDTLS_TEST_OUTCOME_FILE" in | 
|  | 176 | [!/]*) | 
|  | 177 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" | 
|  | 178 | ;; | 
|  | 179 | esac | 
|  | 180 |  | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 181 | # Skip next test; use this macro to skip tests which are legitimate | 
|  | 182 | # in theory and expected to be re-introduced at some point, but | 
|  | 183 | # aren't expected to succeed at the moment due to problems outside | 
|  | 184 | # our control (such as bugs in other TLS implementations). | 
|  | 185 | skip_next_test() { | 
|  | 186 | SKIP_NEXT="YES" | 
|  | 187 | } | 
|  | 188 |  | 
| Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 189 | # skip next test if the flag is not enabled in config.h | 
|  | 190 | requires_config_enabled() { | 
|  | 191 | if grep "^#define $1" $CONFIG_H > /dev/null; then :; else | 
|  | 192 | SKIP_NEXT="YES" | 
|  | 193 | fi | 
|  | 194 | } | 
|  | 195 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 196 | # skip next test if the flag is enabled in config.h | 
|  | 197 | requires_config_disabled() { | 
|  | 198 | if grep "^#define $1" $CONFIG_H > /dev/null; then | 
|  | 199 | SKIP_NEXT="YES" | 
|  | 200 | fi | 
|  | 201 | } | 
|  | 202 |  | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 203 | get_config_value_or_default() { | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 204 | # This function uses the query_config command line option to query the | 
|  | 205 | # required Mbed TLS compile time configuration from the ssl_server2 | 
|  | 206 | # program. The command will always return a success value if the | 
|  | 207 | # configuration is defined and the value will be printed to stdout. | 
|  | 208 | # | 
|  | 209 | # Note that if the configuration is not defined or is defined to nothing, | 
|  | 210 | # the output of this function will be an empty string. | 
|  | 211 | ${P_SRV} "query_config=${1}" | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 212 | } | 
|  | 213 |  | 
|  | 214 | requires_config_value_at_least() { | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 215 | VAL="$( get_config_value_or_default "$1" )" | 
|  | 216 | if [ -z "$VAL" ]; then | 
|  | 217 | # Should never happen | 
|  | 218 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 219 | exit 1 | 
|  | 220 | elif [ "$VAL" -lt "$2" ]; then | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 221 | SKIP_NEXT="YES" | 
|  | 222 | fi | 
|  | 223 | } | 
|  | 224 |  | 
|  | 225 | requires_config_value_at_most() { | 
| Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 226 | VAL=$( get_config_value_or_default "$1" ) | 
| Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 227 | if [ -z "$VAL" ]; then | 
|  | 228 | # Should never happen | 
|  | 229 | echo "Mbed TLS configuration $1 is not defined" | 
|  | 230 | exit 1 | 
|  | 231 | elif [ "$VAL" -gt "$2" ]; then | 
| Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 232 | SKIP_NEXT="YES" | 
|  | 233 | fi | 
|  | 234 | } | 
|  | 235 |  | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 236 | requires_ciphersuite_enabled() { | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 237 | if [ -z "$($P_CLI --help 2>/dev/null | grep $1)" ]; then | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 238 | SKIP_NEXT="YES" | 
|  | 239 | fi | 
|  | 240 | } | 
|  | 241 |  | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 242 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] | 
|  | 243 | # If CMD (call to a TLS client or server program) requires a specific | 
|  | 244 | # ciphersuite, arrange to only run the test case if this ciphersuite is | 
|  | 245 | # enabled. As an exception, do run the test case if it expects a ciphersuite | 
|  | 246 | # mismatch. | 
|  | 247 | maybe_requires_ciphersuite_enabled() { | 
|  | 248 | case "$1" in | 
|  | 249 | *\ force_ciphersuite=*) :;; | 
|  | 250 | *) return;; # No specific required ciphersuite | 
|  | 251 | esac | 
|  | 252 | ciphersuite="${1##*\ force_ciphersuite=}" | 
|  | 253 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" | 
|  | 254 | shift | 
|  | 255 |  | 
|  | 256 | case "$*" in | 
|  | 257 | *"-s SSL - The server has no ciphersuites in common"*) | 
|  | 258 | # This test case expects a ciphersuite mismatch, so it doesn't | 
|  | 259 | # require the ciphersuite to be enabled. | 
|  | 260 | ;; | 
|  | 261 | *) | 
|  | 262 | requires_ciphersuite_enabled "$ciphersuite" | 
|  | 263 | ;; | 
|  | 264 | esac | 
|  | 265 |  | 
|  | 266 | unset ciphersuite | 
|  | 267 | } | 
|  | 268 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 269 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV | 
|  | 270 | requires_openssl_with_fallback_scsv() { | 
|  | 271 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then | 
|  | 272 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null | 
|  | 273 | then | 
|  | 274 | OPENSSL_HAS_FBSCSV="YES" | 
|  | 275 | else | 
|  | 276 | OPENSSL_HAS_FBSCSV="NO" | 
|  | 277 | fi | 
|  | 278 | fi | 
|  | 279 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then | 
|  | 280 | SKIP_NEXT="YES" | 
|  | 281 | fi | 
|  | 282 | } | 
|  | 283 |  | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 284 | # skip next test if GnuTLS isn't available | 
|  | 285 | requires_gnutls() { | 
|  | 286 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then | 
| Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 287 | 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] | 288 | GNUTLS_AVAILABLE="YES" | 
|  | 289 | else | 
|  | 290 | GNUTLS_AVAILABLE="NO" | 
|  | 291 | fi | 
|  | 292 | fi | 
|  | 293 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then | 
|  | 294 | SKIP_NEXT="YES" | 
|  | 295 | fi | 
|  | 296 | } | 
|  | 297 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 298 | # skip next test if GnuTLS-next isn't available | 
|  | 299 | requires_gnutls_next() { | 
|  | 300 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then | 
|  | 301 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then | 
|  | 302 | GNUTLS_NEXT_AVAILABLE="YES" | 
|  | 303 | else | 
|  | 304 | GNUTLS_NEXT_AVAILABLE="NO" | 
|  | 305 | fi | 
|  | 306 | fi | 
|  | 307 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then | 
|  | 308 | SKIP_NEXT="YES" | 
|  | 309 | fi | 
|  | 310 | } | 
|  | 311 |  | 
|  | 312 | # skip next test if OpenSSL-legacy isn't available | 
|  | 313 | requires_openssl_legacy() { | 
|  | 314 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then | 
|  | 315 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then | 
|  | 316 | OPENSSL_LEGACY_AVAILABLE="YES" | 
|  | 317 | else | 
|  | 318 | OPENSSL_LEGACY_AVAILABLE="NO" | 
|  | 319 | fi | 
|  | 320 | fi | 
|  | 321 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then | 
|  | 322 | SKIP_NEXT="YES" | 
|  | 323 | fi | 
|  | 324 | } | 
|  | 325 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 326 | # skip next test if IPv6 isn't available on this host | 
|  | 327 | requires_ipv6() { | 
|  | 328 | if [ -z "${HAS_IPV6:-}" ]; then | 
|  | 329 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & | 
|  | 330 | SRV_PID=$! | 
|  | 331 | sleep 1 | 
|  | 332 | kill $SRV_PID >/dev/null 2>&1 | 
|  | 333 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then | 
|  | 334 | HAS_IPV6="NO" | 
|  | 335 | else | 
|  | 336 | HAS_IPV6="YES" | 
|  | 337 | fi | 
|  | 338 | rm -r $SRV_OUT | 
|  | 339 | fi | 
|  | 340 |  | 
|  | 341 | if [ "$HAS_IPV6" = "NO" ]; then | 
|  | 342 | SKIP_NEXT="YES" | 
|  | 343 | fi | 
|  | 344 | } | 
|  | 345 |  | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 346 | # skip next test if it's i686 or uname is not available | 
|  | 347 | requires_not_i686() { | 
|  | 348 | if [ -z "${IS_I686:-}" ]; then | 
|  | 349 | IS_I686="YES" | 
|  | 350 | if which "uname" >/dev/null 2>&1; then | 
|  | 351 | if [ -z "$(uname -a | grep i686)" ]; then | 
|  | 352 | IS_I686="NO" | 
|  | 353 | fi | 
|  | 354 | fi | 
|  | 355 | fi | 
|  | 356 | if [ "$IS_I686" = "YES" ]; then | 
|  | 357 | SKIP_NEXT="YES" | 
|  | 358 | fi | 
|  | 359 | } | 
|  | 360 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 361 | # Calculate the input & output maximum content lengths set in the config | 
| Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 362 | MAX_CONTENT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_MAX_CONTENT_LEN || echo "16384") | 
|  | 363 | MAX_IN_LEN=$( ../scripts/config.py get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") | 
|  | 364 | MAX_OUT_LEN=$( ../scripts/config.py get MBEDTLS_SSL_OUT_CONTENT_LEN || echo "$MAX_CONTENT_LEN") | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 365 |  | 
|  | 366 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 367 | MAX_CONTENT_LEN="$MAX_IN_LEN" | 
|  | 368 | fi | 
|  | 369 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then | 
|  | 370 | MAX_CONTENT_LEN="$MAX_OUT_LEN" | 
|  | 371 | fi | 
|  | 372 |  | 
|  | 373 | # skip the next test if the SSL output buffer is less than 16KB | 
|  | 374 | requires_full_size_output_buffer() { | 
|  | 375 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then | 
|  | 376 | SKIP_NEXT="YES" | 
|  | 377 | fi | 
|  | 378 | } | 
|  | 379 |  | 
| Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 380 | # skip the next test if valgrind is in use | 
|  | 381 | not_with_valgrind() { | 
|  | 382 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 383 | SKIP_NEXT="YES" | 
|  | 384 | fi | 
|  | 385 | } | 
|  | 386 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 387 | # skip the next test if valgrind is NOT in use | 
|  | 388 | only_with_valgrind() { | 
|  | 389 | if [ "$MEMCHECK" -eq 0 ]; then | 
|  | 390 | SKIP_NEXT="YES" | 
|  | 391 | fi | 
|  | 392 | } | 
|  | 393 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 394 | # multiply the client timeout delay by the given factor for the next test | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 395 | client_needs_more_time() { | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 396 | CLI_DELAY_FACTOR=$1 | 
|  | 397 | } | 
|  | 398 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 399 | # wait for the given seconds after the client finished in the next test | 
|  | 400 | server_needs_more_time() { | 
|  | 401 | SRV_DELAY_SECONDS=$1 | 
|  | 402 | } | 
|  | 403 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 404 | # print_name <name> | 
|  | 405 | print_name() { | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 406 | TESTS=$(( $TESTS + 1 )) | 
|  | 407 | LINE="" | 
|  | 408 |  | 
|  | 409 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then | 
|  | 410 | LINE="$TESTS " | 
|  | 411 | fi | 
|  | 412 |  | 
|  | 413 | LINE="$LINE$1" | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 414 | printf "%s " "$LINE" | 
| Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 415 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 416 | for i in `seq 1 $LEN`; do printf '.'; done | 
|  | 417 | printf ' ' | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 418 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 419 | } | 
|  | 420 |  | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 421 | # record_outcome <outcome> [<failure-reason>] | 
|  | 422 | # The test name must be in $NAME. | 
|  | 423 | record_outcome() { | 
|  | 424 | echo "$1" | 
|  | 425 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then | 
|  | 426 | printf '%s;%s;%s;%s;%s;%s\n' \ | 
|  | 427 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ | 
|  | 428 | "ssl-opt" "$NAME" \ | 
|  | 429 | "$1" "${2-}" \ | 
|  | 430 | >>"$MBEDTLS_TEST_OUTCOME_FILE" | 
|  | 431 | fi | 
|  | 432 | } | 
|  | 433 |  | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 434 | # fail <message> | 
|  | 435 | fail() { | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 436 | record_outcome "FAIL" "$1" | 
| Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 437 | echo "  ! $1" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 438 |  | 
| Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 439 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 440 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 441 | if [ -n "$PXY_CMD" ]; then | 
|  | 442 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 443 | fi | 
|  | 444 | echo "  ! outputs saved to o-XXX-${TESTS}.log" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 445 |  | 
| Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 446 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 447 | echo "  ! server output:" | 
|  | 448 | cat o-srv-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 449 | echo "  ! ========================================================" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 450 | echo "  ! client output:" | 
|  | 451 | cat o-cli-${TESTS}.log | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 452 | if [ -n "$PXY_CMD" ]; then | 
|  | 453 | echo "  ! ========================================================" | 
|  | 454 | echo "  ! proxy output:" | 
|  | 455 | cat o-pxy-${TESTS}.log | 
|  | 456 | fi | 
|  | 457 | echo "" | 
| Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 458 | fi | 
|  | 459 |  | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 460 | FAILS=$(( $FAILS + 1 )) | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 461 | } | 
|  | 462 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 463 | # is_polar <cmd_line> | 
|  | 464 | is_polar() { | 
|  | 465 | echo "$1" | grep 'ssl_server2\|ssl_client2' > /dev/null | 
|  | 466 | } | 
|  | 467 |  | 
| Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 468 | # openssl s_server doesn't have -www with DTLS | 
|  | 469 | check_osrv_dtls() { | 
|  | 470 | if echo "$SRV_CMD" | grep 's_server.*-dtls' >/dev/null; then | 
|  | 471 | NEEDS_INPUT=1 | 
|  | 472 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )" | 
|  | 473 | else | 
|  | 474 | NEEDS_INPUT=0 | 
|  | 475 | fi | 
|  | 476 | } | 
|  | 477 |  | 
|  | 478 | # provide input to commands that need it | 
|  | 479 | provide_input() { | 
|  | 480 | if [ $NEEDS_INPUT -eq 0 ]; then | 
|  | 481 | return | 
|  | 482 | fi | 
|  | 483 |  | 
|  | 484 | while true; do | 
|  | 485 | echo "HTTP/1.0 200 OK" | 
|  | 486 | sleep 1 | 
|  | 487 | done | 
|  | 488 | } | 
|  | 489 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 490 | # has_mem_err <log_file_name> | 
|  | 491 | has_mem_err() { | 
|  | 492 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && | 
|  | 493 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null | 
|  | 494 | then | 
|  | 495 | return 1 # false: does not have errors | 
|  | 496 | else | 
|  | 497 | return 0 # true: has errors | 
|  | 498 | fi | 
|  | 499 | } | 
|  | 500 |  | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 501 | # 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] | 502 | if type lsof >/dev/null 2>/dev/null; then | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 503 | wait_app_start() { | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 504 | START_TIME=$(date +%s) | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 505 | if [ "$DTLS" -eq 1 ]; then | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 506 | proto=UDP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 507 | else | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 508 | proto=TCP | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 509 | fi | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 510 | # Make a tight loop, server normally takes less than 1s to start. | 
|  | 511 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do | 
|  | 512 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 513 | echo "$3 START TIMEOUT" | 
|  | 514 | echo "$3 START TIMEOUT" >> $4 | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 515 | break | 
|  | 516 | fi | 
|  | 517 | # Linux and *BSD support decimal arguments to sleep. On other | 
|  | 518 | # OSes this may be a tight loop. | 
|  | 519 | sleep 0.1 2>/dev/null || true | 
|  | 520 | done | 
|  | 521 | } | 
|  | 522 | else | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 523 | echo "Warning: lsof not available, wait_app_start = sleep" | 
|  | 524 | wait_app_start() { | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 525 | sleep "$START_DELAY" | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 526 | } | 
|  | 527 | fi | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 528 |  | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 529 | # Wait for server process $2 to be listening on port $1. | 
|  | 530 | wait_server_start() { | 
|  | 531 | wait_app_start $1 $2 "SERVER" $SRV_OUT | 
|  | 532 | } | 
|  | 533 |  | 
|  | 534 | # Wait for proxy process $2 to be listening on port $1. | 
|  | 535 | wait_proxy_start() { | 
|  | 536 | wait_app_start $1 $2 "PROXY" $PXY_OUT | 
|  | 537 | } | 
|  | 538 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 539 | # 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] | 540 | # 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] | 541 | # acceptable bounds | 
|  | 542 | check_server_hello_time() { | 
|  | 543 | # 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] | 544 | 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] | 545 | # Get the Unix timestamp for now | 
|  | 546 | CUR_TIME=$(date +'%s') | 
|  | 547 | THRESHOLD_IN_SECS=300 | 
|  | 548 |  | 
|  | 549 | # Check if the ServerHello time was printed | 
|  | 550 | if [ -z "$SERVER_HELLO_TIME" ]; then | 
|  | 551 | return 1 | 
|  | 552 | fi | 
|  | 553 |  | 
|  | 554 | # Check the time in ServerHello is within acceptable bounds | 
|  | 555 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then | 
|  | 556 | # The time in ServerHello is at least 5 minutes before now | 
|  | 557 | return 1 | 
|  | 558 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then | 
| Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 559 | # 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] | 560 | return 1 | 
|  | 561 | else | 
|  | 562 | return 0 | 
|  | 563 | fi | 
|  | 564 | } | 
|  | 565 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 566 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument | 
|  | 567 | handshake_memory_get() { | 
|  | 568 | OUTPUT_VARIABLE="$1" | 
|  | 569 | OUTPUT_FILE="$2" | 
|  | 570 |  | 
|  | 571 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" | 
|  | 572 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) | 
|  | 573 |  | 
|  | 574 | # Check if memory usage was read | 
|  | 575 | if [ -z "$MEM_USAGE" ]; then | 
|  | 576 | echo "Error: Can not read the value of handshake memory usage" | 
|  | 577 | return 1 | 
|  | 578 | else | 
|  | 579 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" | 
|  | 580 | return 0 | 
|  | 581 | fi | 
|  | 582 | } | 
|  | 583 |  | 
|  | 584 | # Get handshake memory usage from server or client output and check if this value | 
|  | 585 | # is not higher than the maximum given by the first argument | 
|  | 586 | handshake_memory_check() { | 
|  | 587 | MAX_MEMORY="$1" | 
|  | 588 | OUTPUT_FILE="$2" | 
|  | 589 |  | 
|  | 590 | # Get memory usage | 
|  | 591 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then | 
|  | 592 | return 1 | 
|  | 593 | fi | 
|  | 594 |  | 
|  | 595 | # Check if memory usage is below max value | 
|  | 596 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then | 
|  | 597 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ | 
|  | 598 | "but should be below $MAX_MEMORY bytes" | 
|  | 599 | return 1 | 
|  | 600 | else | 
|  | 601 | return 0 | 
|  | 602 | fi | 
|  | 603 | } | 
|  | 604 |  | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 605 | # wait for client to terminate and set CLI_EXIT | 
|  | 606 | # must be called right after starting the client | 
|  | 607 | wait_client_done() { | 
|  | 608 | CLI_PID=$! | 
|  | 609 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 610 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) | 
|  | 611 | CLI_DELAY_FACTOR=1 | 
|  | 612 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 613 | ( 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] | 614 | DOG_PID=$! | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 615 |  | 
|  | 616 | wait $CLI_PID | 
|  | 617 | CLI_EXIT=$? | 
|  | 618 |  | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 619 | kill $DOG_PID >/dev/null 2>&1 | 
|  | 620 | wait $DOG_PID | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 621 |  | 
|  | 622 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 623 |  | 
|  | 624 | sleep $SRV_DELAY_SECONDS | 
|  | 625 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 626 | } | 
|  | 627 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 628 | # check if the given command uses dtls and sets global variable DTLS | 
|  | 629 | detect_dtls() { | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 630 | 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] | 631 | DTLS=1 | 
|  | 632 | else | 
|  | 633 | DTLS=0 | 
|  | 634 | fi | 
|  | 635 | } | 
|  | 636 |  | 
| Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 637 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS | 
|  | 638 | is_gnutls() { | 
|  | 639 | case "$1" in | 
|  | 640 | *gnutls-cli*) | 
|  | 641 | CMD_IS_GNUTLS=1 | 
|  | 642 | ;; | 
|  | 643 | *gnutls-serv*) | 
|  | 644 | CMD_IS_GNUTLS=1 | 
|  | 645 | ;; | 
|  | 646 | *) | 
|  | 647 | CMD_IS_GNUTLS=0 | 
|  | 648 | ;; | 
|  | 649 | esac | 
|  | 650 | } | 
|  | 651 |  | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 652 | # Compare file content | 
|  | 653 | # Usage: find_in_both pattern file1 file2 | 
|  | 654 | # extract from file1 the first line matching the pattern | 
|  | 655 | # check in file2 that the same line can be found | 
|  | 656 | find_in_both() { | 
|  | 657 | srv_pattern=$(grep -m 1 "$1" "$2"); | 
|  | 658 | if [ -z "$srv_pattern" ]; then | 
|  | 659 | return 1; | 
|  | 660 | fi | 
|  | 661 |  | 
|  | 662 | if grep "$srv_pattern" $3 >/dev/null; then : | 
| Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 663 | return 0; | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 664 | else | 
|  | 665 | return 1; | 
|  | 666 | fi | 
|  | 667 | } | 
|  | 668 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 669 | # 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] | 670 | # Options:  -s pattern  pattern that must be present in server output | 
|  | 671 | #           -c pattern  pattern that must be present in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 672 | #           -u pattern  lines after pattern must be unique in client output | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 673 | #           -f call shell function on client output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 674 | #           -S pattern  pattern that must be absent in server output | 
|  | 675 | #           -C pattern  pattern that must be absent in client output | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 676 | #           -U pattern  lines after pattern must be unique in server output | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 677 | #           -F call shell function on server output | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 678 | #           -g call shell function on server and client output | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 679 | run_test() { | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 680 | NAME="$1" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 681 | shift 1 | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 682 |  | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 683 | if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then : | 
|  | 684 | else | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 685 | SKIP_NEXT="NO" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 686 | # There was no request to run the test, so don't record its outcome. | 
| Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 687 | return | 
|  | 688 | fi | 
|  | 689 |  | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 690 | print_name "$NAME" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 691 |  | 
| Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 692 | # Do we only run numbered tests? | 
|  | 693 | if [ "X$RUN_TEST_NUMBER" = "X" ]; then : | 
|  | 694 | elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then : | 
|  | 695 | else | 
|  | 696 | SKIP_NEXT="YES" | 
|  | 697 | fi | 
|  | 698 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 699 | # does this test use a proxy? | 
|  | 700 | if [ "X$1" = "X-p" ]; then | 
|  | 701 | PXY_CMD="$2" | 
|  | 702 | shift 2 | 
|  | 703 | else | 
|  | 704 | PXY_CMD="" | 
|  | 705 | fi | 
|  | 706 |  | 
|  | 707 | # get commands and client output | 
|  | 708 | SRV_CMD="$1" | 
|  | 709 | CLI_CMD="$2" | 
|  | 710 | CLI_EXPECT="$3" | 
|  | 711 | shift 3 | 
|  | 712 |  | 
| Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 713 | # Check if test uses files | 
|  | 714 | TEST_USES_FILES=$(echo "$SRV_CMD $CLI_CMD" | grep "\.\(key\|crt\|pem\)" ) | 
|  | 715 | if [ ! -z "$TEST_USES_FILES" ]; then | 
|  | 716 | requires_config_enabled MBEDTLS_FS_IO | 
|  | 717 | fi | 
|  | 718 |  | 
| Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 719 | # If the client or serve requires a ciphersuite, check that it's enabled. | 
|  | 720 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" | 
|  | 721 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 722 |  | 
|  | 723 | # should we skip? | 
|  | 724 | if [ "X$SKIP_NEXT" = "XYES" ]; then | 
|  | 725 | SKIP_NEXT="NO" | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 726 | record_outcome "SKIP" | 
| Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 727 | SKIPS=$(( $SKIPS + 1 )) | 
|  | 728 | return | 
|  | 729 | fi | 
|  | 730 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 731 | # update DTLS variable | 
|  | 732 | detect_dtls "$SRV_CMD" | 
|  | 733 |  | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 734 | # if the test uses DTLS but no custom proxy, add a simple proxy | 
|  | 735 | # as it provides timing info that's useful to debug failures | 
| Manuel Pégourié-Gonnard | 70fce98 | 2020-06-25 09:54:46 +0200 | [diff] [blame] | 736 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 737 | PXY_CMD="$P_PXY" | 
| Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 738 | case " $SRV_CMD " in | 
|  | 739 | *' server_addr=::1 '*) | 
|  | 740 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; | 
|  | 741 | esac | 
| Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 742 | fi | 
|  | 743 |  | 
| Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 744 | # update CMD_IS_GNUTLS variable | 
|  | 745 | is_gnutls "$SRV_CMD" | 
|  | 746 |  | 
|  | 747 | # if the server uses gnutls but doesn't set priority, explicitly | 
|  | 748 | # set the default priority | 
|  | 749 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then | 
|  | 750 | case "$SRV_CMD" in | 
|  | 751 | *--priority*) :;; | 
|  | 752 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; | 
|  | 753 | esac | 
|  | 754 | fi | 
|  | 755 |  | 
|  | 756 | # update CMD_IS_GNUTLS variable | 
|  | 757 | is_gnutls "$CLI_CMD" | 
|  | 758 |  | 
|  | 759 | # if the client uses gnutls but doesn't set priority, explicitly | 
|  | 760 | # set the default priority | 
|  | 761 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then | 
|  | 762 | case "$CLI_CMD" in | 
|  | 763 | *--priority*) :;; | 
|  | 764 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; | 
|  | 765 | esac | 
|  | 766 | fi | 
|  | 767 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 768 | # fix client port | 
|  | 769 | if [ -n "$PXY_CMD" ]; then | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 770 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) | 
|  | 771 | else | 
|  | 772 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) | 
|  | 773 | fi | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 774 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 775 | # prepend valgrind to our commands if active | 
|  | 776 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 777 | if is_polar "$SRV_CMD"; then | 
|  | 778 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" | 
|  | 779 | fi | 
|  | 780 | if is_polar "$CLI_CMD"; then | 
|  | 781 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" | 
|  | 782 | fi | 
|  | 783 | fi | 
|  | 784 |  | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 785 | TIMES_LEFT=2 | 
|  | 786 | while [ $TIMES_LEFT -gt 0 ]; do | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 787 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 788 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 789 | # run the commands | 
|  | 790 | if [ -n "$PXY_CMD" ]; then | 
| Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 791 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 792 | $PXY_CMD >> $PXY_OUT 2>&1 & | 
|  | 793 | PXY_PID=$! | 
| Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 794 | wait_proxy_start "$PXY_PORT" "$PXY_PID" | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 795 | fi | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 796 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 797 | check_osrv_dtls | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 798 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 799 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & | 
|  | 800 | SRV_PID=$! | 
| Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 801 | wait_server_start "$SRV_PORT" "$SRV_PID" | 
| Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 802 |  | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 803 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 804 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & | 
|  | 805 | wait_client_done | 
| Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 806 |  | 
| Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 807 | sleep 0.05 | 
|  | 808 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 809 | # terminate the server (and the proxy) | 
|  | 810 | kill $SRV_PID | 
|  | 811 | wait $SRV_PID | 
| Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 812 | SRV_RET=$? | 
| Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 813 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 814 | if [ -n "$PXY_CMD" ]; then | 
|  | 815 | kill $PXY_PID >/dev/null 2>&1 | 
|  | 816 | wait $PXY_PID | 
|  | 817 | fi | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 818 |  | 
| Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 819 | # retry only on timeouts | 
|  | 820 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then | 
|  | 821 | printf "RETRY " | 
|  | 822 | else | 
|  | 823 | TIMES_LEFT=0 | 
|  | 824 | fi | 
| Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 825 | done | 
|  | 826 |  | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 827 | # 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] | 828 | # (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] | 829 | # expected client exit to incorrectly succeed in case of catastrophic | 
|  | 830 | # failure) | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 831 | if is_polar "$SRV_CMD"; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 832 | 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] | 833 | else | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 834 | fail "server or client failed to reach handshake stage" | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 835 | return | 
|  | 836 | fi | 
|  | 837 | fi | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 838 | if is_polar "$CLI_CMD"; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 839 | 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] | 840 | else | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 841 | fail "server or client failed to reach handshake stage" | 
| Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 842 | return | 
|  | 843 | fi | 
|  | 844 | fi | 
|  | 845 |  | 
| Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 846 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't | 
|  | 847 | # exit with status 0 when interrupted by a signal, and we don't really | 
|  | 848 | # care anyway), in case e.g. the server reports a memory leak. | 
|  | 849 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then | 
| Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 850 | fail "Server exited with status $SRV_RET" | 
| Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 851 | return | 
|  | 852 | fi | 
|  | 853 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 854 | # check client exit code | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 855 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ | 
|  | 856 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 857 | then | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 858 | 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] | 859 | return | 
|  | 860 | fi | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 861 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 862 | # check other assertions | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 863 | # lines beginning with == are added by valgrind, ignore them | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 864 | # 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] | 865 | while [ $# -gt 0 ] | 
|  | 866 | do | 
|  | 867 | case $1 in | 
|  | 868 | "-s") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 869 | 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] | 870 | fail "pattern '$2' MUST be present in the Server output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 871 | return | 
|  | 872 | fi | 
|  | 873 | ;; | 
|  | 874 |  | 
|  | 875 | "-c") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 876 | 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] | 877 | fail "pattern '$2' MUST be present in the Client output" | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 878 | return | 
|  | 879 | fi | 
|  | 880 | ;; | 
|  | 881 |  | 
|  | 882 | "-S") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 883 | 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] | 884 | 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] | 885 | return | 
|  | 886 | fi | 
|  | 887 | ;; | 
|  | 888 |  | 
|  | 889 | "-C") | 
| Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 890 | 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] | 891 | fail "pattern '$2' MUST NOT be present in the Client output" | 
|  | 892 | return | 
|  | 893 | fi | 
|  | 894 | ;; | 
|  | 895 |  | 
|  | 896 | # The filtering in the following two options (-u and -U) do the following | 
|  | 897 | #   - ignore valgrind output | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 898 | #   - filter out everything but lines right after the pattern occurrences | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 899 | #   - keep one of each non-unique line | 
|  | 900 | #   - count how many lines remain | 
|  | 901 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 | 
|  | 902 | # if there were no duplicates. | 
|  | 903 | "-U") | 
|  | 904 | 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 | 
|  | 905 | fail "lines following pattern '$2' must be unique in Server output" | 
|  | 906 | return | 
|  | 907 | fi | 
|  | 908 | ;; | 
|  | 909 |  | 
|  | 910 | "-u") | 
|  | 911 | 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 | 
|  | 912 | 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] | 913 | return | 
|  | 914 | fi | 
|  | 915 | ;; | 
| Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 916 | "-F") | 
|  | 917 | if ! $2 "$SRV_OUT"; then | 
|  | 918 | fail "function call to '$2' failed on Server output" | 
|  | 919 | return | 
|  | 920 | fi | 
|  | 921 | ;; | 
|  | 922 | "-f") | 
|  | 923 | if ! $2 "$CLI_OUT"; then | 
|  | 924 | fail "function call to '$2' failed on Client output" | 
|  | 925 | return | 
|  | 926 | fi | 
|  | 927 | ;; | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 928 | "-g") | 
|  | 929 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then | 
|  | 930 | fail "function call to '$2' failed on Server and Client output" | 
|  | 931 | return | 
|  | 932 | fi | 
|  | 933 | ;; | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 934 |  | 
|  | 935 | *) | 
| Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 936 | echo "Unknown test: $1" >&2 | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 937 | exit 1 | 
|  | 938 | esac | 
|  | 939 | shift 2 | 
|  | 940 | done | 
|  | 941 |  | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 942 | # check valgrind's results | 
|  | 943 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 944 | 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] | 945 | fail "Server has memory errors" | 
|  | 946 | return | 
|  | 947 | fi | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 948 | 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] | 949 | fail "Client has memory errors" | 
|  | 950 | return | 
|  | 951 | fi | 
|  | 952 | fi | 
|  | 953 |  | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 954 | # if we're here, everything is ok | 
| Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 955 | record_outcome "PASS" | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 956 | if [ "$PRESERVE_LOGS" -gt 0 ]; then | 
|  | 957 | mv $SRV_OUT o-srv-${TESTS}.log | 
|  | 958 | mv $CLI_OUT o-cli-${TESTS}.log | 
| Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 959 | if [ -n "$PXY_CMD" ]; then | 
|  | 960 | mv $PXY_OUT o-pxy-${TESTS}.log | 
|  | 961 | fi | 
| Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 962 | fi | 
|  | 963 |  | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 964 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT | 
| Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 965 | } | 
|  | 966 |  | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 967 | run_test_psa() { | 
|  | 968 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
| Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 969 | run_test    "PSA-supported ciphersuite: $1" \ | 
| Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 970 | "$P_SRV debug_level=3 force_version=tls1_2" \ | 
|  | 971 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 972 | 0 \ | 
|  | 973 | -c "Successfully setup PSA-based decryption cipher context" \ | 
|  | 974 | -c "Successfully setup PSA-based encryption cipher context" \ | 
| Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 975 | -c "PSA calc verify" \ | 
| Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 976 | -c "calc PSA finished" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 977 | -s "Successfully setup PSA-based decryption cipher context" \ | 
|  | 978 | -s "Successfully setup PSA-based encryption cipher context" \ | 
| Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 979 | -s "PSA calc verify" \ | 
| Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 980 | -s "calc PSA finished" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 981 | -C "Failed to setup PSA-based cipher context"\ | 
|  | 982 | -S "Failed to setup PSA-based cipher context"\ | 
|  | 983 | -s "Protocol is TLSv1.2" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 984 | -c "Perform PSA-based ECDH computation."\ | 
| Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 985 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 986 | -S "error" \ | 
|  | 987 | -C "error" | 
|  | 988 | } | 
|  | 989 |  | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 990 | run_test_psa_force_curve() { | 
|  | 991 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 992 | run_test    "PSA - ECDH with $1" \ | 
|  | 993 | "$P_SRV debug_level=4 force_version=tls1_2" \ | 
|  | 994 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ | 
|  | 995 | 0 \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 996 | -c "Successfully setup PSA-based decryption cipher context" \ | 
|  | 997 | -c "Successfully setup PSA-based encryption cipher context" \ | 
|  | 998 | -c "PSA calc verify" \ | 
|  | 999 | -c "calc PSA finished" \ | 
|  | 1000 | -s "Successfully setup PSA-based decryption cipher context" \ | 
|  | 1001 | -s "Successfully setup PSA-based encryption cipher context" \ | 
|  | 1002 | -s "PSA calc verify" \ | 
|  | 1003 | -s "calc PSA finished" \ | 
|  | 1004 | -C "Failed to setup PSA-based cipher context"\ | 
|  | 1005 | -S "Failed to setup PSA-based cipher context"\ | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1006 | -s "Protocol is TLSv1.2" \ | 
| Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1007 | -c "Perform PSA-based ECDH computation."\ | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1008 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1009 | -S "error" \ | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1010 | -C "error" | 
|  | 1011 | } | 
|  | 1012 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1013 | # Test that the server's memory usage after a handshake is reduced when a client specifies | 
|  | 1014 | # a maximum fragment length. | 
|  | 1015 | #  first argument ($1) is MFL for SSL client | 
|  | 1016 | #  second argument ($2) is memory usage for SSL client with default MFL (16k) | 
|  | 1017 | run_test_memory_after_hanshake_with_mfl() | 
|  | 1018 | { | 
|  | 1019 | # The test passes if the difference is around 2*(16k-MFL) | 
|  | 1020 | local MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" | 
|  | 1021 |  | 
|  | 1022 | # Leave some margin for robustness | 
|  | 1023 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" | 
|  | 1024 |  | 
|  | 1025 | run_test    "Handshake memory usage (MFL $1)" \ | 
|  | 1026 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ | 
|  | 1027 | "$P_CLI debug_level=3 force_version=tls1_2 \ | 
|  | 1028 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 1029 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ | 
|  | 1030 | 0 \ | 
|  | 1031 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" | 
|  | 1032 | } | 
|  | 1033 |  | 
|  | 1034 |  | 
|  | 1035 | # Test that the server's memory usage after a handshake is reduced when a client specifies | 
|  | 1036 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes | 
|  | 1037 | run_tests_memory_after_hanshake() | 
|  | 1038 | { | 
|  | 1039 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) | 
|  | 1040 | SKIP_THIS_TESTS="$SKIP_NEXT" | 
|  | 1041 |  | 
|  | 1042 | # first test with default MFU is to get reference memory usage | 
|  | 1043 | MEMORY_USAGE_MFL_16K=0 | 
|  | 1044 | run_test    "Handshake memory usage initial (MFL 16384 - default)" \ | 
|  | 1045 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ | 
|  | 1046 | "$P_CLI debug_level=3 force_version=tls1_2 \ | 
|  | 1047 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 1048 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ | 
|  | 1049 | 0 \ | 
|  | 1050 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" | 
|  | 1051 |  | 
|  | 1052 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1053 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" | 
|  | 1054 |  | 
|  | 1055 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1056 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" | 
|  | 1057 |  | 
|  | 1058 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1059 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" | 
|  | 1060 |  | 
|  | 1061 | SKIP_NEXT="$SKIP_THIS_TESTS" | 
|  | 1062 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" | 
|  | 1063 | } | 
|  | 1064 |  | 
| Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1065 | cleanup() { | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1066 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION | 
| Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1067 | rm -f context_srv.txt | 
|  | 1068 | rm -f context_cli.txt | 
| Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1069 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 | 
|  | 1070 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 | 
|  | 1071 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 | 
|  | 1072 | 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] | 1073 | exit 1 | 
|  | 1074 | } | 
|  | 1075 |  | 
| Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1076 | # | 
|  | 1077 | # MAIN | 
|  | 1078 | # | 
|  | 1079 |  | 
| Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1080 | get_options "$@" | 
|  | 1081 |  | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1082 | # sanity checks, avoid an avalanche of errors | 
| Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1083 | P_SRV_BIN="${P_SRV%%[  ]*}" | 
|  | 1084 | P_CLI_BIN="${P_CLI%%[  ]*}" | 
|  | 1085 | P_PXY_BIN="${P_PXY%%[  ]*}" | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1086 | if [ ! -x "$P_SRV_BIN" ]; then | 
|  | 1087 | echo "Command '$P_SRV_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1088 | exit 1 | 
|  | 1089 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1090 | if [ ! -x "$P_CLI_BIN" ]; then | 
|  | 1091 | echo "Command '$P_CLI_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1092 | exit 1 | 
|  | 1093 | fi | 
| Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1094 | if [ ! -x "$P_PXY_BIN" ]; then | 
|  | 1095 | echo "Command '$P_PXY_BIN' is not an executable file" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1096 | exit 1 | 
|  | 1097 | fi | 
| Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1098 | if [ "$MEMCHECK" -gt 0 ]; then | 
|  | 1099 | if which valgrind >/dev/null 2>&1; then :; else | 
|  | 1100 | echo "Memcheck not possible. Valgrind not found" | 
|  | 1101 | exit 1 | 
|  | 1102 | fi | 
|  | 1103 | fi | 
| Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1104 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else | 
|  | 1105 | echo "Command '$OPENSSL_CMD' not found" | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1106 | exit 1 | 
|  | 1107 | fi | 
|  | 1108 |  | 
| Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1109 | # used by watchdog | 
|  | 1110 | MAIN_PID="$$" | 
|  | 1111 |  | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1112 | # We use somewhat arbitrary delays for tests: | 
|  | 1113 | # - how long do we wait for the server to start (when lsof not available)? | 
|  | 1114 | # - how long do we allow for the client to finish? | 
|  | 1115 | #   (not to check performance, just to avoid waiting indefinitely) | 
|  | 1116 | # Things are slower with valgrind, so give extra time here. | 
|  | 1117 | # | 
|  | 1118 | # Note: without lsof, there is a trade-off between the running time of this | 
|  | 1119 | # script and the risk of spurious errors because we didn't wait long enough. | 
|  | 1120 | # The watchdog delay on the other hand doesn't affect normal running time of | 
|  | 1121 | # 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] | 1122 | if [ "$MEMCHECK" -gt 0 ]; then | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1123 | START_DELAY=6 | 
|  | 1124 | DOG_DELAY=60 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1125 | else | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1126 | START_DELAY=2 | 
|  | 1127 | DOG_DELAY=20 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1128 | fi | 
| Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1129 |  | 
|  | 1130 | # some particular tests need more time: | 
|  | 1131 | # - for the client, we multiply the usual watchdog limit by a factor | 
|  | 1132 | # - for the server, we sleep for a number of seconds after the client exits | 
|  | 1133 | # see client_need_more_time() and server_needs_more_time() | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1134 | CLI_DELAY_FACTOR=1 | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1135 | SRV_DELAY_SECONDS=0 | 
| Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1136 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1137 | # 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] | 1138 | # +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] | 1139 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" | 
|  | 1140 | 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] | 1141 | 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] | 1142 | O_SRV="$O_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 1143 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1144 | G_SRV="$G_SRV -p $SRV_PORT" | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1145 | G_CLI="$G_CLI -p +SRV_PORT" | 
| Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1146 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1147 | if [ -n "${OPENSSL_LEGACY:-}" ]; then | 
|  | 1148 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" | 
|  | 1149 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" | 
|  | 1150 | fi | 
|  | 1151 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1152 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1153 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" | 
|  | 1154 | fi | 
|  | 1155 |  | 
| Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1156 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1157 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1158 | fi | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1159 |  | 
| Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1160 | # Allow SHA-1, because many of our test certificates use it | 
|  | 1161 | P_SRV="$P_SRV allow_sha1=1" | 
|  | 1162 | P_CLI="$P_CLI allow_sha1=1" | 
|  | 1163 |  | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1164 | # Also pick a unique name for intermediate files | 
|  | 1165 | SRV_OUT="srv_out.$$" | 
|  | 1166 | CLI_OUT="cli_out.$$" | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1167 | PXY_OUT="pxy_out.$$" | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1168 | SESSION="session.$$" | 
|  | 1169 |  | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1170 | SKIP_NEXT="NO" | 
|  | 1171 |  | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1172 | trap cleanup INT TERM HUP | 
|  | 1173 |  | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1174 | # Basic test | 
|  | 1175 |  | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1176 | # Checks that: | 
|  | 1177 | # - things work with all ciphersuites active (used with config-full in all.sh) | 
|  | 1178 | # - the expected (highest security) parameters are selected | 
|  | 1179 | #   ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1180 | run_test    "Default" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1181 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1182 | "$P_CLI" \ | 
|  | 1183 | 0 \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1184 | -s "Protocol is TLSv1.2" \ | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1185 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
| Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1186 | -s "client hello v3, signature_algorithm ext: 6" \ | 
|  | 1187 | -s "ECDHE curve: secp521r1" \ | 
|  | 1188 | -S "error" \ | 
|  | 1189 | -C "error" | 
| Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1190 |  | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1191 | run_test    "Default, DTLS" \ | 
|  | 1192 | "$P_SRV dtls=1" \ | 
|  | 1193 | "$P_CLI dtls=1" \ | 
|  | 1194 | 0 \ | 
|  | 1195 | -s "Protocol is DTLSv1.2" \ | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1196 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" | 
| Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1197 |  | 
| Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1198 | run_test    "TLS client auth: required" \ | 
|  | 1199 | "$P_SRV auth_mode=required" \ | 
|  | 1200 | "$P_CLI" \ | 
|  | 1201 | 0 \ | 
|  | 1202 | -s "Verifying peer X.509 certificate... ok" | 
|  | 1203 |  | 
| Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1204 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1205 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1206 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1207 | run_test    "TLS: password protected client key" \ | 
|  | 1208 | "$P_SRV auth_mode=required" \ | 
|  | 1209 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ | 
|  | 1210 | 0 | 
|  | 1211 |  | 
|  | 1212 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1213 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1214 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1215 | run_test    "TLS: password protected server key" \ | 
|  | 1216 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ | 
|  | 1217 | "$P_CLI" \ | 
|  | 1218 | 0 | 
|  | 1219 |  | 
|  | 1220 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1221 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1222 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 1223 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1224 | run_test    "TLS: password protected server key, two certificates" \ | 
|  | 1225 | "$P_SRV \ | 
|  | 1226 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ | 
|  | 1227 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ | 
|  | 1228 | "$P_CLI" \ | 
|  | 1229 | 0 | 
|  | 1230 |  | 
| Manuel Pégourié-Gonnard | 342d2ca | 2020-01-02 11:58:00 +0100 | [diff] [blame] | 1231 | requires_config_enabled MBEDTLS_ZLIB_SUPPORT | 
|  | 1232 | run_test    "Default (compression enabled)" \ | 
|  | 1233 | "$P_SRV debug_level=3" \ | 
|  | 1234 | "$P_CLI debug_level=3" \ | 
|  | 1235 | 0 \ | 
|  | 1236 | -s "Allocating compression buffer" \ | 
|  | 1237 | -c "Allocating compression buffer" \ | 
|  | 1238 | -s "Record expansion is unknown (compression)" \ | 
|  | 1239 | -c "Record expansion is unknown (compression)" \ | 
|  | 1240 | -S "error" \ | 
|  | 1241 | -C "error" | 
|  | 1242 |  | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1243 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 1244 | run_test    "CA callback on client" \ | 
|  | 1245 | "$P_SRV debug_level=3" \ | 
|  | 1246 | "$P_CLI ca_callback=1 debug_level=3 " \ | 
|  | 1247 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1248 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1249 | -S "error" \ | 
|  | 1250 | -C "error" | 
|  | 1251 |  | 
|  | 1252 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 1253 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1254 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1255 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1256 | run_test    "CA callback on server" \ | 
|  | 1257 | "$P_SRV auth_mode=required" \ | 
|  | 1258 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ | 
|  | 1259 | key_file=data_files/server5.key" \ | 
|  | 1260 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1261 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1262 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 1263 | -S "error" \ | 
|  | 1264 | -C "error" | 
|  | 1265 |  | 
| Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1266 | # Test using an opaque private key for client authentication | 
|  | 1267 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 1268 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C | 
|  | 1269 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 1270 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 1271 | run_test    "Opaque key for client authentication" \ | 
|  | 1272 | "$P_SRV auth_mode=required" \ | 
|  | 1273 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ | 
|  | 1274 | key_file=data_files/server5.key" \ | 
|  | 1275 | 0 \ | 
|  | 1276 | -c "key type: Opaque" \ | 
|  | 1277 | -s "Verifying peer X.509 certificate... ok" \ | 
|  | 1278 | -S "error" \ | 
|  | 1279 | -C "error" | 
|  | 1280 |  | 
| Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1281 | # Test ciphersuites which we expect to be fully supported by PSA Crypto | 
|  | 1282 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. | 
|  | 1283 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM | 
|  | 1284 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 | 
|  | 1285 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM | 
|  | 1286 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 | 
|  | 1287 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 | 
|  | 1288 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 | 
|  | 1289 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA | 
|  | 1290 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 | 
|  | 1291 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 | 
|  | 1292 |  | 
| Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1293 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED | 
|  | 1294 | run_test_psa_force_curve "secp521r1" | 
|  | 1295 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED | 
|  | 1296 | run_test_psa_force_curve "brainpoolP512r1" | 
|  | 1297 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED | 
|  | 1298 | run_test_psa_force_curve "secp384r1" | 
|  | 1299 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED | 
|  | 1300 | run_test_psa_force_curve "brainpoolP384r1" | 
|  | 1301 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED | 
|  | 1302 | run_test_psa_force_curve "secp256r1" | 
|  | 1303 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED | 
|  | 1304 | run_test_psa_force_curve "secp256k1" | 
|  | 1305 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED | 
|  | 1306 | run_test_psa_force_curve "brainpoolP256r1" | 
|  | 1307 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED | 
|  | 1308 | run_test_psa_force_curve "secp224r1" | 
|  | 1309 | requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED | 
|  | 1310 | run_test_psa_force_curve "secp224k1" | 
|  | 1311 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED | 
|  | 1312 | run_test_psa_force_curve "secp192r1" | 
|  | 1313 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED | 
|  | 1314 | run_test_psa_force_curve "secp192k1" | 
|  | 1315 |  | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1316 | # Test current time in ServerHello | 
|  | 1317 | requires_config_enabled MBEDTLS_HAVE_TIME | 
| Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1318 | run_test    "ServerHello contains gmt_unix_time" \ | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1319 | "$P_SRV debug_level=3" \ | 
|  | 1320 | "$P_CLI debug_level=3" \ | 
|  | 1321 | 0 \ | 
| Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1322 | -f "check_server_hello_time" \ | 
|  | 1323 | -F "check_server_hello_time" | 
|  | 1324 |  | 
| Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1325 | # Test for uniqueness of IVs in AEAD ciphersuites | 
|  | 1326 | run_test    "Unique IV in GCM" \ | 
|  | 1327 | "$P_SRV exchanges=20 debug_level=4" \ | 
|  | 1328 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 1329 | 0 \ | 
|  | 1330 | -u "IV used" \ | 
|  | 1331 | -U "IV used" | 
|  | 1332 |  | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1333 | # Tests for certificate verification callback | 
|  | 1334 | run_test    "Configuration-specific CRT verification callback" \ | 
|  | 1335 | "$P_SRV debug_level=3" \ | 
|  | 1336 | "$P_CLI context_crt_cb=0 debug_level=3" \ | 
|  | 1337 | 0 \ | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1338 | -S "error" \ | 
|  | 1339 | -c "Verify requested for " \ | 
|  | 1340 | -c "Use configuration-specific verification callback" \ | 
|  | 1341 | -C "Use context-specific verification callback" \ | 
|  | 1342 | -C "error" | 
|  | 1343 |  | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1344 | run_test    "Context-specific CRT verification callback" \ | 
|  | 1345 | "$P_SRV debug_level=3" \ | 
|  | 1346 | "$P_CLI context_crt_cb=1 debug_level=3" \ | 
|  | 1347 | 0 \ | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1348 | -S "error" \ | 
| Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1349 | -c "Verify requested for " \ | 
|  | 1350 | -c "Use context-specific verification callback" \ | 
|  | 1351 | -C "Use configuration-specific verification callback" \ | 
| Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1352 | -C "error" | 
|  | 1353 |  | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1354 | # Tests for rc4 option | 
|  | 1355 |  | 
| Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1356 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1357 | run_test    "RC4: server disabled, client enabled" \ | 
|  | 1358 | "$P_SRV" \ | 
|  | 1359 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 1360 | 1 \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1361 | -s "SSL - The server has no ciphersuites in common" | 
|  | 1362 |  | 
| Simon Butcher | a410af5 | 2016-05-19 22:12:18 +0100 | [diff] [blame] | 1363 | requires_config_enabled MBEDTLS_REMOVE_ARC4_CIPHERSUITES | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1364 | run_test    "RC4: server half, client enabled" \ | 
|  | 1365 | "$P_SRV arc4=1" \ | 
|  | 1366 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 1367 | 1 \ | 
|  | 1368 | -s "SSL - The server has no ciphersuites in common" | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1369 |  | 
|  | 1370 | run_test    "RC4: server enabled, client disabled" \ | 
|  | 1371 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 1372 | "$P_CLI" \ | 
|  | 1373 | 1 \ | 
|  | 1374 | -s "SSL - The server has no ciphersuites in common" | 
|  | 1375 |  | 
|  | 1376 | run_test    "RC4: both enabled" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 1377 | "$P_SRV force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1378 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 1379 | 0 \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 1380 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | bd47a58 | 2015-01-12 13:43:29 +0100 | [diff] [blame] | 1381 | -S "SSL - The server has no ciphersuites in common" | 
|  | 1382 |  | 
| Hanno Becker | d26bb20 | 2018-08-17 09:54:10 +0100 | [diff] [blame] | 1383 | # Test empty CA list in CertificateRequest in TLS 1.1 and earlier | 
|  | 1384 |  | 
|  | 1385 | requires_gnutls | 
|  | 1386 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 1387 | run_test    "CertificateRequest with empty CA list, TLS 1.1 (GnuTLS server)" \ | 
|  | 1388 | "$G_SRV"\ | 
|  | 1389 | "$P_CLI force_version=tls1_1" \ | 
|  | 1390 | 0 | 
|  | 1391 |  | 
|  | 1392 | requires_gnutls | 
|  | 1393 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 | 
|  | 1394 | run_test    "CertificateRequest with empty CA list, TLS 1.0 (GnuTLS server)" \ | 
|  | 1395 | "$G_SRV"\ | 
|  | 1396 | "$P_CLI force_version=tls1" \ | 
|  | 1397 | 0 | 
|  | 1398 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1399 | # Tests for SHA-1 support | 
|  | 1400 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1401 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1402 | run_test    "SHA-1 forbidden by default in server certificate" \ | 
|  | 1403 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 1404 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 1405 | 1 \ | 
|  | 1406 | -c "The certificate is signed with an unacceptable hash" | 
|  | 1407 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1408 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1409 | run_test    "SHA-1 allowed by default in server certificate" \ | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1410 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 1411 | "$P_CLI debug_level=2 allow_sha1=0" \ | 
|  | 1412 | 0 | 
|  | 1413 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1414 | run_test    "SHA-1 explicitly allowed in server certificate" \ | 
|  | 1415 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ | 
|  | 1416 | "$P_CLI allow_sha1=1" \ | 
|  | 1417 | 0 | 
|  | 1418 |  | 
|  | 1419 | run_test    "SHA-256 allowed by default in server certificate" \ | 
|  | 1420 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ | 
|  | 1421 | "$P_CLI allow_sha1=0" \ | 
|  | 1422 | 0 | 
|  | 1423 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1424 | requires_config_disabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1425 | run_test    "SHA-1 forbidden by default in client certificate" \ | 
|  | 1426 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 1427 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 1428 | 1 \ | 
|  | 1429 | -s "The certificate is signed with an unacceptable hash" | 
|  | 1430 |  | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1431 | requires_config_enabled MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 1432 | run_test    "SHA-1 allowed by default in client certificate" \ | 
| Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 1433 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 1434 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 1435 | 0 | 
|  | 1436 |  | 
| Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1437 | run_test    "SHA-1 explicitly allowed in client certificate" \ | 
|  | 1438 | "$P_SRV auth_mode=required allow_sha1=1" \ | 
|  | 1439 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ | 
|  | 1440 | 0 | 
|  | 1441 |  | 
|  | 1442 | run_test    "SHA-256 allowed by default in client certificate" \ | 
|  | 1443 | "$P_SRV auth_mode=required allow_sha1=0" \ | 
|  | 1444 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ | 
|  | 1445 | 0 | 
|  | 1446 |  | 
| Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1447 | # Tests for datagram packing | 
|  | 1448 | run_test    "DTLS: multiple records in same datagram, client and server" \ | 
|  | 1449 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1450 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1451 | 0 \ | 
|  | 1452 | -c "next record in same datagram" \ | 
|  | 1453 | -s "next record in same datagram" | 
|  | 1454 |  | 
|  | 1455 | run_test    "DTLS: multiple records in same datagram, client only" \ | 
|  | 1456 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1457 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1458 | 0 \ | 
|  | 1459 | -s "next record in same datagram" \ | 
|  | 1460 | -C "next record in same datagram" | 
|  | 1461 |  | 
|  | 1462 | run_test    "DTLS: multiple records in same datagram, server only" \ | 
|  | 1463 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ | 
|  | 1464 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1465 | 0 \ | 
|  | 1466 | -S "next record in same datagram" \ | 
|  | 1467 | -c "next record in same datagram" | 
|  | 1468 |  | 
|  | 1469 | run_test    "DTLS: multiple records in same datagram, neither client nor server" \ | 
|  | 1470 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1471 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 1472 | 0 \ | 
|  | 1473 | -S "next record in same datagram" \ | 
|  | 1474 | -C "next record in same datagram" | 
|  | 1475 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1476 | # Tests for Truncated HMAC extension | 
|  | 1477 |  | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1478 | run_test    "Truncated HMAC: client default, server default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1479 | "$P_SRV debug_level=4" \ | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1480 | "$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] | 1481 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1482 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1483 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 1484 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1485 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1486 | run_test    "Truncated HMAC: client disabled, server default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 1487 | "$P_SRV debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1488 | "$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] | 1489 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1490 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1491 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1492 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1493 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1494 | run_test    "Truncated HMAC: client enabled, server default" \ | 
|  | 1495 | "$P_SRV debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1496 | "$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] | 1497 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1498 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1499 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1500 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1501 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1502 | run_test    "Truncated HMAC: client enabled, server disabled" \ | 
|  | 1503 | "$P_SRV debug_level=4 trunc_hmac=0" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1504 | "$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] | 1505 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1506 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1507 | -S "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1508 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 1509 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Hanno Becker | 34d0c3f | 2017-11-17 15:46:24 +0000 | [diff] [blame] | 1510 | run_test    "Truncated HMAC: client disabled, server enabled" \ | 
|  | 1511 | "$P_SRV debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1512 | "$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] | 1513 | 0 \ | 
|  | 1514 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1515 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1516 |  | 
|  | 1517 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Manuel Pégourié-Gonnard | e117a8f | 2015-01-09 12:39:35 +0100 | [diff] [blame] | 1518 | run_test    "Truncated HMAC: client enabled, server enabled" \ | 
|  | 1519 | "$P_SRV debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1520 | "$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] | 1521 | 0 \ | 
| Hanno Becker | 992b687 | 2017-11-09 18:57:39 +0000 | [diff] [blame] | 1522 | -S "dumping 'expected mac' (20 bytes)" \ | 
|  | 1523 | -s "dumping 'expected mac' (10 bytes)" | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1524 |  | 
| Hanno Becker | 4c4f410 | 2017-11-10 09:16:05 +0000 | [diff] [blame] | 1525 | run_test    "Truncated HMAC, DTLS: client default, server default" \ | 
|  | 1526 | "$P_SRV dtls=1 debug_level=4" \ | 
|  | 1527 | "$P_CLI dtls=1 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 1528 | 0 \ | 
|  | 1529 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1530 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1531 |  | 
|  | 1532 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1533 | run_test    "Truncated HMAC, DTLS: client disabled, server default" \ | 
|  | 1534 | "$P_SRV dtls=1 debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1535 | "$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] | 1536 | 0 \ | 
|  | 1537 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1538 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1539 |  | 
|  | 1540 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1541 | run_test    "Truncated HMAC, DTLS: client enabled, server default" \ | 
|  | 1542 | "$P_SRV dtls=1 debug_level=4" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1543 | "$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] | 1544 | 0 \ | 
|  | 1545 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1546 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1547 |  | 
|  | 1548 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1549 | run_test    "Truncated HMAC, DTLS: client enabled, server disabled" \ | 
|  | 1550 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=0" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1551 | "$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] | 1552 | 0 \ | 
|  | 1553 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1554 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1555 |  | 
|  | 1556 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1557 | run_test    "Truncated HMAC, DTLS: client disabled, server enabled" \ | 
|  | 1558 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1559 | "$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] | 1560 | 0 \ | 
|  | 1561 | -s "dumping 'expected mac' (20 bytes)" \ | 
|  | 1562 | -S "dumping 'expected mac' (10 bytes)" | 
|  | 1563 |  | 
|  | 1564 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 1565 | run_test    "Truncated HMAC, DTLS: client enabled, server enabled" \ | 
|  | 1566 | "$P_SRV dtls=1 debug_level=4 trunc_hmac=1" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 1567 | "$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] | 1568 | 0 \ | 
|  | 1569 | -S "dumping 'expected mac' (20 bytes)" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 1570 | -s "dumping 'expected mac' (10 bytes)" | 
|  | 1571 |  | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1572 | # Tests for Context serialization | 
|  | 1573 |  | 
|  | 1574 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1575 | run_test    "Context serialization, client serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1576 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1577 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1578 | 0 \ | 
|  | 1579 | -c "Deserializing connection..." \ | 
|  | 1580 | -S "Deserializing connection..." | 
|  | 1581 |  | 
|  | 1582 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1583 | run_test    "Context serialization, client serializes, ChaChaPoly" \ | 
|  | 1584 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1585 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1586 | 0 \ | 
|  | 1587 | -c "Deserializing connection..." \ | 
|  | 1588 | -S "Deserializing connection..." | 
|  | 1589 |  | 
|  | 1590 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1591 | run_test    "Context serialization, client serializes, GCM" \ | 
|  | 1592 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1593 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1594 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1595 | -c "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1596 | -S "Deserializing connection..." | 
|  | 1597 |  | 
|  | 1598 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1599 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1600 | run_test    "Context serialization, client serializes, with CID" \ | 
|  | 1601 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1602 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1603 | 0 \ | 
|  | 1604 | -c "Deserializing connection..." \ | 
|  | 1605 | -S "Deserializing connection..." | 
|  | 1606 |  | 
|  | 1607 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1608 | run_test    "Context serialization, server serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1609 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1610 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1611 | 0 \ | 
|  | 1612 | -C "Deserializing connection..." \ | 
|  | 1613 | -s "Deserializing connection..." | 
|  | 1614 |  | 
|  | 1615 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1616 | run_test    "Context serialization, server serializes, ChaChaPoly" \ | 
|  | 1617 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1618 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1619 | 0 \ | 
|  | 1620 | -C "Deserializing connection..." \ | 
|  | 1621 | -s "Deserializing connection..." | 
|  | 1622 |  | 
|  | 1623 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1624 | run_test    "Context serialization, server serializes, GCM" \ | 
|  | 1625 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1626 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1627 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1628 | -C "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1629 | -s "Deserializing connection..." | 
|  | 1630 |  | 
|  | 1631 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1632 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1633 | run_test    "Context serialization, server serializes, with CID" \ | 
|  | 1634 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1635 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1636 | 0 \ | 
|  | 1637 | -C "Deserializing connection..." \ | 
|  | 1638 | -s "Deserializing connection..." | 
|  | 1639 |  | 
|  | 1640 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1641 | run_test    "Context serialization, both serialize, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1642 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1643 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1644 | 0 \ | 
|  | 1645 | -c "Deserializing connection..." \ | 
|  | 1646 | -s "Deserializing connection..." | 
|  | 1647 |  | 
|  | 1648 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1649 | run_test    "Context serialization, both serialize, ChaChaPoly" \ | 
|  | 1650 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1651 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1652 | 0 \ | 
|  | 1653 | -c "Deserializing connection..." \ | 
|  | 1654 | -s "Deserializing connection..." | 
|  | 1655 |  | 
|  | 1656 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1657 | run_test    "Context serialization, both serialize, GCM" \ | 
|  | 1658 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ | 
|  | 1659 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1660 | 0 \ | 
| Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1661 | -c "Deserializing connection..." \ | 
| Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1662 | -s "Deserializing connection..." | 
|  | 1663 |  | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1664 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1665 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1666 | run_test    "Context serialization, both serialize, with CID" \ | 
|  | 1667 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1668 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1669 | 0 \ | 
|  | 1670 | -c "Deserializing connection..." \ | 
|  | 1671 | -s "Deserializing connection..." | 
|  | 1672 |  | 
|  | 1673 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1674 | run_test    "Context serialization, re-init, client serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1675 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1676 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1677 | 0 \ | 
|  | 1678 | -c "Deserializing connection..." \ | 
|  | 1679 | -S "Deserializing connection..." | 
|  | 1680 |  | 
|  | 1681 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1682 | run_test    "Context serialization, re-init, client serializes, ChaChaPoly" \ | 
|  | 1683 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1684 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1685 | 0 \ | 
|  | 1686 | -c "Deserializing connection..." \ | 
|  | 1687 | -S "Deserializing connection..." | 
|  | 1688 |  | 
|  | 1689 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1690 | run_test    "Context serialization, re-init, client serializes, GCM" \ | 
|  | 1691 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ | 
|  | 1692 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1693 | 0 \ | 
|  | 1694 | -c "Deserializing connection..." \ | 
|  | 1695 | -S "Deserializing connection..." | 
|  | 1696 |  | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1697 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1698 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1699 | run_test    "Context serialization, re-init, client serializes, with CID" \ | 
|  | 1700 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1701 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1702 | 0 \ | 
|  | 1703 | -c "Deserializing connection..." \ | 
|  | 1704 | -S "Deserializing connection..." | 
|  | 1705 |  | 
|  | 1706 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1707 | run_test    "Context serialization, re-init, server serializes, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1708 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1709 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1710 | 0 \ | 
|  | 1711 | -C "Deserializing connection..." \ | 
|  | 1712 | -s "Deserializing connection..." | 
|  | 1713 |  | 
|  | 1714 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1715 | run_test    "Context serialization, re-init, server serializes, ChaChaPoly" \ | 
|  | 1716 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1717 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1718 | 0 \ | 
|  | 1719 | -C "Deserializing connection..." \ | 
|  | 1720 | -s "Deserializing connection..." | 
|  | 1721 |  | 
|  | 1722 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1723 | run_test    "Context serialization, re-init, server serializes, GCM" \ | 
|  | 1724 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1725 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1726 | 0 \ | 
|  | 1727 | -C "Deserializing connection..." \ | 
|  | 1728 | -s "Deserializing connection..." | 
|  | 1729 |  | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1730 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1731 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1732 | run_test    "Context serialization, re-init, server serializes, with CID" \ | 
|  | 1733 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1734 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1735 | 0 \ | 
|  | 1736 | -C "Deserializing connection..." \ | 
|  | 1737 | -s "Deserializing connection..." | 
|  | 1738 |  | 
|  | 1739 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1740 | run_test    "Context serialization, re-init, both serialize, CCM" \ | 
| Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1741 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
| Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1742 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1743 | 0 \ | 
|  | 1744 | -c "Deserializing connection..." \ | 
|  | 1745 | -s "Deserializing connection..." | 
|  | 1746 |  | 
|  | 1747 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1748 | run_test    "Context serialization, re-init, both serialize, ChaChaPoly" \ | 
|  | 1749 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1750 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
|  | 1751 | 0 \ | 
|  | 1752 | -c "Deserializing connection..." \ | 
|  | 1753 | -s "Deserializing connection..." | 
|  | 1754 |  | 
|  | 1755 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1756 | run_test    "Context serialization, re-init, both serialize, GCM" \ | 
|  | 1757 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ | 
|  | 1758 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ | 
| Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1759 | 0 \ | 
|  | 1760 | -c "Deserializing connection..." \ | 
|  | 1761 | -s "Deserializing connection..." | 
|  | 1762 |  | 
| Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1763 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1764 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 1765 | run_test    "Context serialization, re-init, both serialize, with CID" \ | 
|  | 1766 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ | 
|  | 1767 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ | 
|  | 1768 | 0 \ | 
|  | 1769 | -c "Deserializing connection..." \ | 
|  | 1770 | -s "Deserializing connection..." | 
|  | 1771 |  | 
| Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1772 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION | 
|  | 1773 | run_test    "Saving the serialized context to a file" \ | 
|  | 1774 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ | 
|  | 1775 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ | 
|  | 1776 | 0 \ | 
|  | 1777 | -s "Save serialized context to a file... ok" \ | 
|  | 1778 | -c "Save serialized context to a file... ok" | 
|  | 1779 | rm -f context_srv.txt | 
|  | 1780 | rm -f context_cli.txt | 
|  | 1781 |  | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1782 | # Tests for DTLS Connection ID extension | 
|  | 1783 |  | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1784 | # So far, the CID API isn't implemented, so we can't | 
|  | 1785 | # grep for output witnessing its use. This needs to be | 
|  | 1786 | # changed once the CID extension is implemented. | 
|  | 1787 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1788 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1789 | run_test    "Connection ID: Cli enabled, Srv disabled" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1790 | "$P_SRV debug_level=3 dtls=1 cid=0" \ | 
|  | 1791 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1792 | 0 \ | 
|  | 1793 | -s "Disable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1794 | -s "found CID extension"           \ | 
|  | 1795 | -s "Client sent CID extension, but CID disabled" \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1796 | -c "Enable use of CID extension."  \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1797 | -c "client hello, adding CID extension" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1798 | -S "server hello, adding CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1799 | -C "found CID extension" \ | 
|  | 1800 | -S "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1801 | -C "Copy CIDs into SSL transform" \ | 
|  | 1802 | -c "Use of Connection ID was rejected by the server" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1803 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1804 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1805 | run_test    "Connection ID: Cli disabled, Srv enabled" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1806 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1807 | "$P_CLI debug_level=3 dtls=1 cid=0" \ | 
|  | 1808 | 0 \ | 
|  | 1809 | -c "Disable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1810 | -C "client hello, adding CID extension"           \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1811 | -S "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1812 | -s "Enable use of CID extension." \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1813 | -S "server hello, adding CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1814 | -C "found CID extension" \ | 
|  | 1815 | -S "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1816 | -C "Copy CIDs into SSL transform"  \ | 
| Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1817 | -s "Use of Connection ID was not offered by client" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1818 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1819 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1820 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1821 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1822 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ | 
|  | 1823 | 0 \ | 
|  | 1824 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1825 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1826 | -c "client hello, adding CID extension" \ | 
|  | 1827 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1828 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1829 | -s "server hello, adding CID extension" \ | 
|  | 1830 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1831 | -c "Use of CID extension negotiated" \ | 
|  | 1832 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1833 | -c "Copy CIDs into SSL transform" \ | 
|  | 1834 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1835 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1836 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1837 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1838 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1839 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1840 | run_test    "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1841 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1842 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ | 
|  | 1843 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ | 
|  | 1844 | 0 \ | 
|  | 1845 | -c "Enable use of CID extension." \ | 
|  | 1846 | -s "Enable use of CID extension." \ | 
|  | 1847 | -c "client hello, adding CID extension" \ | 
|  | 1848 | -s "found CID extension"           \ | 
|  | 1849 | -s "Use of CID extension negotiated" \ | 
|  | 1850 | -s "server hello, adding CID extension" \ | 
|  | 1851 | -c "found CID extension" \ | 
|  | 1852 | -c "Use of CID extension negotiated" \ | 
|  | 1853 | -s "Copy CIDs into SSL transform" \ | 
|  | 1854 | -c "Copy CIDs into SSL transform" \ | 
|  | 1855 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1856 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1857 | -s "Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1858 | -c "Use of Connection ID has been negotiated" \ | 
|  | 1859 | -c "ignoring unexpected CID" \ | 
|  | 1860 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1861 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1862 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1863 | run_test    "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
|  | 1864 | -p "$P_PXY mtu=800" \ | 
|  | 1865 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1866 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ | 
|  | 1867 | 0 \ | 
|  | 1868 | -c "Enable use of CID extension." \ | 
|  | 1869 | -s "Enable use of CID extension." \ | 
|  | 1870 | -c "client hello, adding CID extension" \ | 
|  | 1871 | -s "found CID extension"           \ | 
|  | 1872 | -s "Use of CID extension negotiated" \ | 
|  | 1873 | -s "server hello, adding CID extension" \ | 
|  | 1874 | -c "found CID extension" \ | 
|  | 1875 | -c "Use of CID extension negotiated" \ | 
|  | 1876 | -s "Copy CIDs into SSL transform" \ | 
|  | 1877 | -c "Copy CIDs into SSL transform" \ | 
|  | 1878 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1879 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1880 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1881 | -c "Use of Connection ID has been negotiated" | 
|  | 1882 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1883 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1884 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1885 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1886 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1887 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ | 
|  | 1888 | 0 \ | 
|  | 1889 | -c "Enable use of CID extension." \ | 
|  | 1890 | -s "Enable use of CID extension." \ | 
|  | 1891 | -c "client hello, adding CID extension" \ | 
|  | 1892 | -s "found CID extension"           \ | 
|  | 1893 | -s "Use of CID extension negotiated" \ | 
|  | 1894 | -s "server hello, adding CID extension" \ | 
|  | 1895 | -c "found CID extension" \ | 
|  | 1896 | -c "Use of CID extension negotiated" \ | 
|  | 1897 | -s "Copy CIDs into SSL transform" \ | 
|  | 1898 | -c "Copy CIDs into SSL transform" \ | 
|  | 1899 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1900 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1901 | -s "Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1902 | -c "Use of Connection ID has been negotiated" \ | 
|  | 1903 | -c "ignoring unexpected CID" \ | 
|  | 1904 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1905 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1906 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1907 | run_test    "Connection ID: Cli+Srv enabled, Cli CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1908 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1909 | "$P_CLI debug_level=3 dtls=1 cid=1" \ | 
|  | 1910 | 0 \ | 
|  | 1911 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1912 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1913 | -c "client hello, adding CID extension" \ | 
|  | 1914 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1915 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1916 | -s "server hello, adding CID extension" \ | 
|  | 1917 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1918 | -c "Use of CID extension negotiated" \ | 
|  | 1919 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1920 | -c "Copy CIDs into SSL transform" \ | 
|  | 1921 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 1922 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 1923 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1924 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1925 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1926 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1927 | run_test    "Connection ID: Cli+Srv enabled, Srv CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1928 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 1929 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1930 | 0 \ | 
|  | 1931 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1932 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1933 | -c "client hello, adding CID extension" \ | 
|  | 1934 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1935 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1936 | -s "server hello, adding CID extension" \ | 
|  | 1937 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1938 | -c "Use of CID extension negotiated" \ | 
|  | 1939 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1940 | -c "Copy CIDs into SSL transform" \ | 
|  | 1941 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 1942 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 1943 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1944 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1945 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1946 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1947 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1948 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 1949 | "$P_CLI debug_level=3 dtls=1 cid=1" \ | 
|  | 1950 | 0 \ | 
|  | 1951 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1952 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1953 | -c "client hello, adding CID extension" \ | 
|  | 1954 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1955 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1956 | -s "server hello, adding CID extension" \ | 
|  | 1957 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1958 | -c "Use of CID extension negotiated" \ | 
|  | 1959 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1960 | -c "Copy CIDs into SSL transform" \ | 
|  | 1961 | -S "Use of Connection ID has been negotiated" \ | 
|  | 1962 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1963 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1964 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1965 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CCM-8" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1966 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 1967 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1968 | 0 \ | 
|  | 1969 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1970 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1971 | -c "client hello, adding CID extension" \ | 
|  | 1972 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1973 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1974 | -s "server hello, adding CID extension" \ | 
|  | 1975 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1976 | -c "Use of CID extension negotiated" \ | 
|  | 1977 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1978 | -c "Copy CIDs into SSL transform" \ | 
|  | 1979 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 1980 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 1981 | -s "Use of Connection ID has been negotiated" \ | 
|  | 1982 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1983 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1984 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1985 | run_test    "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CCM-8" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1986 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 1987 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 1988 | 0 \ | 
|  | 1989 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1990 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1991 | -c "client hello, adding CID extension" \ | 
|  | 1992 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1993 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1994 | -s "server hello, adding CID extension" \ | 
|  | 1995 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1996 | -c "Use of CID extension negotiated" \ | 
|  | 1997 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1998 | -c "Copy CIDs into SSL transform" \ | 
|  | 1999 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2000 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 2001 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2002 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2003 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2004 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2005 | run_test    "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CCM-8" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2006 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2007 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2008 | 0 \ | 
|  | 2009 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2010 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2011 | -c "client hello, adding CID extension" \ | 
|  | 2012 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2013 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2014 | -s "server hello, adding CID extension" \ | 
|  | 2015 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2016 | -c "Use of CID extension negotiated" \ | 
|  | 2017 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2018 | -c "Copy CIDs into SSL transform" \ | 
|  | 2019 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2020 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 2021 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2022 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2023 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2024 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2025 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CCM-8" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2026 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2027 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 2028 | 0 \ | 
|  | 2029 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2030 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2031 | -c "client hello, adding CID extension" \ | 
|  | 2032 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2033 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2034 | -s "server hello, adding CID extension" \ | 
|  | 2035 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2036 | -c "Use of CID extension negotiated" \ | 
|  | 2037 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2038 | -c "Copy CIDs into SSL transform" \ | 
|  | 2039 | -S "Use of Connection ID has been negotiated" \ | 
|  | 2040 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2041 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2042 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2043 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2044 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ | 
|  | 2045 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2046 | 0 \ | 
|  | 2047 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2048 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2049 | -c "client hello, adding CID extension" \ | 
|  | 2050 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2051 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2052 | -s "server hello, adding CID extension" \ | 
|  | 2053 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2054 | -c "Use of CID extension negotiated" \ | 
|  | 2055 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2056 | -c "Copy CIDs into SSL transform" \ | 
|  | 2057 | -c "Peer CID (length 2 Bytes): de ad" \ | 
|  | 2058 | -s "Peer CID (length 2 Bytes): be ef" \ | 
|  | 2059 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2060 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2061 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2062 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2063 | run_test    "Connection ID: Cli+Srv enabled, Cli CID empty, AES-128-CBC" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2064 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ | 
|  | 2065 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2066 | 0 \ | 
|  | 2067 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2068 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2069 | -c "client hello, adding CID extension" \ | 
|  | 2070 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2071 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2072 | -s "server hello, adding CID extension" \ | 
|  | 2073 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2074 | -c "Use of CID extension negotiated" \ | 
|  | 2075 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2076 | -c "Copy CIDs into SSL transform" \ | 
|  | 2077 | -c "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2078 | -s "Peer CID (length 0 Bytes):" \ | 
|  | 2079 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2080 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2081 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2082 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2083 | run_test    "Connection ID: Cli+Srv enabled, Srv CID empty, AES-128-CBC" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2084 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2085 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2086 | 0 \ | 
|  | 2087 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2088 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2089 | -c "client hello, adding CID extension" \ | 
|  | 2090 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2091 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2092 | -s "server hello, adding CID extension" \ | 
|  | 2093 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2094 | -c "Use of CID extension negotiated" \ | 
|  | 2095 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2096 | -c "Copy CIDs into SSL transform" \ | 
|  | 2097 | -s "Peer CID (length 4 Bytes): de ad be ef" \ | 
|  | 2098 | -c "Peer CID (length 0 Bytes):" \ | 
|  | 2099 | -s "Use of Connection ID has been negotiated" \ | 
|  | 2100 | -c "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2101 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2102 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2103 | run_test    "Connection ID: Cli+Srv enabled, Cli+Srv CID empty, AES-128-CBC" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2104 | "$P_SRV debug_level=3 dtls=1 cid=1" \ | 
|  | 2105 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 2106 | 0 \ | 
|  | 2107 | -c "Enable use of CID extension." \ | 
| Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2108 | -s "Enable use of CID extension." \ | 
| Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2109 | -c "client hello, adding CID extension" \ | 
|  | 2110 | -s "found CID extension"           \ | 
| Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2111 | -s "Use of CID extension negotiated" \ | 
| Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2112 | -s "server hello, adding CID extension" \ | 
|  | 2113 | -c "found CID extension" \ | 
| Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2114 | -c "Use of CID extension negotiated" \ | 
|  | 2115 | -s "Copy CIDs into SSL transform" \ | 
| Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2116 | -c "Copy CIDs into SSL transform" \ | 
|  | 2117 | -S "Use of Connection ID has been negotiated" \ | 
|  | 2118 | -C "Use of Connection ID has been negotiated" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2119 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2120 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2121 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2122 | run_test    "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ | 
| Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2123 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 2124 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 2125 | 0 \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2126 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2127 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2128 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2129 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2130 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2131 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2132 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2133 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2134 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2135 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2136 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2137 | run_test    "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2138 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 2139 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 2140 | 0 \ | 
|  | 2141 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2142 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2143 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2144 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2145 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2146 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2147 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2148 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2149 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2150 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2151 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2152 | run_test    "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ | 
|  | 2153 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 2154 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 2155 | 0 \ | 
|  | 2156 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2157 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2158 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2159 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2160 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2161 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2162 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2163 | -c "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2164 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2165 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2166 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2167 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate with different CID" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2168 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2169 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ | 
|  | 2170 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ | 
|  | 2171 | 0 \ | 
|  | 2172 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2173 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2174 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2175 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2176 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2177 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2178 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2179 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2180 | -c "ignoring unexpected CID" \ | 
|  | 2181 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2182 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2183 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2184 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2185 | run_test    "Connection ID: Cli+Srv enabled, renegotiate without CID" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2186 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2187 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2188 | 0 \ | 
|  | 2189 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2190 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2191 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2192 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2193 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2194 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2195 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2196 | -S "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2197 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2198 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2199 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2200 | run_test    "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ | 
|  | 2201 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2202 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2203 | 0 \ | 
|  | 2204 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2205 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2206 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2207 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2208 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2209 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2210 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2211 | -S "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2212 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2213 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2214 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2215 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2216 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2217 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2218 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2219 | 0 \ | 
|  | 2220 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2221 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2222 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2223 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2224 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2225 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2226 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2227 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2228 | -c "ignoring unexpected CID" \ | 
|  | 2229 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2230 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2231 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2232 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2233 | run_test    "Connection ID: Cli+Srv enabled, CID on renegotiation" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2234 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 2235 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ | 
|  | 2236 | 0 \ | 
|  | 2237 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2238 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2239 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2240 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2241 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2242 | -s "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2243 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2244 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2245 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2246 | run_test    "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ | 
|  | 2247 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 2248 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ | 
|  | 2249 | 0 \ | 
|  | 2250 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2251 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2252 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2253 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2254 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2255 | -s "(after renegotiation) Use of Connection ID has been negotiated" | 
|  | 2256 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2257 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2258 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2259 | run_test    "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2260 | -p "$P_PXY mtu=800 drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2261 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ | 
|  | 2262 | "$P_CLI debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ | 
|  | 2263 | 0 \ | 
|  | 2264 | -S "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2265 | -C "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2266 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2267 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2268 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2269 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2270 | -c "ignoring unexpected CID" \ | 
|  | 2271 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2272 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2273 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2274 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2275 | run_test    "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2276 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 2277 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2278 | 0 \ | 
|  | 2279 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2280 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2281 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2282 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2283 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2284 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2285 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2286 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2287 | -s "(after renegotiation) Use of Connection ID was not offered by client" | 
|  | 2288 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2289 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2290 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2291 | run_test    "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2292 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2293 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ | 
|  | 2294 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ | 
|  | 2295 | 0 \ | 
|  | 2296 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2297 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2298 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2299 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2300 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2301 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2302 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2303 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2304 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ | 
|  | 2305 | -c "ignoring unexpected CID" \ | 
|  | 2306 | -s "ignoring unexpected CID" | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2307 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2308 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2309 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2310 | run_test    "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ | 
|  | 2311 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2312 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 2313 | 0 \ | 
|  | 2314 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2315 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2316 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2317 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2318 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2319 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2320 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2321 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2322 | -c "(after renegotiation) Use of Connection ID was rejected by the server" | 
|  | 2323 |  | 
| Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2324 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
| Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2325 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 2326 | run_test    "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2327 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ | 
| Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2328 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ | 
|  | 2329 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ | 
|  | 2330 | 0 \ | 
|  | 2331 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2332 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2333 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2334 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2335 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2336 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2337 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ | 
|  | 2338 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ | 
| Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2339 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ | 
|  | 2340 | -c "ignoring unexpected CID" \ | 
|  | 2341 | -s "ignoring unexpected CID" | 
| Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2342 |  | 
| Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2343 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2344 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH | 
|  | 2345 | run_test    "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ | 
|  | 2346 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ | 
|  | 2347 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ | 
|  | 2348 | 0 \ | 
|  | 2349 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2350 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2351 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2352 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2353 | -s "Reallocating in_buf" \ | 
|  | 2354 | -s "Reallocating out_buf" | 
|  | 2355 |  | 
|  | 2356 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID | 
|  | 2357 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH | 
|  | 2358 | run_test    "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ | 
|  | 2359 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ | 
|  | 2360 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ | 
|  | 2361 | 0 \ | 
|  | 2362 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ | 
|  | 2363 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ | 
|  | 2364 | -s "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2365 | -c "(initial handshake) Use of Connection ID has been negotiated" \ | 
|  | 2366 | -s "Reallocating in_buf" \ | 
|  | 2367 | -s "Reallocating out_buf" | 
|  | 2368 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2369 | # Tests for Encrypt-then-MAC extension | 
|  | 2370 |  | 
|  | 2371 | run_test    "Encrypt then MAC: default" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2372 | "$P_SRV debug_level=3 \ | 
|  | 2373 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2374 | "$P_CLI debug_level=3" \ | 
|  | 2375 | 0 \ | 
|  | 2376 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2377 | -s "found encrypt then mac extension" \ | 
|  | 2378 | -s "server hello, adding encrypt then mac extension" \ | 
|  | 2379 | -c "found encrypt_then_mac extension" \ | 
|  | 2380 | -c "using encrypt then mac" \ | 
|  | 2381 | -s "using encrypt then mac" | 
|  | 2382 |  | 
|  | 2383 | run_test    "Encrypt then MAC: client enabled, server disabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2384 | "$P_SRV debug_level=3 etm=0 \ | 
|  | 2385 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2386 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 2387 | 0 \ | 
|  | 2388 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2389 | -s "found encrypt then mac extension" \ | 
|  | 2390 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2391 | -C "found encrypt_then_mac extension" \ | 
|  | 2392 | -C "using encrypt then mac" \ | 
|  | 2393 | -S "using encrypt then mac" | 
|  | 2394 |  | 
| Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2395 | run_test    "Encrypt then MAC: client enabled, aead cipher" \ | 
|  | 2396 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 2397 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 2398 | "$P_CLI debug_level=3 etm=1" \ | 
|  | 2399 | 0 \ | 
|  | 2400 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2401 | -s "found encrypt then mac extension" \ | 
|  | 2402 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2403 | -C "found encrypt_then_mac extension" \ | 
|  | 2404 | -C "using encrypt then mac" \ | 
|  | 2405 | -S "using encrypt then mac" | 
|  | 2406 |  | 
|  | 2407 | run_test    "Encrypt then MAC: client enabled, stream cipher" \ | 
|  | 2408 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 2409 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 2410 | "$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] | 2411 | 0 \ | 
|  | 2412 | -c "client hello, adding encrypt_then_mac extension" \ | 
|  | 2413 | -s "found encrypt then mac extension" \ | 
|  | 2414 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2415 | -C "found encrypt_then_mac extension" \ | 
|  | 2416 | -C "using encrypt then mac" \ | 
|  | 2417 | -S "using encrypt then mac" | 
|  | 2418 |  | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2419 | run_test    "Encrypt then MAC: client disabled, server enabled" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2420 | "$P_SRV debug_level=3 etm=1 \ | 
|  | 2421 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2422 | "$P_CLI debug_level=3 etm=0" \ | 
|  | 2423 | 0 \ | 
|  | 2424 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 2425 | -S "found encrypt then mac extension" \ | 
|  | 2426 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2427 | -C "found encrypt_then_mac extension" \ | 
|  | 2428 | -C "using encrypt then mac" \ | 
|  | 2429 | -S "using encrypt then mac" | 
|  | 2430 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2431 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2432 | run_test    "Encrypt then MAC: client SSLv3, server enabled" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2433 | "$P_SRV debug_level=3 min_version=ssl3 \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2434 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2435 | "$P_CLI debug_level=3 force_version=ssl3" \ | 
|  | 2436 | 0 \ | 
|  | 2437 | -C "client hello, adding encrypt_then_mac extension" \ | 
|  | 2438 | -S "found encrypt then mac extension" \ | 
|  | 2439 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2440 | -C "found encrypt_then_mac extension" \ | 
|  | 2441 | -C "using encrypt then mac" \ | 
|  | 2442 | -S "using encrypt then mac" | 
|  | 2443 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2444 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2445 | run_test    "Encrypt then MAC: client enabled, server SSLv3" \ | 
| Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2446 | "$P_SRV debug_level=3 force_version=ssl3 \ | 
|  | 2447 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2448 | "$P_CLI debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2449 | 0 \ | 
|  | 2450 | -c "client hello, adding encrypt_then_mac extension" \ | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2451 | -S "found encrypt then mac extension" \ | 
| Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2452 | -S "server hello, adding encrypt then mac extension" \ | 
|  | 2453 | -C "found encrypt_then_mac extension" \ | 
|  | 2454 | -C "using encrypt then mac" \ | 
|  | 2455 | -S "using encrypt then mac" | 
|  | 2456 |  | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2457 | # Tests for Extended Master Secret extension | 
|  | 2458 |  | 
|  | 2459 | run_test    "Extended Master Secret: default" \ | 
|  | 2460 | "$P_SRV debug_level=3" \ | 
|  | 2461 | "$P_CLI debug_level=3" \ | 
|  | 2462 | 0 \ | 
|  | 2463 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 2464 | -s "found extended master secret extension" \ | 
|  | 2465 | -s "server hello, adding extended master secret extension" \ | 
|  | 2466 | -c "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2467 | -c "session hash for extended master secret" \ | 
|  | 2468 | -s "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2469 |  | 
|  | 2470 | run_test    "Extended Master Secret: client enabled, server disabled" \ | 
|  | 2471 | "$P_SRV debug_level=3 extended_ms=0" \ | 
|  | 2472 | "$P_CLI debug_level=3 extended_ms=1" \ | 
|  | 2473 | 0 \ | 
|  | 2474 | -c "client hello, adding extended_master_secret extension" \ | 
|  | 2475 | -s "found extended master secret extension" \ | 
|  | 2476 | -S "server hello, adding extended master secret extension" \ | 
|  | 2477 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2478 | -C "session hash for extended master secret" \ | 
|  | 2479 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2480 |  | 
|  | 2481 | run_test    "Extended Master Secret: client disabled, server enabled" \ | 
|  | 2482 | "$P_SRV debug_level=3 extended_ms=1" \ | 
|  | 2483 | "$P_CLI debug_level=3 extended_ms=0" \ | 
|  | 2484 | 0 \ | 
|  | 2485 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 2486 | -S "found extended master secret extension" \ | 
|  | 2487 | -S "server hello, adding extended master secret extension" \ | 
|  | 2488 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2489 | -C "session hash for extended master secret" \ | 
|  | 2490 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2491 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2492 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2493 | run_test    "Extended Master Secret: client SSLv3, server enabled" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2494 | "$P_SRV debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2495 | "$P_CLI debug_level=3 force_version=ssl3" \ | 
|  | 2496 | 0 \ | 
|  | 2497 | -C "client hello, adding extended_master_secret extension" \ | 
|  | 2498 | -S "found extended master secret extension" \ | 
|  | 2499 | -S "server hello, adding extended master secret extension" \ | 
|  | 2500 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2501 | -C "session hash for extended master secret" \ | 
|  | 2502 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2503 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2504 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2505 | run_test    "Extended Master Secret: client enabled, server SSLv3" \ | 
|  | 2506 | "$P_SRV debug_level=3 force_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2507 | "$P_CLI debug_level=3 min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2508 | 0 \ | 
|  | 2509 | -c "client hello, adding extended_master_secret extension" \ | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 2510 | -S "found extended master secret extension" \ | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2511 | -S "server hello, adding extended master secret extension" \ | 
|  | 2512 | -C "found extended_master_secret extension" \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2513 | -C "session hash for extended master secret" \ | 
|  | 2514 | -S "session hash for extended master secret" | 
| Manuel Pégourié-Gonnard | b575b54 | 2014-10-24 15:12:31 +0200 | [diff] [blame] | 2515 |  | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2516 | # Tests for FALLBACK_SCSV | 
|  | 2517 |  | 
|  | 2518 | run_test    "Fallback SCSV: default" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2519 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2520 | "$P_CLI debug_level=3 force_version=tls1_1" \ | 
|  | 2521 | 0 \ | 
|  | 2522 | -C "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2523 | -S "received FALLBACK_SCSV" \ | 
|  | 2524 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2525 | -C "is a fatal alert message (msg 86)" | 
|  | 2526 |  | 
|  | 2527 | run_test    "Fallback SCSV: explicitly disabled" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2528 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2529 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ | 
|  | 2530 | 0 \ | 
|  | 2531 | -C "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2532 | -S "received FALLBACK_SCSV" \ | 
|  | 2533 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2534 | -C "is a fatal alert message (msg 86)" | 
|  | 2535 |  | 
|  | 2536 | run_test    "Fallback SCSV: enabled" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2537 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2538 | "$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] | 2539 | 1 \ | 
|  | 2540 | -c "adding FALLBACK_SCSV" \ | 
|  | 2541 | -s "received FALLBACK_SCSV" \ | 
|  | 2542 | -s "inapropriate fallback" \ | 
|  | 2543 | -c "is a fatal alert message (msg 86)" | 
|  | 2544 |  | 
|  | 2545 | run_test    "Fallback SCSV: enabled, max version" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2546 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2547 | "$P_CLI debug_level=3 fallback=1" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2548 | 0 \ | 
|  | 2549 | -c "adding FALLBACK_SCSV" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2550 | -s "received FALLBACK_SCSV" \ | 
|  | 2551 | -S "inapropriate fallback" \ | 
| Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 2552 | -C "is a fatal alert message (msg 86)" | 
|  | 2553 |  | 
|  | 2554 | requires_openssl_with_fallback_scsv | 
|  | 2555 | run_test    "Fallback SCSV: default, openssl server" \ | 
|  | 2556 | "$O_SRV" \ | 
|  | 2557 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=0" \ | 
|  | 2558 | 0 \ | 
|  | 2559 | -C "adding FALLBACK_SCSV" \ | 
|  | 2560 | -C "is a fatal alert message (msg 86)" | 
|  | 2561 |  | 
|  | 2562 | requires_openssl_with_fallback_scsv | 
|  | 2563 | run_test    "Fallback SCSV: enabled, openssl server" \ | 
|  | 2564 | "$O_SRV" \ | 
|  | 2565 | "$P_CLI debug_level=3 force_version=tls1_1 fallback=1" \ | 
|  | 2566 | 1 \ | 
|  | 2567 | -c "adding FALLBACK_SCSV" \ | 
|  | 2568 | -c "is a fatal alert message (msg 86)" | 
|  | 2569 |  | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2570 | requires_openssl_with_fallback_scsv | 
|  | 2571 | run_test    "Fallback SCSV: disabled, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2572 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2573 | "$O_CLI -tls1_1" \ | 
|  | 2574 | 0 \ | 
|  | 2575 | -S "received FALLBACK_SCSV" \ | 
|  | 2576 | -S "inapropriate fallback" | 
|  | 2577 |  | 
|  | 2578 | requires_openssl_with_fallback_scsv | 
|  | 2579 | run_test    "Fallback SCSV: enabled, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2580 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2581 | "$O_CLI -tls1_1 -fallback_scsv" \ | 
|  | 2582 | 1 \ | 
|  | 2583 | -s "received FALLBACK_SCSV" \ | 
|  | 2584 | -s "inapropriate fallback" | 
|  | 2585 |  | 
|  | 2586 | requires_openssl_with_fallback_scsv | 
|  | 2587 | run_test    "Fallback SCSV: enabled, max version, openssl client" \ | 
| Manuel Pégourié-Gonnard | 4268ae0 | 2015-08-04 12:44:10 +0200 | [diff] [blame] | 2588 | "$P_SRV debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 01b2699 | 2014-10-20 14:05:28 +0200 | [diff] [blame] | 2589 | "$O_CLI -fallback_scsv" \ | 
|  | 2590 | 0 \ | 
|  | 2591 | -s "received FALLBACK_SCSV" \ | 
|  | 2592 | -S "inapropriate fallback" | 
|  | 2593 |  | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2594 | # Test sending and receiving empty application data records | 
|  | 2595 |  | 
|  | 2596 | run_test    "Encrypt then MAC: empty application data record" \ | 
|  | 2597 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ | 
|  | 2598 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 2599 | 0 \ | 
|  | 2600 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 2601 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2602 | -c "0 bytes written in 1 fragments" | 
|  | 2603 |  | 
| Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2604 | run_test    "Encrypt then MAC: disabled, empty application data record" \ | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2605 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ | 
|  | 2606 | "$P_CLI auth_mode=none etm=0 request_size=0" \ | 
|  | 2607 | 0 \ | 
|  | 2608 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2609 | -c "0 bytes written in 1 fragments" | 
|  | 2610 |  | 
|  | 2611 | run_test    "Encrypt then MAC, DTLS: empty application data record" \ | 
|  | 2612 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ | 
|  | 2613 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ | 
|  | 2614 | 0 \ | 
|  | 2615 | -S "0000:  0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ | 
|  | 2616 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2617 | -c "0 bytes written in 1 fragments" | 
|  | 2618 |  | 
| Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2619 | run_test    "Encrypt then MAC, DTLS: disabled, empty application data record" \ | 
| Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2620 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ | 
|  | 2621 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ | 
|  | 2622 | 0 \ | 
|  | 2623 | -s "dumping 'input payload after decrypt' (0 bytes)" \ | 
|  | 2624 | -c "0 bytes written in 1 fragments" | 
|  | 2625 |  | 
| Gilles Peskine | d50177f | 2017-05-16 17:53:03 +0200 | [diff] [blame] | 2626 | ## ClientHello generated with | 
|  | 2627 | ## "openssl s_client -CAfile tests/data_files/test-ca.crt -tls1_1 -connect localhost:4433 -cipher ..." | 
|  | 2628 | ## then manually twiddling the ciphersuite list. | 
|  | 2629 | ## The ClientHello content is spelled out below as a hex string as | 
|  | 2630 | ## "prefix ciphersuite1 ciphersuite2 ciphersuite3 ciphersuite4 suffix". | 
|  | 2631 | ## The expected response is an inappropriate_fallback alert. | 
|  | 2632 | requires_openssl_with_fallback_scsv | 
|  | 2633 | run_test    "Fallback SCSV: beginning of list" \ | 
|  | 2634 | "$P_SRV debug_level=2" \ | 
|  | 2635 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 5600 0031 0032 0033 0100000900230000000f000101' '15030200020256'" \ | 
|  | 2636 | 0 \ | 
|  | 2637 | -s "received FALLBACK_SCSV" \ | 
|  | 2638 | -s "inapropriate fallback" | 
|  | 2639 |  | 
|  | 2640 | requires_openssl_with_fallback_scsv | 
|  | 2641 | run_test    "Fallback SCSV: end of list" \ | 
|  | 2642 | "$P_SRV debug_level=2" \ | 
|  | 2643 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0031 0032 0033 5600 0100000900230000000f000101' '15030200020256'" \ | 
|  | 2644 | 0 \ | 
|  | 2645 | -s "received FALLBACK_SCSV" \ | 
|  | 2646 | -s "inapropriate fallback" | 
|  | 2647 |  | 
|  | 2648 | ## Here the expected response is a valid ServerHello prefix, up to the random. | 
|  | 2649 | requires_openssl_with_fallback_scsv | 
|  | 2650 | run_test    "Fallback SCSV: not in list" \ | 
|  | 2651 | "$P_SRV debug_level=2" \ | 
|  | 2652 | "$TCP_CLIENT localhost $SRV_PORT '160301003e0100003a03022aafb94308dc22ca1086c65acc00e414384d76b61ecab37df1633b1ae1034dbe000008 0056 0031 0032 0033 0100000900230000000f000101' '16030200300200002c0302'" \ | 
|  | 2653 | 0 \ | 
|  | 2654 | -S "received FALLBACK_SCSV" \ | 
|  | 2655 | -S "inapropriate fallback" | 
|  | 2656 |  | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2657 | # Tests for CBC 1/n-1 record splitting | 
|  | 2658 |  | 
|  | 2659 | run_test    "CBC Record splitting: TLS 1.2, no splitting" \ | 
|  | 2660 | "$P_SRV" \ | 
|  | 2661 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2662 | request_size=123 force_version=tls1_2" \ | 
|  | 2663 | 0 \ | 
|  | 2664 | -s "Read from client: 123 bytes read" \ | 
|  | 2665 | -S "Read from client: 1 bytes read" \ | 
|  | 2666 | -S "122 bytes read" | 
|  | 2667 |  | 
|  | 2668 | run_test    "CBC Record splitting: TLS 1.1, no splitting" \ | 
|  | 2669 | "$P_SRV" \ | 
|  | 2670 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2671 | request_size=123 force_version=tls1_1" \ | 
|  | 2672 | 0 \ | 
|  | 2673 | -s "Read from client: 123 bytes read" \ | 
|  | 2674 | -S "Read from client: 1 bytes read" \ | 
|  | 2675 | -S "122 bytes read" | 
|  | 2676 |  | 
|  | 2677 | run_test    "CBC Record splitting: TLS 1.0, splitting" \ | 
|  | 2678 | "$P_SRV" \ | 
|  | 2679 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2680 | request_size=123 force_version=tls1" \ | 
|  | 2681 | 0 \ | 
|  | 2682 | -S "Read from client: 123 bytes read" \ | 
|  | 2683 | -s "Read from client: 1 bytes read" \ | 
|  | 2684 | -s "122 bytes read" | 
|  | 2685 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 2686 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2687 | run_test    "CBC Record splitting: SSLv3, splitting" \ | 
| Manuel Pégourié-Gonnard | 51d8166 | 2015-01-14 17:20:46 +0100 | [diff] [blame] | 2688 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2689 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2690 | request_size=123 force_version=ssl3" \ | 
|  | 2691 | 0 \ | 
|  | 2692 | -S "Read from client: 123 bytes read" \ | 
|  | 2693 | -s "Read from client: 1 bytes read" \ | 
|  | 2694 | -s "122 bytes read" | 
|  | 2695 |  | 
|  | 2696 | 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] | 2697 | "$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] | 2698 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 2699 | request_size=123 force_version=tls1" \ | 
|  | 2700 | 0 \ | 
|  | 2701 | -s "Read from client: 123 bytes read" \ | 
|  | 2702 | -S "Read from client: 1 bytes read" \ | 
|  | 2703 | -S "122 bytes read" | 
|  | 2704 |  | 
|  | 2705 | run_test    "CBC Record splitting: TLS 1.0, splitting disabled" \ | 
|  | 2706 | "$P_SRV" \ | 
|  | 2707 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2708 | request_size=123 force_version=tls1 recsplit=0" \ | 
|  | 2709 | 0 \ | 
|  | 2710 | -s "Read from client: 123 bytes read" \ | 
|  | 2711 | -S "Read from client: 1 bytes read" \ | 
|  | 2712 | -S "122 bytes read" | 
|  | 2713 |  | 
| Manuel Pégourié-Gonnard | a852cf4 | 2015-01-13 20:56:15 +0100 | [diff] [blame] | 2714 | run_test    "CBC Record splitting: TLS 1.0, splitting, nbio" \ | 
|  | 2715 | "$P_SRV nbio=2" \ | 
|  | 2716 | "$P_CLI nbio=2 force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 2717 | request_size=123 force_version=tls1" \ | 
|  | 2718 | 0 \ | 
|  | 2719 | -S "Read from client: 123 bytes read" \ | 
|  | 2720 | -s "Read from client: 1 bytes read" \ | 
|  | 2721 | -s "122 bytes read" | 
|  | 2722 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2723 | # Tests for Session Tickets | 
|  | 2724 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2725 | run_test    "Session resume using tickets: basic" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2726 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 2727 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2728 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2729 | -c "client hello, adding session ticket extension" \ | 
|  | 2730 | -s "found session ticket extension" \ | 
|  | 2731 | -s "server hello, adding session ticket extension" \ | 
|  | 2732 | -c "found session_ticket extension" \ | 
|  | 2733 | -c "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2734 | -S "session successfully restored from cache" \ | 
|  | 2735 | -s "session successfully restored from ticket" \ | 
|  | 2736 | -s "a session has been resumed" \ | 
|  | 2737 | -c "a session has been resumed" | 
|  | 2738 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2739 | run_test    "Session resume using tickets: cache disabled" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2740 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
|  | 2741 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2742 | 0 \ | 
|  | 2743 | -c "client hello, adding session ticket extension" \ | 
|  | 2744 | -s "found session ticket extension" \ | 
|  | 2745 | -s "server hello, adding session ticket extension" \ | 
|  | 2746 | -c "found session_ticket extension" \ | 
|  | 2747 | -c "parse new session ticket" \ | 
|  | 2748 | -S "session successfully restored from cache" \ | 
|  | 2749 | -s "session successfully restored from ticket" \ | 
|  | 2750 | -s "a session has been resumed" \ | 
|  | 2751 | -c "a session has been resumed" | 
|  | 2752 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2753 | run_test    "Session resume using tickets: timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2754 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ | 
|  | 2755 | "$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] | 2756 | 0 \ | 
|  | 2757 | -c "client hello, adding session ticket extension" \ | 
|  | 2758 | -s "found session ticket extension" \ | 
|  | 2759 | -s "server hello, adding session ticket extension" \ | 
|  | 2760 | -c "found session_ticket extension" \ | 
|  | 2761 | -c "parse new session ticket" \ | 
|  | 2762 | -S "session successfully restored from cache" \ | 
|  | 2763 | -S "session successfully restored from ticket" \ | 
|  | 2764 | -S "a session has been resumed" \ | 
|  | 2765 | -C "a session has been resumed" | 
|  | 2766 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2767 | run_test    "Session resume using tickets: session copy" \ | 
|  | 2768 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ | 
|  | 2769 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ | 
|  | 2770 | 0 \ | 
|  | 2771 | -c "client hello, adding session ticket extension" \ | 
|  | 2772 | -s "found session ticket extension" \ | 
|  | 2773 | -s "server hello, adding session ticket extension" \ | 
|  | 2774 | -c "found session_ticket extension" \ | 
|  | 2775 | -c "parse new session ticket" \ | 
|  | 2776 | -S "session successfully restored from cache" \ | 
|  | 2777 | -s "session successfully restored from ticket" \ | 
|  | 2778 | -s "a session has been resumed" \ | 
|  | 2779 | -c "a session has been resumed" | 
|  | 2780 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2781 | run_test    "Session resume using tickets: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2782 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2783 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2784 | 0 \ | 
|  | 2785 | -c "client hello, adding session ticket extension" \ | 
|  | 2786 | -c "found session_ticket extension" \ | 
|  | 2787 | -c "parse new session ticket" \ | 
|  | 2788 | -c "a session has been resumed" | 
|  | 2789 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2790 | run_test    "Session resume using tickets: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2791 | "$P_SRV debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2792 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 2793 | $O_CLI -sess_in $SESSION; \ | 
|  | 2794 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2795 | 0 \ | 
|  | 2796 | -s "found session ticket extension" \ | 
|  | 2797 | -s "server hello, adding session ticket extension" \ | 
|  | 2798 | -S "session successfully restored from cache" \ | 
|  | 2799 | -s "session successfully restored from ticket" \ | 
|  | 2800 | -s "a session has been resumed" | 
|  | 2801 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2802 | # Tests for Session Tickets with DTLS | 
|  | 2803 |  | 
|  | 2804 | run_test    "Session resume using tickets, DTLS: basic" \ | 
|  | 2805 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2806 | "$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] | 2807 | 0 \ | 
|  | 2808 | -c "client hello, adding session ticket extension" \ | 
|  | 2809 | -s "found session ticket extension" \ | 
|  | 2810 | -s "server hello, adding session ticket extension" \ | 
|  | 2811 | -c "found session_ticket extension" \ | 
|  | 2812 | -c "parse new session ticket" \ | 
|  | 2813 | -S "session successfully restored from cache" \ | 
|  | 2814 | -s "session successfully restored from ticket" \ | 
|  | 2815 | -s "a session has been resumed" \ | 
|  | 2816 | -c "a session has been resumed" | 
|  | 2817 |  | 
|  | 2818 | run_test    "Session resume using tickets, DTLS: cache disabled" \ | 
|  | 2819 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2820 | "$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] | 2821 | 0 \ | 
|  | 2822 | -c "client hello, adding session ticket extension" \ | 
|  | 2823 | -s "found session ticket extension" \ | 
|  | 2824 | -s "server hello, adding session ticket extension" \ | 
|  | 2825 | -c "found session_ticket extension" \ | 
|  | 2826 | -c "parse new session ticket" \ | 
|  | 2827 | -S "session successfully restored from cache" \ | 
|  | 2828 | -s "session successfully restored from ticket" \ | 
|  | 2829 | -s "a session has been resumed" \ | 
|  | 2830 | -c "a session has been resumed" | 
|  | 2831 |  | 
|  | 2832 | run_test    "Session resume using tickets, DTLS: timeout" \ | 
|  | 2833 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0 ticket_timeout=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2834 | "$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] | 2835 | 0 \ | 
|  | 2836 | -c "client hello, adding session ticket extension" \ | 
|  | 2837 | -s "found session ticket extension" \ | 
|  | 2838 | -s "server hello, adding session ticket extension" \ | 
|  | 2839 | -c "found session_ticket extension" \ | 
|  | 2840 | -c "parse new session ticket" \ | 
|  | 2841 | -S "session successfully restored from cache" \ | 
|  | 2842 | -S "session successfully restored from ticket" \ | 
|  | 2843 | -S "a session has been resumed" \ | 
|  | 2844 | -C "a session has been resumed" | 
|  | 2845 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2846 | run_test    "Session resume using tickets, DTLS: session copy" \ | 
|  | 2847 | "$P_SRV debug_level=3 dtls=1 tickets=1 cache_max=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2848 | "$P_CLI debug_level=3 dtls=1 tickets=1 reconnect=1 skip_close_notify=1 reco_mode=0" \ | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2849 | 0 \ | 
|  | 2850 | -c "client hello, adding session ticket extension" \ | 
|  | 2851 | -s "found session ticket extension" \ | 
|  | 2852 | -s "server hello, adding session ticket extension" \ | 
|  | 2853 | -c "found session_ticket extension" \ | 
|  | 2854 | -c "parse new session ticket" \ | 
|  | 2855 | -S "session successfully restored from cache" \ | 
|  | 2856 | -s "session successfully restored from ticket" \ | 
|  | 2857 | -s "a session has been resumed" \ | 
|  | 2858 | -c "a session has been resumed" | 
|  | 2859 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2860 | run_test    "Session resume using tickets, DTLS: openssl server" \ | 
|  | 2861 | "$O_SRV -dtls1" \ | 
|  | 2862 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ | 
|  | 2863 | 0 \ | 
|  | 2864 | -c "client hello, adding session ticket extension" \ | 
|  | 2865 | -c "found session_ticket extension" \ | 
|  | 2866 | -c "parse new session ticket" \ | 
|  | 2867 | -c "a session has been resumed" | 
|  | 2868 |  | 
|  | 2869 | run_test    "Session resume using tickets, DTLS: openssl client" \ | 
|  | 2870 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ | 
|  | 2871 | "( $O_CLI -dtls1 -sess_out $SESSION; \ | 
|  | 2872 | $O_CLI -dtls1 -sess_in $SESSION; \ | 
|  | 2873 | rm -f $SESSION )" \ | 
|  | 2874 | 0 \ | 
|  | 2875 | -s "found session ticket extension" \ | 
|  | 2876 | -s "server hello, adding session ticket extension" \ | 
|  | 2877 | -S "session successfully restored from cache" \ | 
|  | 2878 | -s "session successfully restored from ticket" \ | 
|  | 2879 | -s "a session has been resumed" | 
|  | 2880 |  | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2881 | # Tests for Session Resume based on session-ID and cache | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2882 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2883 | run_test    "Session resume using cache: tickets enabled on client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2884 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 2885 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2886 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2887 | -c "client hello, adding session ticket extension" \ | 
|  | 2888 | -s "found session ticket extension" \ | 
|  | 2889 | -S "server hello, adding session ticket extension" \ | 
|  | 2890 | -C "found session_ticket extension" \ | 
|  | 2891 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2892 | -s "session successfully restored from cache" \ | 
|  | 2893 | -S "session successfully restored from ticket" \ | 
|  | 2894 | -s "a session has been resumed" \ | 
|  | 2895 | -c "a session has been resumed" | 
|  | 2896 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2897 | run_test    "Session resume using cache: tickets enabled on server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2898 | "$P_SRV debug_level=3 tickets=1" \ | 
|  | 2899 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2900 | 0 \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2901 | -C "client hello, adding session ticket extension" \ | 
|  | 2902 | -S "found session ticket extension" \ | 
|  | 2903 | -S "server hello, adding session ticket extension" \ | 
|  | 2904 | -C "found session_ticket extension" \ | 
|  | 2905 | -C "parse new session ticket" \ | 
| Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2906 | -s "session successfully restored from cache" \ | 
|  | 2907 | -S "session successfully restored from ticket" \ | 
|  | 2908 | -s "a session has been resumed" \ | 
|  | 2909 | -c "a session has been resumed" | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2910 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2911 | run_test    "Session resume using cache: cache_max=0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2912 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ | 
|  | 2913 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2914 | 0 \ | 
|  | 2915 | -S "session successfully restored from cache" \ | 
|  | 2916 | -S "session successfully restored from ticket" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2917 | -S "a session has been resumed" \ | 
|  | 2918 | -C "a session has been resumed" | 
| Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2919 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2920 | run_test    "Session resume using cache: cache_max=1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2921 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ | 
|  | 2922 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2923 | 0 \ | 
|  | 2924 | -s "session successfully restored from cache" \ | 
|  | 2925 | -S "session successfully restored from ticket" \ | 
|  | 2926 | -s "a session has been resumed" \ | 
|  | 2927 | -c "a session has been resumed" | 
|  | 2928 |  | 
| Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2929 | run_test    "Session resume using cache: timeout > delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2930 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 2931 | "$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] | 2932 | 0 \ | 
|  | 2933 | -s "session successfully restored from cache" \ | 
|  | 2934 | -S "session successfully restored from ticket" \ | 
|  | 2935 | -s "a session has been resumed" \ | 
|  | 2936 | -c "a session has been resumed" | 
|  | 2937 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2938 | run_test    "Session resume using cache: timeout < delay" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2939 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ | 
|  | 2940 | "$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] | 2941 | 0 \ | 
|  | 2942 | -S "session successfully restored from cache" \ | 
|  | 2943 | -S "session successfully restored from ticket" \ | 
|  | 2944 | -S "a session has been resumed" \ | 
|  | 2945 | -C "a session has been resumed" | 
|  | 2946 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2947 | run_test    "Session resume using cache: no timeout" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2948 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ | 
|  | 2949 | "$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] | 2950 | 0 \ | 
|  | 2951 | -s "session successfully restored from cache" \ | 
|  | 2952 | -S "session successfully restored from ticket" \ | 
|  | 2953 | -s "a session has been resumed" \ | 
|  | 2954 | -c "a session has been resumed" | 
|  | 2955 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2956 | run_test    "Session resume using cache: session copy" \ | 
|  | 2957 | "$P_SRV debug_level=3 tickets=0" \ | 
|  | 2958 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ | 
|  | 2959 | 0 \ | 
|  | 2960 | -s "session successfully restored from cache" \ | 
|  | 2961 | -S "session successfully restored from ticket" \ | 
|  | 2962 | -s "a session has been resumed" \ | 
|  | 2963 | -c "a session has been resumed" | 
|  | 2964 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2965 | run_test    "Session resume using cache: openssl client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2966 | "$P_SRV debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2967 | "( $O_CLI -sess_out $SESSION; \ | 
|  | 2968 | $O_CLI -sess_in $SESSION; \ | 
|  | 2969 | rm -f $SESSION )" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2970 | 0 \ | 
|  | 2971 | -s "found session ticket extension" \ | 
|  | 2972 | -S "server hello, adding session ticket extension" \ | 
|  | 2973 | -s "session successfully restored from cache" \ | 
|  | 2974 | -S "session successfully restored from ticket" \ | 
|  | 2975 | -s "a session has been resumed" | 
|  | 2976 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2977 | run_test    "Session resume using cache: openssl server" \ | 
| Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2978 | "$O_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2979 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ | 
| Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2980 | 0 \ | 
|  | 2981 | -C "found session_ticket extension" \ | 
|  | 2982 | -C "parse new session ticket" \ | 
|  | 2983 | -c "a session has been resumed" | 
|  | 2984 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2985 | # Tests for Session Resume based on session-ID and cache, DTLS | 
|  | 2986 |  | 
|  | 2987 | run_test    "Session resume using cache, DTLS: tickets enabled on client" \ | 
|  | 2988 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2989 | "$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] | 2990 | 0 \ | 
|  | 2991 | -c "client hello, adding session ticket extension" \ | 
|  | 2992 | -s "found session ticket extension" \ | 
|  | 2993 | -S "server hello, adding session ticket extension" \ | 
|  | 2994 | -C "found session_ticket extension" \ | 
|  | 2995 | -C "parse new session ticket" \ | 
|  | 2996 | -s "session successfully restored from cache" \ | 
|  | 2997 | -S "session successfully restored from ticket" \ | 
|  | 2998 | -s "a session has been resumed" \ | 
|  | 2999 | -c "a session has been resumed" | 
|  | 3000 |  | 
|  | 3001 | run_test    "Session resume using cache, DTLS: tickets enabled on server" \ | 
|  | 3002 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3003 | "$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] | 3004 | 0 \ | 
|  | 3005 | -C "client hello, adding session ticket extension" \ | 
|  | 3006 | -S "found session ticket extension" \ | 
|  | 3007 | -S "server hello, adding session ticket extension" \ | 
|  | 3008 | -C "found session_ticket extension" \ | 
|  | 3009 | -C "parse new session ticket" \ | 
|  | 3010 | -s "session successfully restored from cache" \ | 
|  | 3011 | -S "session successfully restored from ticket" \ | 
|  | 3012 | -s "a session has been resumed" \ | 
|  | 3013 | -c "a session has been resumed" | 
|  | 3014 |  | 
|  | 3015 | run_test    "Session resume using cache, DTLS: cache_max=0" \ | 
|  | 3016 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3017 | "$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] | 3018 | 0 \ | 
|  | 3019 | -S "session successfully restored from cache" \ | 
|  | 3020 | -S "session successfully restored from ticket" \ | 
|  | 3021 | -S "a session has been resumed" \ | 
|  | 3022 | -C "a session has been resumed" | 
|  | 3023 |  | 
|  | 3024 | run_test    "Session resume using cache, DTLS: cache_max=1" \ | 
|  | 3025 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_max=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3026 | "$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] | 3027 | 0 \ | 
|  | 3028 | -s "session successfully restored from cache" \ | 
|  | 3029 | -S "session successfully restored from ticket" \ | 
|  | 3030 | -s "a session has been resumed" \ | 
|  | 3031 | -c "a session has been resumed" | 
|  | 3032 |  | 
|  | 3033 | run_test    "Session resume using cache, DTLS: timeout > delay" \ | 
|  | 3034 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3035 | "$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] | 3036 | 0 \ | 
|  | 3037 | -s "session successfully restored from cache" \ | 
|  | 3038 | -S "session successfully restored from ticket" \ | 
|  | 3039 | -s "a session has been resumed" \ | 
|  | 3040 | -c "a session has been resumed" | 
|  | 3041 |  | 
|  | 3042 | run_test    "Session resume using cache, DTLS: timeout < delay" \ | 
|  | 3043 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=1" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3044 | "$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] | 3045 | 0 \ | 
|  | 3046 | -S "session successfully restored from cache" \ | 
|  | 3047 | -S "session successfully restored from ticket" \ | 
|  | 3048 | -S "a session has been resumed" \ | 
|  | 3049 | -C "a session has been resumed" | 
|  | 3050 |  | 
|  | 3051 | run_test    "Session resume using cache, DTLS: no timeout" \ | 
|  | 3052 | "$P_SRV dtls=1 debug_level=3 tickets=0 cache_timeout=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3053 | "$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] | 3054 | 0 \ | 
|  | 3055 | -s "session successfully restored from cache" \ | 
|  | 3056 | -S "session successfully restored from ticket" \ | 
|  | 3057 | -s "a session has been resumed" \ | 
|  | 3058 | -c "a session has been resumed" | 
|  | 3059 |  | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3060 | run_test    "Session resume using cache, DTLS: session copy" \ | 
|  | 3061 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 3062 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1 skip_close_notify=1 reco_mode=0" \ | 
| Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 3063 | 0 \ | 
|  | 3064 | -s "session successfully restored from cache" \ | 
|  | 3065 | -S "session successfully restored from ticket" \ | 
|  | 3066 | -s "a session has been resumed" \ | 
|  | 3067 | -c "a session has been resumed" | 
|  | 3068 |  | 
| Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 3069 | run_test    "Session resume using cache, DTLS: openssl client" \ | 
|  | 3070 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ | 
|  | 3071 | "( $O_CLI -dtls1 -sess_out $SESSION; \ | 
|  | 3072 | $O_CLI -dtls1 -sess_in $SESSION; \ | 
|  | 3073 | rm -f $SESSION )" \ | 
|  | 3074 | 0 \ | 
|  | 3075 | -s "found session ticket extension" \ | 
|  | 3076 | -S "server hello, adding session ticket extension" \ | 
|  | 3077 | -s "session successfully restored from cache" \ | 
|  | 3078 | -S "session successfully restored from ticket" \ | 
|  | 3079 | -s "a session has been resumed" | 
|  | 3080 |  | 
|  | 3081 | run_test    "Session resume using cache, DTLS: openssl server" \ | 
|  | 3082 | "$O_SRV -dtls1" \ | 
|  | 3083 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ | 
|  | 3084 | 0 \ | 
|  | 3085 | -C "found session_ticket extension" \ | 
|  | 3086 | -C "parse new session ticket" \ | 
|  | 3087 | -c "a session has been resumed" | 
|  | 3088 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3089 | # Tests for Max Fragment Length extension | 
|  | 3090 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3091 | if [ "$MAX_CONTENT_LEN" -lt "4096" ]; then | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 3092 | printf '%s defines MBEDTLS_SSL_MAX_CONTENT_LEN to be less than 4096. Fragment length tests will fail.\n' "${CONFIG_H}" | 
| Hanno Becker | 6428f8d | 2017-09-22 16:58:50 +0100 | [diff] [blame] | 3093 | exit 1 | 
|  | 3094 | fi | 
|  | 3095 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3096 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 3097 | echo "Using non-default maximum content length $MAX_CONTENT_LEN" | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3098 | fi | 
|  | 3099 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3100 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3101 | run_test    "Max fragment length: enabled, default" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3102 | "$P_SRV debug_level=3" \ | 
|  | 3103 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3104 | 0 \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3105 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3106 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3107 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3108 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3109 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 3110 | -S "found max fragment length extension" \ | 
|  | 3111 | -S "server hello, max_fragment_length extension" \ | 
|  | 3112 | -C "found max_fragment_length extension" | 
|  | 3113 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3114 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3115 | run_test    "Max fragment length: enabled, default, larger message" \ | 
|  | 3116 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3117 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3118 | 0 \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3119 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3120 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3121 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3122 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3123 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 3124 | -S "found max fragment length extension" \ | 
|  | 3125 | -S "server hello, max_fragment_length extension" \ | 
|  | 3126 | -C "found max_fragment_length extension" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3127 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 3128 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3129 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3130 |  | 
|  | 3131 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3132 | run_test    "Max fragment length, DTLS: enabled, default, larger message" \ | 
|  | 3133 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3134 | "$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] | 3135 | 1 \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3136 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3137 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3138 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3139 | -s "Maximum output fragment length is $MAX_CONTENT_LEN" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3140 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 3141 | -S "found max fragment length extension" \ | 
|  | 3142 | -S "server hello, max_fragment_length extension" \ | 
|  | 3143 | -C "found max_fragment_length extension" \ | 
|  | 3144 | -c "fragment larger than.*maximum " | 
|  | 3145 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3146 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled | 
|  | 3147 | # (session fragment length will be 16384 regardless of mbedtls | 
|  | 3148 | # content length configuration.) | 
|  | 3149 |  | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3150 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3151 | run_test    "Max fragment length: disabled, larger message" \ | 
|  | 3152 | "$P_SRV debug_level=3" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3153 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3154 | 0 \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3155 | -C "Maximum input fragment length is 16384" \ | 
|  | 3156 | -C "Maximum output fragment length is 16384" \ | 
|  | 3157 | -S "Maximum input fragment length is 16384" \ | 
|  | 3158 | -S "Maximum output fragment length is 16384" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3159 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ | 
|  | 3160 | -s "$MAX_CONTENT_LEN bytes read" \ | 
| Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3161 | -s "1 bytes read" | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3162 |  | 
|  | 3163 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3164 | run_test    "Max fragment length DTLS: disabled, larger message" \ | 
|  | 3165 | "$P_SRV debug_level=3 dtls=1" \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3166 | "$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] | 3167 | 1 \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3168 | -C "Maximum input fragment length is 16384" \ | 
|  | 3169 | -C "Maximum output fragment length is 16384" \ | 
|  | 3170 | -S "Maximum input fragment length is 16384" \ | 
|  | 3171 | -S "Maximum output fragment length is 16384" \ | 
| Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3172 | -c "fragment larger than.*maximum " | 
|  | 3173 |  | 
|  | 3174 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3175 | run_test    "Max fragment length: used by client" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3176 | "$P_SRV debug_level=3" \ | 
|  | 3177 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3178 | 0 \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3179 | -c "Maximum input fragment length is 4096" \ | 
|  | 3180 | -c "Maximum output fragment length is 4096" \ | 
|  | 3181 | -s "Maximum input fragment length is 4096" \ | 
|  | 3182 | -s "Maximum output fragment length is 4096" \ | 
|  | 3183 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3184 | -s "found max fragment length extension" \ | 
|  | 3185 | -s "server hello, max_fragment_length extension" \ | 
|  | 3186 | -c "found max_fragment_length extension" | 
|  | 3187 |  | 
|  | 3188 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3189 | run_test    "Max fragment length: client 512, server 1024" \ | 
|  | 3190 | "$P_SRV debug_level=3 max_frag_len=1024" \ | 
|  | 3191 | "$P_CLI debug_level=3 max_frag_len=512" \ | 
|  | 3192 | 0 \ | 
|  | 3193 | -c "Maximum input fragment length is 512" \ | 
|  | 3194 | -c "Maximum output fragment length is 512" \ | 
|  | 3195 | -s "Maximum input fragment length is 512" \ | 
|  | 3196 | -s "Maximum output fragment length is 512" \ | 
|  | 3197 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3198 | -s "found max fragment length extension" \ | 
|  | 3199 | -s "server hello, max_fragment_length extension" \ | 
|  | 3200 | -c "found max_fragment_length extension" | 
|  | 3201 |  | 
|  | 3202 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3203 | run_test    "Max fragment length: client 512, server 2048" \ | 
|  | 3204 | "$P_SRV debug_level=3 max_frag_len=2048" \ | 
|  | 3205 | "$P_CLI debug_level=3 max_frag_len=512" \ | 
|  | 3206 | 0 \ | 
|  | 3207 | -c "Maximum input fragment length is 512" \ | 
|  | 3208 | -c "Maximum output fragment length is 512" \ | 
|  | 3209 | -s "Maximum input fragment length is 512" \ | 
|  | 3210 | -s "Maximum output fragment length is 512" \ | 
|  | 3211 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3212 | -s "found max fragment length extension" \ | 
|  | 3213 | -s "server hello, max_fragment_length extension" \ | 
|  | 3214 | -c "found max_fragment_length extension" | 
|  | 3215 |  | 
|  | 3216 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3217 | run_test    "Max fragment length: client 512, server 4096" \ | 
|  | 3218 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3219 | "$P_CLI debug_level=3 max_frag_len=512" \ | 
|  | 3220 | 0 \ | 
|  | 3221 | -c "Maximum input fragment length is 512" \ | 
|  | 3222 | -c "Maximum output fragment length is 512" \ | 
|  | 3223 | -s "Maximum input fragment length is 512" \ | 
|  | 3224 | -s "Maximum output fragment length is 512" \ | 
|  | 3225 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3226 | -s "found max fragment length extension" \ | 
|  | 3227 | -s "server hello, max_fragment_length extension" \ | 
|  | 3228 | -c "found max_fragment_length extension" | 
|  | 3229 |  | 
|  | 3230 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3231 | run_test    "Max fragment length: client 1024, server 512" \ | 
|  | 3232 | "$P_SRV debug_level=3 max_frag_len=512" \ | 
|  | 3233 | "$P_CLI debug_level=3 max_frag_len=1024" \ | 
|  | 3234 | 0 \ | 
|  | 3235 | -c "Maximum input fragment length is 1024" \ | 
|  | 3236 | -c "Maximum output fragment length is 1024" \ | 
|  | 3237 | -s "Maximum input fragment length is 1024" \ | 
|  | 3238 | -s "Maximum output fragment length is 512" \ | 
|  | 3239 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3240 | -s "found max fragment length extension" \ | 
|  | 3241 | -s "server hello, max_fragment_length extension" \ | 
|  | 3242 | -c "found max_fragment_length extension" | 
|  | 3243 |  | 
|  | 3244 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3245 | run_test    "Max fragment length: client 1024, server 2048" \ | 
|  | 3246 | "$P_SRV debug_level=3 max_frag_len=2048" \ | 
|  | 3247 | "$P_CLI debug_level=3 max_frag_len=1024" \ | 
|  | 3248 | 0 \ | 
|  | 3249 | -c "Maximum input fragment length is 1024" \ | 
|  | 3250 | -c "Maximum output fragment length is 1024" \ | 
|  | 3251 | -s "Maximum input fragment length is 1024" \ | 
|  | 3252 | -s "Maximum output fragment length is 1024" \ | 
|  | 3253 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3254 | -s "found max fragment length extension" \ | 
|  | 3255 | -s "server hello, max_fragment_length extension" \ | 
|  | 3256 | -c "found max_fragment_length extension" | 
|  | 3257 |  | 
|  | 3258 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3259 | run_test    "Max fragment length: client 1024, server 4096" \ | 
|  | 3260 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3261 | "$P_CLI debug_level=3 max_frag_len=1024" \ | 
|  | 3262 | 0 \ | 
|  | 3263 | -c "Maximum input fragment length is 1024" \ | 
|  | 3264 | -c "Maximum output fragment length is 1024" \ | 
|  | 3265 | -s "Maximum input fragment length is 1024" \ | 
|  | 3266 | -s "Maximum output fragment length is 1024" \ | 
|  | 3267 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3268 | -s "found max fragment length extension" \ | 
|  | 3269 | -s "server hello, max_fragment_length extension" \ | 
|  | 3270 | -c "found max_fragment_length extension" | 
|  | 3271 |  | 
|  | 3272 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3273 | run_test    "Max fragment length: client 2048, server 512" \ | 
|  | 3274 | "$P_SRV debug_level=3 max_frag_len=512" \ | 
|  | 3275 | "$P_CLI debug_level=3 max_frag_len=2048" \ | 
|  | 3276 | 0 \ | 
|  | 3277 | -c "Maximum input fragment length is 2048" \ | 
|  | 3278 | -c "Maximum output fragment length is 2048" \ | 
|  | 3279 | -s "Maximum input fragment length is 2048" \ | 
|  | 3280 | -s "Maximum output fragment length is 512" \ | 
|  | 3281 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3282 | -s "found max fragment length extension" \ | 
|  | 3283 | -s "server hello, max_fragment_length extension" \ | 
|  | 3284 | -c "found max_fragment_length extension" | 
|  | 3285 |  | 
|  | 3286 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3287 | run_test    "Max fragment length: client 2048, server 1024" \ | 
|  | 3288 | "$P_SRV debug_level=3 max_frag_len=1024" \ | 
|  | 3289 | "$P_CLI debug_level=3 max_frag_len=2048" \ | 
|  | 3290 | 0 \ | 
|  | 3291 | -c "Maximum input fragment length is 2048" \ | 
|  | 3292 | -c "Maximum output fragment length is 2048" \ | 
|  | 3293 | -s "Maximum input fragment length is 2048" \ | 
|  | 3294 | -s "Maximum output fragment length is 1024" \ | 
|  | 3295 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3296 | -s "found max fragment length extension" \ | 
|  | 3297 | -s "server hello, max_fragment_length extension" \ | 
|  | 3298 | -c "found max_fragment_length extension" | 
|  | 3299 |  | 
|  | 3300 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3301 | run_test    "Max fragment length: client 2048, server 4096" \ | 
|  | 3302 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3303 | "$P_CLI debug_level=3 max_frag_len=2048" \ | 
|  | 3304 | 0 \ | 
|  | 3305 | -c "Maximum input fragment length is 2048" \ | 
|  | 3306 | -c "Maximum output fragment length is 2048" \ | 
|  | 3307 | -s "Maximum input fragment length is 2048" \ | 
|  | 3308 | -s "Maximum output fragment length is 2048" \ | 
|  | 3309 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3310 | -s "found max fragment length extension" \ | 
|  | 3311 | -s "server hello, max_fragment_length extension" \ | 
|  | 3312 | -c "found max_fragment_length extension" | 
|  | 3313 |  | 
|  | 3314 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3315 | run_test    "Max fragment length: client 4096, server 512" \ | 
|  | 3316 | "$P_SRV debug_level=3 max_frag_len=512" \ | 
|  | 3317 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 3318 | 0 \ | 
|  | 3319 | -c "Maximum input fragment length is 4096" \ | 
|  | 3320 | -c "Maximum output fragment length is 4096" \ | 
|  | 3321 | -s "Maximum input fragment length is 4096" \ | 
|  | 3322 | -s "Maximum output fragment length is 512" \ | 
|  | 3323 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3324 | -s "found max fragment length extension" \ | 
|  | 3325 | -s "server hello, max_fragment_length extension" \ | 
|  | 3326 | -c "found max_fragment_length extension" | 
|  | 3327 |  | 
|  | 3328 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3329 | run_test    "Max fragment length: client 4096, server 1024" \ | 
|  | 3330 | "$P_SRV debug_level=3 max_frag_len=1024" \ | 
|  | 3331 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 3332 | 0 \ | 
|  | 3333 | -c "Maximum input fragment length is 4096" \ | 
|  | 3334 | -c "Maximum output fragment length is 4096" \ | 
|  | 3335 | -s "Maximum input fragment length is 4096" \ | 
|  | 3336 | -s "Maximum output fragment length is 1024" \ | 
|  | 3337 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3338 | -s "found max fragment length extension" \ | 
|  | 3339 | -s "server hello, max_fragment_length extension" \ | 
|  | 3340 | -c "found max_fragment_length extension" | 
|  | 3341 |  | 
|  | 3342 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3343 | run_test    "Max fragment length: client 4096, server 2048" \ | 
|  | 3344 | "$P_SRV debug_level=3 max_frag_len=2048" \ | 
|  | 3345 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
|  | 3346 | 0 \ | 
|  | 3347 | -c "Maximum input fragment length is 4096" \ | 
|  | 3348 | -c "Maximum output fragment length is 4096" \ | 
|  | 3349 | -s "Maximum input fragment length is 4096" \ | 
|  | 3350 | -s "Maximum output fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3351 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3352 | -s "found max fragment length extension" \ | 
|  | 3353 | -s "server hello, max_fragment_length extension" \ | 
|  | 3354 | -c "found max_fragment_length extension" | 
|  | 3355 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3356 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3357 | run_test    "Max fragment length: used by server" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3358 | "$P_SRV debug_level=3 max_frag_len=4096" \ | 
|  | 3359 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3360 | 0 \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3361 | -c "Maximum input fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3362 | -c "Maximum output fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3363 | -s "Maximum input fragment length is $MAX_CONTENT_LEN" \ | 
|  | 3364 | -s "Maximum output fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3365 | -C "client hello, adding max_fragment_length extension" \ | 
|  | 3366 | -S "found max fragment length extension" \ | 
|  | 3367 | -S "server hello, max_fragment_length extension" \ | 
|  | 3368 | -C "found max_fragment_length extension" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3369 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3370 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3371 | requires_gnutls | 
|  | 3372 | run_test    "Max fragment length: gnutls server" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3373 | "$G_SRV" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3374 | "$P_CLI debug_level=3 max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3375 | 0 \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3376 | -c "Maximum input fragment length is 4096" \ | 
|  | 3377 | -c "Maximum output fragment length is 4096" \ | 
| Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3378 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3379 | -c "found max_fragment_length extension" | 
|  | 3380 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3381 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3382 | run_test    "Max fragment length: client, message just fits" \ | 
|  | 3383 | "$P_SRV debug_level=3" \ | 
|  | 3384 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ | 
|  | 3385 | 0 \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3386 | -c "Maximum input fragment length is 2048" \ | 
|  | 3387 | -c "Maximum output fragment length is 2048" \ | 
|  | 3388 | -s "Maximum input fragment length is 2048" \ | 
|  | 3389 | -s "Maximum output fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3390 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3391 | -s "found max fragment length extension" \ | 
|  | 3392 | -s "server hello, max_fragment_length extension" \ | 
|  | 3393 | -c "found max_fragment_length extension" \ | 
|  | 3394 | -c "2048 bytes written in 1 fragments" \ | 
|  | 3395 | -s "2048 bytes read" | 
|  | 3396 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3397 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3398 | run_test    "Max fragment length: client, larger message" \ | 
|  | 3399 | "$P_SRV debug_level=3" \ | 
|  | 3400 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ | 
|  | 3401 | 0 \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3402 | -c "Maximum input fragment length is 2048" \ | 
|  | 3403 | -c "Maximum output fragment length is 2048" \ | 
|  | 3404 | -s "Maximum input fragment length is 2048" \ | 
|  | 3405 | -s "Maximum output fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3406 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3407 | -s "found max fragment length extension" \ | 
|  | 3408 | -s "server hello, max_fragment_length extension" \ | 
|  | 3409 | -c "found max_fragment_length extension" \ | 
|  | 3410 | -c "2345 bytes written in 2 fragments" \ | 
|  | 3411 | -s "2048 bytes read" \ | 
|  | 3412 | -s "297 bytes read" | 
|  | 3413 |  | 
| Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3414 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3415 | run_test    "Max fragment length: DTLS client, larger message" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3416 | "$P_SRV debug_level=3 dtls=1" \ | 
|  | 3417 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ | 
|  | 3418 | 1 \ | 
| Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3419 | -c "Maximum input fragment length is 2048" \ | 
|  | 3420 | -c "Maximum output fragment length is 2048" \ | 
|  | 3421 | -s "Maximum input fragment length is 2048" \ | 
|  | 3422 | -s "Maximum output fragment length is 2048" \ | 
| Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3423 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3424 | -s "found max fragment length extension" \ | 
|  | 3425 | -s "server hello, max_fragment_length extension" \ | 
|  | 3426 | -c "found max_fragment_length extension" \ | 
|  | 3427 | -c "fragment larger than.*maximum" | 
|  | 3428 |  | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3429 | # Tests for renegotiation | 
|  | 3430 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3431 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3432 | run_test    "Renegotiation: none, for reference" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3433 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3434 | "$P_CLI debug_level=3 exchanges=2" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3435 | 0 \ | 
|  | 3436 | -C "client hello, adding renegotiation extension" \ | 
|  | 3437 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3438 | -S "found renegotiation extension" \ | 
|  | 3439 | -s "server hello, secure renegotiation extension" \ | 
|  | 3440 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3441 | -C "=> renegotiate" \ | 
|  | 3442 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3443 | -S "write hello request" | 
|  | 3444 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3445 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3446 | run_test    "Renegotiation: client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3447 | "$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] | 3448 | "$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] | 3449 | 0 \ | 
|  | 3450 | -c "client hello, adding renegotiation extension" \ | 
|  | 3451 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3452 | -s "found renegotiation extension" \ | 
|  | 3453 | -s "server hello, secure renegotiation extension" \ | 
|  | 3454 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3455 | -c "=> renegotiate" \ | 
|  | 3456 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3457 | -S "write hello request" | 
|  | 3458 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3459 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3460 | run_test    "Renegotiation: server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3461 | "$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] | 3462 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3463 | 0 \ | 
|  | 3464 | -c "client hello, adding renegotiation extension" \ | 
|  | 3465 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3466 | -s "found renegotiation extension" \ | 
|  | 3467 | -s "server hello, secure renegotiation extension" \ | 
|  | 3468 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3469 | -c "=> renegotiate" \ | 
|  | 3470 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3471 | -s "write hello request" | 
|  | 3472 |  | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3473 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 3474 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD | 
|  | 3475 | # algorithm stronger than SHA-1 is enabled in config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3476 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3477 | run_test    "Renegotiation: Signature Algorithms parsing, client-initiated" \ | 
|  | 3478 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ | 
|  | 3479 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 3480 | 0 \ | 
|  | 3481 | -c "client hello, adding renegotiation extension" \ | 
|  | 3482 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3483 | -s "found renegotiation extension" \ | 
|  | 3484 | -s "server hello, secure renegotiation extension" \ | 
|  | 3485 | -c "found renegotiation extension" \ | 
|  | 3486 | -c "=> renegotiate" \ | 
|  | 3487 | -s "=> renegotiate" \ | 
|  | 3488 | -S "write hello request" \ | 
|  | 3489 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 3490 |  | 
|  | 3491 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that | 
|  | 3492 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD | 
|  | 3493 | # algorithm stronger than SHA-1 is enabled in config.h | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3494 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3495 | run_test    "Renegotiation: Signature Algorithms parsing, server-initiated" \ | 
|  | 3496 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ | 
|  | 3497 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 3498 | 0 \ | 
|  | 3499 | -c "client hello, adding renegotiation extension" \ | 
|  | 3500 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3501 | -s "found renegotiation extension" \ | 
|  | 3502 | -s "server hello, secure renegotiation extension" \ | 
|  | 3503 | -c "found renegotiation extension" \ | 
|  | 3504 | -c "=> renegotiate" \ | 
|  | 3505 | -s "=> renegotiate" \ | 
|  | 3506 | -s "write hello request" \ | 
|  | 3507 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? | 
|  | 3508 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3509 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3510 | run_test    "Renegotiation: double" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3511 | "$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] | 3512 | "$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] | 3513 | 0 \ | 
|  | 3514 | -c "client hello, adding renegotiation extension" \ | 
|  | 3515 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3516 | -s "found renegotiation extension" \ | 
|  | 3517 | -s "server hello, secure renegotiation extension" \ | 
|  | 3518 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3519 | -c "=> renegotiate" \ | 
|  | 3520 | -s "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3521 | -s "write hello request" | 
|  | 3522 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3523 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3524 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 3525 | run_test    "Renegotiation with max fragment length: client 2048, server 512" \ | 
|  | 3526 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ | 
|  | 3527 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 max_frag_len=2048 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ | 
|  | 3528 | 0 \ | 
|  | 3529 | -c "Maximum input fragment length is 2048" \ | 
|  | 3530 | -c "Maximum output fragment length is 2048" \ | 
|  | 3531 | -s "Maximum input fragment length is 2048" \ | 
|  | 3532 | -s "Maximum output fragment length is 512" \ | 
|  | 3533 | -c "client hello, adding max_fragment_length extension" \ | 
|  | 3534 | -s "found max fragment length extension" \ | 
|  | 3535 | -s "server hello, max_fragment_length extension" \ | 
|  | 3536 | -c "found max_fragment_length extension" \ | 
|  | 3537 | -c "client hello, adding renegotiation extension" \ | 
|  | 3538 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3539 | -s "found renegotiation extension" \ | 
|  | 3540 | -s "server hello, secure renegotiation extension" \ | 
|  | 3541 | -c "found renegotiation extension" \ | 
|  | 3542 | -c "=> renegotiate" \ | 
|  | 3543 | -s "=> renegotiate" \ | 
|  | 3544 | -s "write hello request" | 
|  | 3545 |  | 
|  | 3546 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3547 | run_test    "Renegotiation: client-initiated, server-rejected" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3548 | "$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] | 3549 | "$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] | 3550 | 1 \ | 
|  | 3551 | -c "client hello, adding renegotiation extension" \ | 
|  | 3552 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3553 | -S "found renegotiation extension" \ | 
|  | 3554 | -s "server hello, secure renegotiation extension" \ | 
|  | 3555 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3556 | -c "=> renegotiate" \ | 
|  | 3557 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3558 | -S "write hello request" \ | 
| Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3559 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3560 | -c "failed" | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3561 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3562 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3563 | run_test    "Renegotiation: server-initiated, client-rejected, default" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3564 | "$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] | 3565 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3566 | 0 \ | 
|  | 3567 | -C "client hello, adding renegotiation extension" \ | 
|  | 3568 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3569 | -S "found renegotiation extension" \ | 
|  | 3570 | -s "server hello, secure renegotiation extension" \ | 
|  | 3571 | -c "found renegotiation extension" \ | 
| Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3572 | -C "=> renegotiate" \ | 
|  | 3573 | -S "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3574 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3575 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3576 | -S "failed" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3577 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3578 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3579 | run_test    "Renegotiation: server-initiated, client-rejected, not enforced" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3580 | "$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] | 3581 | renego_delay=-1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3582 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3583 | 0 \ | 
|  | 3584 | -C "client hello, adding renegotiation extension" \ | 
|  | 3585 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3586 | -S "found renegotiation extension" \ | 
|  | 3587 | -s "server hello, secure renegotiation extension" \ | 
|  | 3588 | -c "found renegotiation extension" \ | 
|  | 3589 | -C "=> renegotiate" \ | 
|  | 3590 | -S "=> renegotiate" \ | 
|  | 3591 | -s "write hello request" \ | 
|  | 3592 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3593 | -S "failed" | 
|  | 3594 |  | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3595 | # delay 2 for 1 alert record + 1 application data record | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3596 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3597 | run_test    "Renegotiation: server-initiated, client-rejected, delay 2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3598 | "$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] | 3599 | renego_delay=2 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3600 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3601 | 0 \ | 
|  | 3602 | -C "client hello, adding renegotiation extension" \ | 
|  | 3603 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3604 | -S "found renegotiation extension" \ | 
|  | 3605 | -s "server hello, secure renegotiation extension" \ | 
|  | 3606 | -c "found renegotiation extension" \ | 
|  | 3607 | -C "=> renegotiate" \ | 
|  | 3608 | -S "=> renegotiate" \ | 
|  | 3609 | -s "write hello request" \ | 
|  | 3610 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3611 | -S "failed" | 
|  | 3612 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3613 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3614 | run_test    "Renegotiation: server-initiated, client-rejected, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3615 | "$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] | 3616 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3617 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3618 | 0 \ | 
|  | 3619 | -C "client hello, adding renegotiation extension" \ | 
|  | 3620 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3621 | -S "found renegotiation extension" \ | 
|  | 3622 | -s "server hello, secure renegotiation extension" \ | 
|  | 3623 | -c "found renegotiation extension" \ | 
|  | 3624 | -C "=> renegotiate" \ | 
|  | 3625 | -S "=> renegotiate" \ | 
|  | 3626 | -s "write hello request" \ | 
| Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3627 | -s "SSL - An unexpected message was received from our peer" | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3628 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3629 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3630 | run_test    "Renegotiation: server-initiated, client-accepted, delay 0" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3631 | "$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] | 3632 | renego_delay=0 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3633 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3634 | 0 \ | 
|  | 3635 | -c "client hello, adding renegotiation extension" \ | 
|  | 3636 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3637 | -s "found renegotiation extension" \ | 
|  | 3638 | -s "server hello, secure renegotiation extension" \ | 
|  | 3639 | -c "found renegotiation extension" \ | 
|  | 3640 | -c "=> renegotiate" \ | 
|  | 3641 | -s "=> renegotiate" \ | 
|  | 3642 | -s "write hello request" \ | 
|  | 3643 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3644 | -S "failed" | 
|  | 3645 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3646 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3647 | run_test    "Renegotiation: periodic, just below period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3648 | "$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] | 3649 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ | 
|  | 3650 | 0 \ | 
|  | 3651 | -C "client hello, adding renegotiation extension" \ | 
|  | 3652 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3653 | -S "found renegotiation extension" \ | 
|  | 3654 | -s "server hello, secure renegotiation extension" \ | 
|  | 3655 | -c "found renegotiation extension" \ | 
|  | 3656 | -S "record counter limit reached: renegotiate" \ | 
|  | 3657 | -C "=> renegotiate" \ | 
|  | 3658 | -S "=> renegotiate" \ | 
|  | 3659 | -S "write hello request" \ | 
|  | 3660 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3661 | -S "failed" | 
|  | 3662 |  | 
| Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3663 | # one extra exchange to be able to complete renego | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3664 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3665 | run_test    "Renegotiation: periodic, just above period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3666 | "$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] | 3667 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3668 | 0 \ | 
|  | 3669 | -c "client hello, adding renegotiation extension" \ | 
|  | 3670 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3671 | -s "found renegotiation extension" \ | 
|  | 3672 | -s "server hello, secure renegotiation extension" \ | 
|  | 3673 | -c "found renegotiation extension" \ | 
|  | 3674 | -s "record counter limit reached: renegotiate" \ | 
|  | 3675 | -c "=> renegotiate" \ | 
|  | 3676 | -s "=> renegotiate" \ | 
|  | 3677 | -s "write hello request" \ | 
|  | 3678 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3679 | -S "failed" | 
|  | 3680 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3681 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3682 | run_test    "Renegotiation: periodic, two times period" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3683 | "$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] | 3684 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3685 | 0 \ | 
|  | 3686 | -c "client hello, adding renegotiation extension" \ | 
|  | 3687 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3688 | -s "found renegotiation extension" \ | 
|  | 3689 | -s "server hello, secure renegotiation extension" \ | 
|  | 3690 | -c "found renegotiation extension" \ | 
|  | 3691 | -s "record counter limit reached: renegotiate" \ | 
|  | 3692 | -c "=> renegotiate" \ | 
|  | 3693 | -s "=> renegotiate" \ | 
|  | 3694 | -s "write hello request" \ | 
|  | 3695 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3696 | -S "failed" | 
|  | 3697 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3698 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3699 | run_test    "Renegotiation: periodic, above period, disabled" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3700 | "$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] | 3701 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ | 
|  | 3702 | 0 \ | 
|  | 3703 | -C "client hello, adding renegotiation extension" \ | 
|  | 3704 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3705 | -S "found renegotiation extension" \ | 
|  | 3706 | -s "server hello, secure renegotiation extension" \ | 
|  | 3707 | -c "found renegotiation extension" \ | 
|  | 3708 | -S "record counter limit reached: renegotiate" \ | 
|  | 3709 | -C "=> renegotiate" \ | 
|  | 3710 | -S "=> renegotiate" \ | 
|  | 3711 | -S "write hello request" \ | 
|  | 3712 | -S "SSL - An unexpected message was received from our peer" \ | 
|  | 3713 | -S "failed" | 
|  | 3714 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3715 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3716 | run_test    "Renegotiation: nbio, client-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3717 | "$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] | 3718 | "$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] | 3719 | 0 \ | 
|  | 3720 | -c "client hello, adding renegotiation extension" \ | 
|  | 3721 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3722 | -s "found renegotiation extension" \ | 
|  | 3723 | -s "server hello, secure renegotiation extension" \ | 
|  | 3724 | -c "found renegotiation extension" \ | 
|  | 3725 | -c "=> renegotiate" \ | 
|  | 3726 | -s "=> renegotiate" \ | 
|  | 3727 | -S "write hello request" | 
|  | 3728 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3729 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3730 | run_test    "Renegotiation: nbio, server-initiated" \ | 
| Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3731 | "$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] | 3732 | "$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] | 3733 | 0 \ | 
|  | 3734 | -c "client hello, adding renegotiation extension" \ | 
|  | 3735 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3736 | -s "found renegotiation extension" \ | 
|  | 3737 | -s "server hello, secure renegotiation extension" \ | 
|  | 3738 | -c "found renegotiation extension" \ | 
|  | 3739 | -c "=> renegotiate" \ | 
|  | 3740 | -s "=> renegotiate" \ | 
|  | 3741 | -s "write hello request" | 
|  | 3742 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3743 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3744 | run_test    "Renegotiation: openssl server, client-initiated" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3745 | "$O_SRV -www" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3746 | "$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] | 3747 | 0 \ | 
|  | 3748 | -c "client hello, adding renegotiation extension" \ | 
|  | 3749 | -c "found renegotiation extension" \ | 
|  | 3750 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3751 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3752 | -C "error" \ | 
|  | 3753 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3754 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3755 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3756 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3757 | run_test    "Renegotiation: gnutls server strict, client-initiated" \ | 
|  | 3758 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3759 | "$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] | 3760 | 0 \ | 
|  | 3761 | -c "client hello, adding renegotiation extension" \ | 
|  | 3762 | -c "found renegotiation extension" \ | 
|  | 3763 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3764 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3765 | -C "error" \ | 
|  | 3766 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3767 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3768 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3769 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3770 | run_test    "Renegotiation: gnutls server unsafe, client-initiated default" \ | 
|  | 3771 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3772 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 3773 | 1 \ | 
|  | 3774 | -c "client hello, adding renegotiation extension" \ | 
|  | 3775 | -C "found renegotiation extension" \ | 
|  | 3776 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3777 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3778 | -c "error" \ | 
|  | 3779 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3780 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3781 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3782 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3783 | run_test    "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ | 
|  | 3784 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3785 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 3786 | allow_legacy=0" \ | 
|  | 3787 | 1 \ | 
|  | 3788 | -c "client hello, adding renegotiation extension" \ | 
|  | 3789 | -C "found renegotiation extension" \ | 
|  | 3790 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3791 | -c "mbedtls_ssl_handshake() returned" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3792 | -c "error" \ | 
|  | 3793 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3794 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3795 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3796 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3797 | run_test    "Renegotiation: gnutls server unsafe, client-inititated legacy" \ | 
|  | 3798 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3799 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ | 
|  | 3800 | allow_legacy=1" \ | 
|  | 3801 | 0 \ | 
|  | 3802 | -c "client hello, adding renegotiation extension" \ | 
|  | 3803 | -C "found renegotiation extension" \ | 
|  | 3804 | -c "=> renegotiate" \ | 
|  | 3805 | -C "ssl_hanshake() returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3806 | -C "error" \ | 
|  | 3807 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3808 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3809 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3810 | run_test    "Renegotiation: DTLS, client-initiated" \ | 
|  | 3811 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ | 
|  | 3812 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 3813 | 0 \ | 
|  | 3814 | -c "client hello, adding renegotiation extension" \ | 
|  | 3815 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3816 | -s "found renegotiation extension" \ | 
|  | 3817 | -s "server hello, secure renegotiation extension" \ | 
|  | 3818 | -c "found renegotiation extension" \ | 
|  | 3819 | -c "=> renegotiate" \ | 
|  | 3820 | -s "=> renegotiate" \ | 
|  | 3821 | -S "write hello request" | 
|  | 3822 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3823 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3824 | run_test    "Renegotiation: DTLS, server-initiated" \ | 
|  | 3825 | "$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] | 3826 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ | 
|  | 3827 | read_timeout=1000 max_resend=2" \ | 
| Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3828 | 0 \ | 
|  | 3829 | -c "client hello, adding renegotiation extension" \ | 
|  | 3830 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3831 | -s "found renegotiation extension" \ | 
|  | 3832 | -s "server hello, secure renegotiation extension" \ | 
|  | 3833 | -c "found renegotiation extension" \ | 
|  | 3834 | -c "=> renegotiate" \ | 
|  | 3835 | -s "=> renegotiate" \ | 
|  | 3836 | -s "write hello request" | 
|  | 3837 |  | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3838 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3839 | run_test    "Renegotiation: DTLS, renego_period overflow" \ | 
|  | 3840 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ | 
|  | 3841 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ | 
|  | 3842 | 0 \ | 
|  | 3843 | -c "client hello, adding renegotiation extension" \ | 
|  | 3844 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ | 
|  | 3845 | -s "found renegotiation extension" \ | 
|  | 3846 | -s "server hello, secure renegotiation extension" \ | 
|  | 3847 | -s "record counter limit reached: renegotiate" \ | 
|  | 3848 | -c "=> renegotiate" \ | 
|  | 3849 | -s "=> renegotiate" \ | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3850 | -s "write hello request" | 
| Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3851 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3852 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3853 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3854 | run_test    "Renegotiation: DTLS, gnutls server, client-initiated" \ | 
|  | 3855 | "$G_SRV -u --mtu 4096" \ | 
|  | 3856 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ | 
|  | 3857 | 0 \ | 
|  | 3858 | -c "client hello, adding renegotiation extension" \ | 
|  | 3859 | -c "found renegotiation extension" \ | 
|  | 3860 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3861 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3862 | -C "error" \ | 
|  | 3863 | -s "Extra-header:" | 
|  | 3864 |  | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3865 | # Test for the "secure renegotation" extension only (no actual renegotiation) | 
|  | 3866 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3867 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3868 | run_test    "Renego ext: gnutls server strict, client default" \ | 
|  | 3869 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ | 
|  | 3870 | "$P_CLI debug_level=3" \ | 
|  | 3871 | 0 \ | 
|  | 3872 | -c "found renegotiation extension" \ | 
|  | 3873 | -C "error" \ | 
|  | 3874 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3875 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3876 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3877 | run_test    "Renego ext: gnutls server unsafe, client default" \ | 
|  | 3878 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3879 | "$P_CLI debug_level=3" \ | 
|  | 3880 | 0 \ | 
|  | 3881 | -C "found renegotiation extension" \ | 
|  | 3882 | -C "error" \ | 
|  | 3883 | -c "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3884 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3885 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3886 | run_test    "Renego ext: gnutls server unsafe, client break legacy" \ | 
|  | 3887 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ | 
|  | 3888 | "$P_CLI debug_level=3 allow_legacy=-1" \ | 
|  | 3889 | 1 \ | 
|  | 3890 | -C "found renegotiation extension" \ | 
|  | 3891 | -c "error" \ | 
|  | 3892 | -C "HTTP/1.0 200 [Oo][Kk]" | 
|  | 3893 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3894 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3895 | run_test    "Renego ext: gnutls client strict, server default" \ | 
|  | 3896 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3897 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3898 | 0 \ | 
|  | 3899 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 3900 | -s "server hello, secure renegotiation extension" | 
|  | 3901 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3902 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3903 | run_test    "Renego ext: gnutls client unsafe, server default" \ | 
|  | 3904 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3905 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3906 | 0 \ | 
|  | 3907 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 3908 | -S "server hello, secure renegotiation extension" | 
|  | 3909 |  | 
| Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3910 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3911 | run_test    "Renego ext: gnutls client unsafe, server break legacy" \ | 
|  | 3912 | "$P_SRV debug_level=3 allow_legacy=-1" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3913 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3914 | 1 \ | 
|  | 3915 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ | 
|  | 3916 | -S "server hello, secure renegotiation extension" | 
|  | 3917 |  | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3918 | # Tests for silently dropping trailing extra bytes in .der certificates | 
|  | 3919 |  | 
|  | 3920 | requires_gnutls | 
|  | 3921 | run_test    "DER format: no trailing bytes" \ | 
|  | 3922 | "$P_SRV crt_file=data_files/server5-der0.crt \ | 
|  | 3923 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3924 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3925 | 0 \ | 
|  | 3926 | -c "Handshake was completed" \ | 
|  | 3927 |  | 
|  | 3928 | requires_gnutls | 
|  | 3929 | run_test    "DER format: with a trailing zero byte" \ | 
|  | 3930 | "$P_SRV crt_file=data_files/server5-der1a.crt \ | 
|  | 3931 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3932 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3933 | 0 \ | 
|  | 3934 | -c "Handshake was completed" \ | 
|  | 3935 |  | 
|  | 3936 | requires_gnutls | 
|  | 3937 | run_test    "DER format: with a trailing random byte" \ | 
|  | 3938 | "$P_SRV crt_file=data_files/server5-der1b.crt \ | 
|  | 3939 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3940 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3941 | 0 \ | 
|  | 3942 | -c "Handshake was completed" \ | 
|  | 3943 |  | 
|  | 3944 | requires_gnutls | 
|  | 3945 | run_test    "DER format: with 2 trailing random bytes" \ | 
|  | 3946 | "$P_SRV crt_file=data_files/server5-der2.crt \ | 
|  | 3947 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3948 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3949 | 0 \ | 
|  | 3950 | -c "Handshake was completed" \ | 
|  | 3951 |  | 
|  | 3952 | requires_gnutls | 
|  | 3953 | run_test    "DER format: with 4 trailing random bytes" \ | 
|  | 3954 | "$P_SRV crt_file=data_files/server5-der4.crt \ | 
|  | 3955 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3956 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3957 | 0 \ | 
|  | 3958 | -c "Handshake was completed" \ | 
|  | 3959 |  | 
|  | 3960 | requires_gnutls | 
|  | 3961 | run_test    "DER format: with 8 trailing random bytes" \ | 
|  | 3962 | "$P_SRV crt_file=data_files/server5-der8.crt \ | 
|  | 3963 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3964 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3965 | 0 \ | 
|  | 3966 | -c "Handshake was completed" \ | 
|  | 3967 |  | 
|  | 3968 | requires_gnutls | 
|  | 3969 | run_test    "DER format: with 9 trailing random bytes" \ | 
|  | 3970 | "$P_SRV crt_file=data_files/server5-der9.crt \ | 
|  | 3971 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3972 | "$G_CLI localhost" \ | 
| Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3973 | 0 \ | 
|  | 3974 | -c "Handshake was completed" \ | 
|  | 3975 |  | 
| Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3976 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication | 
|  | 3977 | # When updating these tests, modify the matching authentication tests accordingly | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3978 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3979 | run_test    "Authentication: server badcert, client required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3980 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 3981 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3982 | "$P_CLI debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3983 | 1 \ | 
|  | 3984 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3985 | -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] | 3986 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3987 | -c "X509 - Certificate verification failed" | 
|  | 3988 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3989 | run_test    "Authentication: server badcert, client optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3990 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 3991 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3992 | "$P_CLI debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3993 | 0 \ | 
|  | 3994 | -c "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3995 | -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] | 3996 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3997 | -C "X509 - Certificate verification failed" | 
|  | 3998 |  | 
| Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3999 | run_test    "Authentication: server goodcert, client optional, no trusted CA" \ | 
|  | 4000 | "$P_SRV" \ | 
|  | 4001 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ | 
|  | 4002 | 0 \ | 
|  | 4003 | -c "x509_verify_cert() returned" \ | 
|  | 4004 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4005 | -c "! Certificate verification flags"\ | 
|  | 4006 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 4007 | -C "X509 - Certificate verification failed" \ | 
|  | 4008 | -C "SSL - No CA Chain is set, but required to operate" | 
|  | 4009 |  | 
|  | 4010 | run_test    "Authentication: server goodcert, client required, no trusted CA" \ | 
|  | 4011 | "$P_SRV" \ | 
|  | 4012 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ | 
|  | 4013 | 1 \ | 
|  | 4014 | -c "x509_verify_cert() returned" \ | 
|  | 4015 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4016 | -c "! Certificate verification flags"\ | 
|  | 4017 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4018 | -c "SSL - No CA Chain is set, but required to operate" | 
|  | 4019 |  | 
|  | 4020 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 4021 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 4022 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 4023 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 4024 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 4025 | # different means to have the server ignoring the client's supported curve list. | 
|  | 4026 |  | 
|  | 4027 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 4028 | run_test    "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 4029 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 4030 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 4031 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ | 
|  | 4032 | 1 \ | 
|  | 4033 | -c "bad certificate (EC key curve)"\ | 
|  | 4034 | -c "! Certificate verification flags"\ | 
|  | 4035 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 4036 |  | 
|  | 4037 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 4038 | run_test    "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 4039 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 4040 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 4041 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ | 
|  | 4042 | 1 \ | 
|  | 4043 | -c "bad certificate (EC key curve)"\ | 
|  | 4044 | -c "! Certificate verification flags"\ | 
|  | 4045 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 4046 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4047 | run_test    "Authentication: server badcert, client none" \ | 
| Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 4048 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4049 | key_file=data_files/server5.key" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4050 | "$P_CLI debug_level=1 auth_mode=none" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4051 | 0 \ | 
|  | 4052 | -C "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4053 | -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] | 4054 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4055 | -C "X509 - Certificate verification failed" | 
|  | 4056 |  | 
| Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 4057 | run_test    "Authentication: client SHA256, server required" \ | 
|  | 4058 | "$P_SRV auth_mode=required" \ | 
|  | 4059 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 4060 | key_file=data_files/server6.key \ | 
|  | 4061 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 4062 | 0 \ | 
|  | 4063 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 4064 | -c "Supported Signature Algorithm found: 5," | 
|  | 4065 |  | 
|  | 4066 | run_test    "Authentication: client SHA384, server required" \ | 
|  | 4067 | "$P_SRV auth_mode=required" \ | 
|  | 4068 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 4069 | key_file=data_files/server6.key \ | 
|  | 4070 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 4071 | 0 \ | 
|  | 4072 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 4073 | -c "Supported Signature Algorithm found: 5," | 
|  | 4074 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4075 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 4076 | run_test    "Authentication: client has no cert, server required (SSLv3)" \ | 
|  | 4077 | "$P_SRV debug_level=3 min_version=ssl3 auth_mode=required" \ | 
|  | 4078 | "$P_CLI debug_level=3 force_version=ssl3 crt_file=none \ | 
|  | 4079 | key_file=data_files/server5.key" \ | 
|  | 4080 | 1 \ | 
|  | 4081 | -S "skip write certificate request" \ | 
|  | 4082 | -C "skip parse certificate request" \ | 
|  | 4083 | -c "got a certificate request" \ | 
|  | 4084 | -c "got no certificate to send" \ | 
|  | 4085 | -S "x509_verify_cert() returned" \ | 
|  | 4086 | -s "client has no certificate" \ | 
|  | 4087 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4088 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4089 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 4090 |  | 
|  | 4091 | run_test    "Authentication: client has no cert, server required (TLS)" \ | 
|  | 4092 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 4093 | "$P_CLI debug_level=3 crt_file=none \ | 
|  | 4094 | key_file=data_files/server5.key" \ | 
|  | 4095 | 1 \ | 
|  | 4096 | -S "skip write certificate request" \ | 
|  | 4097 | -C "skip parse certificate request" \ | 
|  | 4098 | -c "got a certificate request" \ | 
|  | 4099 | -c "= write certificate$" \ | 
|  | 4100 | -C "skip write certificate$" \ | 
|  | 4101 | -S "x509_verify_cert() returned" \ | 
|  | 4102 | -s "client has no certificate" \ | 
|  | 4103 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4104 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4105 | -s "No client certification received from the client, but required by the authentication mode" | 
|  | 4106 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4107 | run_test    "Authentication: client badcert, server required" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4108 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 4109 | "$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] | 4110 | key_file=data_files/server5.key" \ | 
|  | 4111 | 1 \ | 
|  | 4112 | -S "skip write certificate request" \ | 
|  | 4113 | -C "skip parse certificate request" \ | 
|  | 4114 | -c "got a certificate request" \ | 
|  | 4115 | -C "skip write certificate" \ | 
|  | 4116 | -C "skip write certificate verify" \ | 
|  | 4117 | -S "skip parse certificate verify" \ | 
|  | 4118 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4119 | -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] | 4120 | -s "! mbedtls_ssl_handshake returned" \ | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4121 | -s "send alert level=2 message=48" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4122 | -c "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4123 | -s "X509 - Certificate verification failed" | 
| Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4124 | # We don't check that the client receives the alert because it might | 
|  | 4125 | # detect that its write end of the connection is closed and abort | 
|  | 4126 | # before reading the alert message. | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4127 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4128 | run_test    "Authentication: client cert not trusted, server required" \ | 
|  | 4129 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 4130 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 4131 | key_file=data_files/server5.key" \ | 
|  | 4132 | 1 \ | 
|  | 4133 | -S "skip write certificate request" \ | 
|  | 4134 | -C "skip parse certificate request" \ | 
|  | 4135 | -c "got a certificate request" \ | 
|  | 4136 | -C "skip write certificate" \ | 
|  | 4137 | -C "skip write certificate verify" \ | 
|  | 4138 | -S "skip parse certificate verify" \ | 
|  | 4139 | -s "x509_verify_cert() returned" \ | 
|  | 4140 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4141 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4142 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4143 | -s "X509 - Certificate verification failed" | 
|  | 4144 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4145 | run_test    "Authentication: client badcert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4146 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 4147 | "$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] | 4148 | key_file=data_files/server5.key" \ | 
|  | 4149 | 0 \ | 
|  | 4150 | -S "skip write certificate request" \ | 
|  | 4151 | -C "skip parse certificate request" \ | 
|  | 4152 | -c "got a certificate request" \ | 
|  | 4153 | -C "skip write certificate" \ | 
|  | 4154 | -C "skip write certificate verify" \ | 
|  | 4155 | -S "skip parse certificate verify" \ | 
|  | 4156 | -s "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4157 | -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] | 4158 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4159 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4160 | -S "X509 - Certificate verification failed" | 
|  | 4161 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4162 | run_test    "Authentication: client badcert, server none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4163 | "$P_SRV debug_level=3 auth_mode=none" \ | 
|  | 4164 | "$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] | 4165 | key_file=data_files/server5.key" \ | 
|  | 4166 | 0 \ | 
|  | 4167 | -s "skip write certificate request" \ | 
|  | 4168 | -C "skip parse certificate request" \ | 
|  | 4169 | -c "got no certificate request" \ | 
|  | 4170 | -c "skip write certificate" \ | 
|  | 4171 | -c "skip write certificate verify" \ | 
|  | 4172 | -s "skip parse certificate verify" \ | 
|  | 4173 | -S "x509_verify_cert() returned" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4174 | -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] | 4175 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4176 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4177 | -S "X509 - Certificate verification failed" | 
|  | 4178 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4179 | run_test    "Authentication: client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4180 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
|  | 4181 | "$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] | 4182 | 0 \ | 
|  | 4183 | -S "skip write certificate request" \ | 
|  | 4184 | -C "skip parse certificate request" \ | 
|  | 4185 | -c "got a certificate request" \ | 
|  | 4186 | -C "skip write certificate$" \ | 
|  | 4187 | -C "got no certificate to send" \ | 
|  | 4188 | -S "SSLv3 client has no certificate" \ | 
|  | 4189 | -c "skip write certificate verify" \ | 
|  | 4190 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4191 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4192 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4193 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4194 | -S "X509 - Certificate verification failed" | 
|  | 4195 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4196 | run_test    "Authentication: openssl client no cert, server optional" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4197 | "$P_SRV debug_level=3 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4198 | "$O_CLI" \ | 
|  | 4199 | 0 \ | 
|  | 4200 | -S "skip write certificate request" \ | 
|  | 4201 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4202 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4203 | -S "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4204 | -S "X509 - Certificate verification failed" | 
|  | 4205 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4206 | run_test    "Authentication: client no cert, openssl server optional" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4207 | "$O_SRV -verify 10" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4208 | "$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] | 4209 | 0 \ | 
|  | 4210 | -C "skip parse certificate request" \ | 
|  | 4211 | -c "got a certificate request" \ | 
|  | 4212 | -C "skip write certificate$" \ | 
|  | 4213 | -c "skip write certificate verify" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4214 | -C "! mbedtls_ssl_handshake returned" | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4215 |  | 
| Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4216 | run_test    "Authentication: client no cert, openssl server required" \ | 
|  | 4217 | "$O_SRV -Verify 10" \ | 
|  | 4218 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ | 
|  | 4219 | 1 \ | 
|  | 4220 | -C "skip parse certificate request" \ | 
|  | 4221 | -c "got a certificate request" \ | 
|  | 4222 | -C "skip write certificate$" \ | 
|  | 4223 | -c "skip write certificate verify" \ | 
|  | 4224 | -c "! mbedtls_ssl_handshake returned" | 
|  | 4225 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 4226 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4227 | run_test    "Authentication: client no cert, ssl3" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4228 | "$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] | 4229 | "$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] | 4230 | 0 \ | 
|  | 4231 | -S "skip write certificate request" \ | 
|  | 4232 | -C "skip parse certificate request" \ | 
|  | 4233 | -c "got a certificate request" \ | 
|  | 4234 | -C "skip write certificate$" \ | 
|  | 4235 | -c "skip write certificate verify" \ | 
|  | 4236 | -c "got no certificate to send" \ | 
|  | 4237 | -s "SSLv3 client has no certificate" \ | 
|  | 4238 | -s "skip parse certificate verify" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4239 | -s "! Certificate was missing" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4240 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4241 | -C "! mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4242 | -S "X509 - Certificate verification failed" | 
|  | 4243 |  | 
| Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 4244 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its | 
|  | 4245 | # default value (8) | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4246 |  | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4247 | MAX_IM_CA='8' | 
| Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 4248 | MAX_IM_CA_CONFIG=$( ../scripts/config.py get MBEDTLS_X509_MAX_INTERMEDIATE_CA) | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4249 |  | 
| Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4250 | if [ -n "$MAX_IM_CA_CONFIG" ] && [ "$MAX_IM_CA_CONFIG" -ne "$MAX_IM_CA" ]; then | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 4251 | cat <<EOF | 
|  | 4252 | ${CONFIG_H} contains a value for the configuration of | 
|  | 4253 | MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script's | 
|  | 4254 | test value of ${MAX_IM_CA}. | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4255 |  | 
| Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 4256 | The tests assume this value and if it changes, the tests in this | 
|  | 4257 | script should also be adjusted. | 
|  | 4258 | EOF | 
| Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 4259 | exit 1 | 
| Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4260 | fi | 
|  | 4261 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4262 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4263 | run_test    "Authentication: server max_int chain, client default" \ | 
|  | 4264 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4265 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4266 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4267 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4268 | -C "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4269 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4270 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4271 | run_test    "Authentication: server max_int+1 chain, client default" \ | 
|  | 4272 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4273 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4274 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4275 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4276 | -c "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4277 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4278 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4279 | run_test    "Authentication: server max_int+1 chain, client optional" \ | 
|  | 4280 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4281 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4282 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 4283 | auth_mode=optional" \ | 
|  | 4284 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4285 | -c "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4286 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4287 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4288 | run_test    "Authentication: server max_int+1 chain, client none" \ | 
|  | 4289 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4290 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4291 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 4292 | auth_mode=none" \ | 
|  | 4293 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4294 | -C "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4295 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4296 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4297 | run_test    "Authentication: client max_int+1 chain, server default" \ | 
|  | 4298 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4299 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4300 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4301 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4302 | -S "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4303 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4304 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4305 | run_test    "Authentication: client max_int+1 chain, server optional" \ | 
|  | 4306 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 4307 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4308 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4309 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4310 | -s "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4311 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4312 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4313 | run_test    "Authentication: client max_int+1 chain, server required" \ | 
|  | 4314 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4315 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4316 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4317 | 1 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4318 | -s "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4319 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4320 | requires_full_size_output_buffer | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4321 | run_test    "Authentication: client max_int chain, server required" \ | 
|  | 4322 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4323 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4324 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4325 | 0 \ | 
| Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4326 | -S "X509 - A fatal error occurred" | 
| Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4327 |  | 
| Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4328 | # Tests for CA list in CertificateRequest messages | 
|  | 4329 |  | 
|  | 4330 | run_test    "Authentication: send CA list in CertificateRequest  (default)" \ | 
|  | 4331 | "$P_SRV debug_level=3 auth_mode=required" \ | 
|  | 4332 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 4333 | key_file=data_files/server6.key" \ | 
|  | 4334 | 0 \ | 
|  | 4335 | -s "requested DN" | 
|  | 4336 |  | 
|  | 4337 | run_test    "Authentication: do not send CA list in CertificateRequest" \ | 
|  | 4338 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 4339 | "$P_CLI crt_file=data_files/server6.crt \ | 
|  | 4340 | key_file=data_files/server6.key" \ | 
|  | 4341 | 0 \ | 
|  | 4342 | -S "requested DN" | 
|  | 4343 |  | 
|  | 4344 | run_test    "Authentication: send CA list in CertificateRequest, client self signed" \ | 
|  | 4345 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ | 
|  | 4346 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 4347 | key_file=data_files/server5.key" \ | 
|  | 4348 | 1 \ | 
|  | 4349 | -S "requested DN" \ | 
|  | 4350 | -s "x509_verify_cert() returned" \ | 
|  | 4351 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4352 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4353 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4354 | -s "X509 - Certificate verification failed" | 
|  | 4355 |  | 
| Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4356 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests | 
|  | 4357 | # When updating these tests, modify the matching authentication tests accordingly | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4358 |  | 
|  | 4359 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4360 | run_test    "Authentication, CA callback: server badcert, client required" \ | 
|  | 4361 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 4362 | key_file=data_files/server5.key" \ | 
|  | 4363 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4364 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4365 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4366 | -c "x509_verify_cert() returned" \ | 
|  | 4367 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4368 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4369 | -c "X509 - Certificate verification failed" | 
|  | 4370 |  | 
|  | 4371 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4372 | run_test    "Authentication, CA callback: server badcert, client optional" \ | 
|  | 4373 | "$P_SRV crt_file=data_files/server5-badsign.crt \ | 
|  | 4374 | key_file=data_files/server5.key" \ | 
|  | 4375 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ | 
|  | 4376 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4377 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4378 | -c "x509_verify_cert() returned" \ | 
|  | 4379 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4380 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 4381 | -C "X509 - Certificate verification failed" | 
|  | 4382 |  | 
|  | 4383 | # The purpose of the next two tests is to test the client's behaviour when receiving a server | 
|  | 4384 | # certificate with an unsupported elliptic curve. This should usually not happen because | 
|  | 4385 | # the client informs the server about the supported curves - it does, though, in the | 
|  | 4386 | # corner case of a static ECDH suite, because the server doesn't check the curve on that | 
|  | 4387 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a | 
|  | 4388 | # different means to have the server ignoring the client's supported curve list. | 
|  | 4389 |  | 
|  | 4390 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 4391 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4392 | run_test    "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ | 
|  | 4393 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 4394 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 4395 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ | 
|  | 4396 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4397 | -c "use CA callback for X.509 CRT verification" \ | 
|  | 4398 | -c "bad certificate (EC key curve)" \ | 
|  | 4399 | -c "! Certificate verification flags" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4400 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage | 
|  | 4401 |  | 
|  | 4402 | requires_config_enabled MBEDTLS_ECP_C | 
|  | 4403 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4404 | run_test    "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ | 
|  | 4405 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ | 
|  | 4406 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 4407 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ | 
|  | 4408 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4409 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4410 | -c "bad certificate (EC key curve)"\ | 
|  | 4411 | -c "! Certificate verification flags"\ | 
|  | 4412 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check | 
|  | 4413 |  | 
|  | 4414 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4415 | run_test    "Authentication, CA callback: client SHA256, server required" \ | 
|  | 4416 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4417 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 4418 | key_file=data_files/server6.key \ | 
|  | 4419 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ | 
|  | 4420 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4421 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4422 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 4423 | -c "Supported Signature Algorithm found: 5," | 
|  | 4424 |  | 
|  | 4425 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4426 | run_test    "Authentication, CA callback: client SHA384, server required" \ | 
|  | 4427 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4428 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ | 
|  | 4429 | key_file=data_files/server6.key \ | 
|  | 4430 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ | 
|  | 4431 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4432 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4433 | -c "Supported Signature Algorithm found: 4," \ | 
|  | 4434 | -c "Supported Signature Algorithm found: 5," | 
|  | 4435 |  | 
|  | 4436 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4437 | run_test    "Authentication, CA callback: client badcert, server required" \ | 
|  | 4438 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4439 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ | 
|  | 4440 | key_file=data_files/server5.key" \ | 
|  | 4441 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4442 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4443 | -S "skip write certificate request" \ | 
|  | 4444 | -C "skip parse certificate request" \ | 
|  | 4445 | -c "got a certificate request" \ | 
|  | 4446 | -C "skip write certificate" \ | 
|  | 4447 | -C "skip write certificate verify" \ | 
|  | 4448 | -S "skip parse certificate verify" \ | 
|  | 4449 | -s "x509_verify_cert() returned" \ | 
|  | 4450 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4451 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4452 | -s "send alert level=2 message=48" \ | 
|  | 4453 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4454 | -s "X509 - Certificate verification failed" | 
|  | 4455 | # We don't check that the client receives the alert because it might | 
|  | 4456 | # detect that its write end of the connection is closed and abort | 
|  | 4457 | # before reading the alert message. | 
|  | 4458 |  | 
|  | 4459 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4460 | run_test    "Authentication, CA callback: client cert not trusted, server required" \ | 
|  | 4461 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ | 
|  | 4462 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ | 
|  | 4463 | key_file=data_files/server5.key" \ | 
|  | 4464 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4465 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4466 | -S "skip write certificate request" \ | 
|  | 4467 | -C "skip parse certificate request" \ | 
|  | 4468 | -c "got a certificate request" \ | 
|  | 4469 | -C "skip write certificate" \ | 
|  | 4470 | -C "skip write certificate verify" \ | 
|  | 4471 | -S "skip parse certificate verify" \ | 
|  | 4472 | -s "x509_verify_cert() returned" \ | 
|  | 4473 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4474 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 4475 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 4476 | -s "X509 - Certificate verification failed" | 
|  | 4477 |  | 
|  | 4478 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4479 | run_test    "Authentication, CA callback: client badcert, server optional" \ | 
|  | 4480 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ | 
|  | 4481 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ | 
|  | 4482 | key_file=data_files/server5.key" \ | 
|  | 4483 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4484 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4485 | -S "skip write certificate request" \ | 
|  | 4486 | -C "skip parse certificate request" \ | 
|  | 4487 | -c "got a certificate request" \ | 
|  | 4488 | -C "skip write certificate" \ | 
|  | 4489 | -C "skip write certificate verify" \ | 
|  | 4490 | -S "skip parse certificate verify" \ | 
|  | 4491 | -s "x509_verify_cert() returned" \ | 
|  | 4492 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4493 | -S "! mbedtls_ssl_handshake returned" \ | 
|  | 4494 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 4495 | -S "X509 - Certificate verification failed" | 
|  | 4496 |  | 
|  | 4497 | requires_full_size_output_buffer | 
|  | 4498 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4499 | run_test    "Authentication, CA callback: server max_int chain, client default" \ | 
|  | 4500 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4501 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4502 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4503 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4504 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4505 | -C "X509 - A fatal error occurred" | 
|  | 4506 |  | 
|  | 4507 | requires_full_size_output_buffer | 
|  | 4508 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4509 | run_test    "Authentication, CA callback: server max_int+1 chain, client default" \ | 
|  | 4510 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4511 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4512 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ | 
|  | 4513 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4514 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4515 | -c "X509 - A fatal error occurred" | 
|  | 4516 |  | 
|  | 4517 | requires_full_size_output_buffer | 
|  | 4518 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4519 | run_test    "Authentication, CA callback: server max_int+1 chain, client optional" \ | 
|  | 4520 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4521 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4522 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ | 
|  | 4523 | debug_level=3 auth_mode=optional" \ | 
|  | 4524 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4525 | -c "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4526 | -c "X509 - A fatal error occurred" | 
|  | 4527 |  | 
|  | 4528 | requires_full_size_output_buffer | 
|  | 4529 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4530 | run_test    "Authentication, CA callback: client max_int+1 chain, server optional" \ | 
|  | 4531 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ | 
|  | 4532 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4533 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4534 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4535 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4536 | -s "X509 - A fatal error occurred" | 
|  | 4537 |  | 
|  | 4538 | requires_full_size_output_buffer | 
|  | 4539 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4540 | run_test    "Authentication, CA callback: client max_int+1 chain, server required" \ | 
|  | 4541 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4542 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ | 
|  | 4543 | key_file=data_files/dir-maxpath/10.key" \ | 
|  | 4544 | 1 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4545 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4546 | -s "X509 - A fatal error occurred" | 
|  | 4547 |  | 
|  | 4548 | requires_full_size_output_buffer | 
|  | 4549 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK | 
|  | 4550 | run_test    "Authentication, CA callback: client max_int chain, server required" \ | 
|  | 4551 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ | 
|  | 4552 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ | 
|  | 4553 | key_file=data_files/dir-maxpath/09.key" \ | 
|  | 4554 | 0 \ | 
| Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4555 | -s "use CA callback for X.509 CRT verification" \ | 
| Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4556 | -S "X509 - A fatal error occurred" | 
|  | 4557 |  | 
| Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4558 | # Tests for certificate selection based on SHA verson | 
|  | 4559 |  | 
|  | 4560 | run_test    "Certificate hash: client TLS 1.2 -> SHA-2" \ | 
|  | 4561 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 4562 | key_file=data_files/server5.key \ | 
|  | 4563 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 4564 | key_file2=data_files/server5.key" \ | 
|  | 4565 | "$P_CLI force_version=tls1_2" \ | 
|  | 4566 | 0 \ | 
|  | 4567 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 4568 | -C "signed using.*ECDSA with SHA1" | 
|  | 4569 |  | 
|  | 4570 | run_test    "Certificate hash: client TLS 1.1 -> SHA-1" \ | 
|  | 4571 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 4572 | key_file=data_files/server5.key \ | 
|  | 4573 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 4574 | key_file2=data_files/server5.key" \ | 
|  | 4575 | "$P_CLI force_version=tls1_1" \ | 
|  | 4576 | 0 \ | 
|  | 4577 | -C "signed using.*ECDSA with SHA256" \ | 
|  | 4578 | -c "signed using.*ECDSA with SHA1" | 
|  | 4579 |  | 
|  | 4580 | run_test    "Certificate hash: client TLS 1.0 -> SHA-1" \ | 
|  | 4581 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 4582 | key_file=data_files/server5.key \ | 
|  | 4583 | crt_file2=data_files/server5-sha1.crt \ | 
|  | 4584 | key_file2=data_files/server5.key" \ | 
|  | 4585 | "$P_CLI force_version=tls1" \ | 
|  | 4586 | 0 \ | 
|  | 4587 | -C "signed using.*ECDSA with SHA256" \ | 
|  | 4588 | -c "signed using.*ECDSA with SHA1" | 
|  | 4589 |  | 
|  | 4590 | run_test    "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 1)" \ | 
|  | 4591 | "$P_SRV crt_file=data_files/server5.crt \ | 
|  | 4592 | key_file=data_files/server5.key \ | 
|  | 4593 | crt_file2=data_files/server6.crt \ | 
|  | 4594 | key_file2=data_files/server6.key" \ | 
|  | 4595 | "$P_CLI force_version=tls1_1" \ | 
|  | 4596 | 0 \ | 
|  | 4597 | -c "serial number.*09" \ | 
|  | 4598 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 4599 | -C "signed using.*ECDSA with SHA1" | 
|  | 4600 |  | 
|  | 4601 | run_test    "Certificate hash: client TLS 1.1, no SHA-1 -> SHA-2 (order 2)" \ | 
|  | 4602 | "$P_SRV crt_file=data_files/server6.crt \ | 
|  | 4603 | key_file=data_files/server6.key \ | 
|  | 4604 | crt_file2=data_files/server5.crt \ | 
|  | 4605 | key_file2=data_files/server5.key" \ | 
|  | 4606 | "$P_CLI force_version=tls1_1" \ | 
|  | 4607 | 0 \ | 
|  | 4608 | -c "serial number.*0A" \ | 
|  | 4609 | -c "signed using.*ECDSA with SHA256" \ | 
|  | 4610 | -C "signed using.*ECDSA with SHA1" | 
|  | 4611 |  | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4612 | # tests for SNI | 
|  | 4613 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4614 | run_test    "SNI: no SNI callback" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4615 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4616 | 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] | 4617 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4618 | 0 \ | 
|  | 4619 | -S "parse ServerName extension" \ | 
|  | 4620 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 4621 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4622 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4623 | run_test    "SNI: matching cert 1" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4624 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4625 | 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] | 4626 | 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] | 4627 | "$P_CLI server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4628 | 0 \ | 
|  | 4629 | -s "parse ServerName extension" \ | 
|  | 4630 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4631 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4632 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4633 | run_test    "SNI: matching cert 2" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4634 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4635 | 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] | 4636 | 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] | 4637 | "$P_CLI server_name=polarssl.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4638 | 0 \ | 
|  | 4639 | -s "parse ServerName extension" \ | 
|  | 4640 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4641 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4642 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4643 | run_test    "SNI: no matching cert" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4644 | "$P_SRV debug_level=3 \ | 
| Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4645 | 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] | 4646 | 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] | 4647 | "$P_CLI server_name=nonesuch.example" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4648 | 1 \ | 
|  | 4649 | -s "parse ServerName extension" \ | 
|  | 4650 | -s "ssl_sni_wrapper() returned" \ | 
|  | 4651 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 4652 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 4653 | -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] | 4654 |  | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4655 | run_test    "SNI: client auth no override: optional" \ | 
|  | 4656 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4657 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4658 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 4659 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4660 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4661 | -S "skip write certificate request" \ | 
|  | 4662 | -C "skip parse certificate request" \ | 
|  | 4663 | -c "got a certificate request" \ | 
|  | 4664 | -C "skip write certificate" \ | 
|  | 4665 | -C "skip write certificate verify" \ | 
|  | 4666 | -S "skip parse certificate verify" | 
|  | 4667 |  | 
|  | 4668 | run_test    "SNI: client auth override: none -> optional" \ | 
|  | 4669 | "$P_SRV debug_level=3 auth_mode=none \ | 
|  | 4670 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4671 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 4672 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4673 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4674 | -S "skip write certificate request" \ | 
|  | 4675 | -C "skip parse certificate request" \ | 
|  | 4676 | -c "got a certificate request" \ | 
|  | 4677 | -C "skip write certificate" \ | 
|  | 4678 | -C "skip write certificate verify" \ | 
|  | 4679 | -S "skip parse certificate verify" | 
|  | 4680 |  | 
|  | 4681 | run_test    "SNI: client auth override: optional -> none" \ | 
|  | 4682 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4683 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4684 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 4685 | "$P_CLI debug_level=3 server_name=localhost" \ | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4686 | 0 \ | 
| Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4687 | -s "skip write certificate request" \ | 
|  | 4688 | -C "skip parse certificate request" \ | 
|  | 4689 | -c "got no certificate request" \ | 
|  | 4690 | -c "skip write certificate" \ | 
|  | 4691 | -c "skip write certificate verify" \ | 
|  | 4692 | -s "skip parse certificate verify" | 
|  | 4693 |  | 
| Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4694 | run_test    "SNI: CA no override" \ | 
|  | 4695 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4696 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4697 | ca_file=data_files/test-ca.crt \ | 
|  | 4698 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 4699 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 4700 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4701 | 1 \ | 
|  | 4702 | -S "skip write certificate request" \ | 
|  | 4703 | -C "skip parse certificate request" \ | 
|  | 4704 | -c "got a certificate request" \ | 
|  | 4705 | -C "skip write certificate" \ | 
|  | 4706 | -C "skip write certificate verify" \ | 
|  | 4707 | -S "skip parse certificate verify" \ | 
|  | 4708 | -s "x509_verify_cert() returned" \ | 
|  | 4709 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4710 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4711 |  | 
|  | 4712 | run_test    "SNI: CA override" \ | 
|  | 4713 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4714 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4715 | ca_file=data_files/test-ca.crt \ | 
|  | 4716 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 4717 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 4718 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4719 | 0 \ | 
|  | 4720 | -S "skip write certificate request" \ | 
|  | 4721 | -C "skip parse certificate request" \ | 
|  | 4722 | -c "got a certificate request" \ | 
|  | 4723 | -C "skip write certificate" \ | 
|  | 4724 | -C "skip write certificate verify" \ | 
|  | 4725 | -S "skip parse certificate verify" \ | 
|  | 4726 | -S "x509_verify_cert() returned" \ | 
|  | 4727 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4728 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4729 |  | 
|  | 4730 | run_test    "SNI: CA override with CRL" \ | 
|  | 4731 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4732 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4733 | ca_file=data_files/test-ca.crt \ | 
|  | 4734 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 4735 | "$P_CLI debug_level=3 server_name=localhost \ | 
|  | 4736 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4737 | 1 \ | 
|  | 4738 | -S "skip write certificate request" \ | 
|  | 4739 | -C "skip parse certificate request" \ | 
|  | 4740 | -c "got a certificate request" \ | 
|  | 4741 | -C "skip write certificate" \ | 
|  | 4742 | -C "skip write certificate verify" \ | 
|  | 4743 | -S "skip parse certificate verify" \ | 
|  | 4744 | -s "x509_verify_cert() returned" \ | 
|  | 4745 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4746 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 4747 |  | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4748 | # Tests for SNI and DTLS | 
|  | 4749 |  | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4750 | run_test    "SNI: DTLS, no SNI callback" \ | 
|  | 4751 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4752 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ | 
|  | 4753 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 4754 | 0 \ | 
|  | 4755 | -S "parse ServerName extension" \ | 
|  | 4756 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ | 
|  | 4757 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 4758 |  | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4759 | run_test    "SNI: DTLS, matching cert 1" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4760 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4761 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4762 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 4763 | "$P_CLI server_name=localhost dtls=1" \ | 
|  | 4764 | 0 \ | 
|  | 4765 | -s "parse ServerName extension" \ | 
|  | 4766 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4767 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" | 
|  | 4768 |  | 
| Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4769 | run_test    "SNI: DTLS, matching cert 2" \ | 
|  | 4770 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4771 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4772 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 4773 | "$P_CLI server_name=polarssl.example dtls=1" \ | 
|  | 4774 | 0 \ | 
|  | 4775 | -s "parse ServerName extension" \ | 
|  | 4776 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 4777 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 4778 |  | 
|  | 4779 | run_test    "SNI: DTLS, no matching cert" \ | 
|  | 4780 | "$P_SRV debug_level=3 dtls=1 \ | 
|  | 4781 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4782 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 4783 | "$P_CLI server_name=nonesuch.example dtls=1" \ | 
|  | 4784 | 1 \ | 
|  | 4785 | -s "parse ServerName extension" \ | 
|  | 4786 | -s "ssl_sni_wrapper() returned" \ | 
|  | 4787 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 4788 | -c "mbedtls_ssl_handshake returned" \ | 
|  | 4789 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 4790 |  | 
|  | 4791 | run_test    "SNI: DTLS, client auth no override: optional" \ | 
|  | 4792 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4793 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4794 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ | 
|  | 4795 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 4796 | 0 \ | 
|  | 4797 | -S "skip write certificate request" \ | 
|  | 4798 | -C "skip parse certificate request" \ | 
|  | 4799 | -c "got a certificate request" \ | 
|  | 4800 | -C "skip write certificate" \ | 
|  | 4801 | -C "skip write certificate verify" \ | 
|  | 4802 | -S "skip parse certificate verify" | 
|  | 4803 |  | 
|  | 4804 | run_test    "SNI: DTLS, client auth override: none -> optional" \ | 
|  | 4805 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ | 
|  | 4806 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4807 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ | 
|  | 4808 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 4809 | 0 \ | 
|  | 4810 | -S "skip write certificate request" \ | 
|  | 4811 | -C "skip parse certificate request" \ | 
|  | 4812 | -c "got a certificate request" \ | 
|  | 4813 | -C "skip write certificate" \ | 
|  | 4814 | -C "skip write certificate verify" \ | 
|  | 4815 | -S "skip parse certificate verify" | 
|  | 4816 |  | 
|  | 4817 | run_test    "SNI: DTLS, client auth override: optional -> none" \ | 
|  | 4818 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4819 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4820 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ | 
|  | 4821 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ | 
|  | 4822 | 0 \ | 
|  | 4823 | -s "skip write certificate request" \ | 
|  | 4824 | -C "skip parse certificate request" \ | 
|  | 4825 | -c "got no certificate request" \ | 
|  | 4826 | -c "skip write certificate" \ | 
|  | 4827 | -c "skip write certificate verify" \ | 
|  | 4828 | -s "skip parse certificate verify" | 
|  | 4829 |  | 
|  | 4830 | run_test    "SNI: DTLS, CA no override" \ | 
|  | 4831 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4832 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4833 | ca_file=data_files/test-ca.crt \ | 
|  | 4834 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ | 
|  | 4835 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 4836 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4837 | 1 \ | 
|  | 4838 | -S "skip write certificate request" \ | 
|  | 4839 | -C "skip parse certificate request" \ | 
|  | 4840 | -c "got a certificate request" \ | 
|  | 4841 | -C "skip write certificate" \ | 
|  | 4842 | -C "skip write certificate verify" \ | 
|  | 4843 | -S "skip parse certificate verify" \ | 
|  | 4844 | -s "x509_verify_cert() returned" \ | 
|  | 4845 | -s "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4846 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4847 |  | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4848 | run_test    "SNI: DTLS, CA override" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4849 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ | 
|  | 4850 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 4851 | ca_file=data_files/test-ca.crt \ | 
|  | 4852 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ | 
|  | 4853 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 4854 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4855 | 0 \ | 
|  | 4856 | -S "skip write certificate request" \ | 
|  | 4857 | -C "skip parse certificate request" \ | 
|  | 4858 | -c "got a certificate request" \ | 
|  | 4859 | -C "skip write certificate" \ | 
|  | 4860 | -C "skip write certificate verify" \ | 
|  | 4861 | -S "skip parse certificate verify" \ | 
|  | 4862 | -S "x509_verify_cert() returned" \ | 
|  | 4863 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4864 | -S "The certificate has been revoked (is on a CRL)" | 
|  | 4865 |  | 
| Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4866 | run_test    "SNI: DTLS, CA override with CRL" \ | 
| Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4867 | "$P_SRV debug_level=3 auth_mode=optional \ | 
|  | 4868 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ | 
|  | 4869 | ca_file=data_files/test-ca.crt \ | 
|  | 4870 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ | 
|  | 4871 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ | 
|  | 4872 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ | 
|  | 4873 | 1 \ | 
|  | 4874 | -S "skip write certificate request" \ | 
|  | 4875 | -C "skip parse certificate request" \ | 
|  | 4876 | -c "got a certificate request" \ | 
|  | 4877 | -C "skip write certificate" \ | 
|  | 4878 | -C "skip write certificate verify" \ | 
|  | 4879 | -S "skip parse certificate verify" \ | 
|  | 4880 | -s "x509_verify_cert() returned" \ | 
|  | 4881 | -S "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 4882 | -s "The certificate has been revoked (is on a CRL)" | 
|  | 4883 |  | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4884 | # Tests for non-blocking I/O: exercise a variety of handshake flows | 
|  | 4885 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4886 | run_test    "Non-blocking I/O: basic handshake" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4887 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 4888 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 4889 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4890 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4891 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4892 | -c "Read from server: .* bytes read" | 
|  | 4893 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4894 | run_test    "Non-blocking I/O: client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4895 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ | 
|  | 4896 | "$P_CLI nbio=2 tickets=0" \ | 
|  | 4897 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4898 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4899 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4900 | -c "Read from server: .* bytes read" | 
|  | 4901 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4902 | run_test    "Non-blocking I/O: ticket" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4903 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 4904 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 4905 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4906 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4907 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4908 | -c "Read from server: .* bytes read" | 
|  | 4909 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4910 | run_test    "Non-blocking I/O: ticket + client auth" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4911 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 4912 | "$P_CLI nbio=2 tickets=1" \ | 
|  | 4913 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4914 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4915 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4916 | -c "Read from server: .* bytes read" | 
|  | 4917 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4918 | run_test    "Non-blocking I/O: ticket + client auth + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4919 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ | 
|  | 4920 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 4921 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4922 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4923 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4924 | -c "Read from server: .* bytes read" | 
|  | 4925 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4926 | run_test    "Non-blocking I/O: ticket + resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4927 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ | 
|  | 4928 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ | 
|  | 4929 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4930 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4931 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4932 | -c "Read from server: .* bytes read" | 
|  | 4933 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4934 | run_test    "Non-blocking I/O: session-id resume" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4935 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ | 
|  | 4936 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ | 
|  | 4937 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4938 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4939 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4940 | -c "Read from server: .* bytes read" | 
|  | 4941 |  | 
| Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4942 | # Tests for event-driven I/O: exercise a variety of handshake flows | 
|  | 4943 |  | 
|  | 4944 | run_test    "Event-driven I/O: basic handshake" \ | 
|  | 4945 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 4946 | "$P_CLI event=1 tickets=0" \ | 
|  | 4947 | 0 \ | 
|  | 4948 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4949 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4950 | -c "Read from server: .* bytes read" | 
|  | 4951 |  | 
|  | 4952 | run_test    "Event-driven I/O: client auth" \ | 
|  | 4953 | "$P_SRV event=1 tickets=0 auth_mode=required" \ | 
|  | 4954 | "$P_CLI event=1 tickets=0" \ | 
|  | 4955 | 0 \ | 
|  | 4956 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4957 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4958 | -c "Read from server: .* bytes read" | 
|  | 4959 |  | 
|  | 4960 | run_test    "Event-driven I/O: ticket" \ | 
|  | 4961 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 4962 | "$P_CLI event=1 tickets=1" \ | 
|  | 4963 | 0 \ | 
|  | 4964 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4965 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4966 | -c "Read from server: .* bytes read" | 
|  | 4967 |  | 
|  | 4968 | run_test    "Event-driven I/O: ticket + client auth" \ | 
|  | 4969 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 4970 | "$P_CLI event=1 tickets=1" \ | 
|  | 4971 | 0 \ | 
|  | 4972 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4973 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4974 | -c "Read from server: .* bytes read" | 
|  | 4975 |  | 
|  | 4976 | run_test    "Event-driven I/O: ticket + client auth + resume" \ | 
|  | 4977 | "$P_SRV event=1 tickets=1 auth_mode=required" \ | 
|  | 4978 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 4979 | 0 \ | 
|  | 4980 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4981 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4982 | -c "Read from server: .* bytes read" | 
|  | 4983 |  | 
|  | 4984 | run_test    "Event-driven I/O: ticket + resume" \ | 
|  | 4985 | "$P_SRV event=1 tickets=1 auth_mode=none" \ | 
|  | 4986 | "$P_CLI event=1 tickets=1 reconnect=1" \ | 
|  | 4987 | 0 \ | 
|  | 4988 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4989 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4990 | -c "Read from server: .* bytes read" | 
|  | 4991 |  | 
|  | 4992 | run_test    "Event-driven I/O: session-id resume" \ | 
|  | 4993 | "$P_SRV event=1 tickets=0 auth_mode=none" \ | 
|  | 4994 | "$P_CLI event=1 tickets=0 reconnect=1" \ | 
|  | 4995 | 0 \ | 
|  | 4996 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 4997 | -C "mbedtls_ssl_handshake returned" \ | 
|  | 4998 | -c "Read from server: .* bytes read" | 
|  | 4999 |  | 
| Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 5000 | run_test    "Event-driven I/O, DTLS: basic handshake" \ | 
|  | 5001 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ | 
|  | 5002 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 5003 | 0 \ | 
|  | 5004 | -c "Read from server: .* bytes read" | 
|  | 5005 |  | 
|  | 5006 | run_test    "Event-driven I/O, DTLS: client auth" \ | 
|  | 5007 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ | 
|  | 5008 | "$P_CLI dtls=1 event=1 tickets=0" \ | 
|  | 5009 | 0 \ | 
|  | 5010 | -c "Read from server: .* bytes read" | 
|  | 5011 |  | 
|  | 5012 | run_test    "Event-driven I/O, DTLS: ticket" \ | 
|  | 5013 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ | 
|  | 5014 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 5015 | 0 \ | 
|  | 5016 | -c "Read from server: .* bytes read" | 
|  | 5017 |  | 
|  | 5018 | run_test    "Event-driven I/O, DTLS: ticket + client auth" \ | 
|  | 5019 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ | 
|  | 5020 | "$P_CLI dtls=1 event=1 tickets=1" \ | 
|  | 5021 | 0 \ | 
|  | 5022 | -c "Read from server: .* bytes read" | 
|  | 5023 |  | 
|  | 5024 | run_test    "Event-driven I/O, DTLS: ticket + client auth + resume" \ | 
|  | 5025 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 5026 | "$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] | 5027 | 0 \ | 
|  | 5028 | -c "Read from server: .* bytes read" | 
|  | 5029 |  | 
|  | 5030 | run_test    "Event-driven I/O, DTLS: ticket + resume" \ | 
|  | 5031 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 5032 | "$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] | 5033 | 0 \ | 
|  | 5034 | -c "Read from server: .* bytes read" | 
|  | 5035 |  | 
|  | 5036 | run_test    "Event-driven I/O, DTLS: session-id resume" \ | 
|  | 5037 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 5038 | "$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] | 5039 | 0 \ | 
|  | 5040 | -c "Read from server: .* bytes read" | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5041 |  | 
|  | 5042 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. | 
|  | 5043 | # During session resumption, the client will send its ApplicationData record | 
|  | 5044 | # within the same datagram as the Finished messages. In this situation, the | 
|  | 5045 | # server MUST NOT idle on the underlying transport after handshake completion, | 
|  | 5046 | # because the ApplicationData request has already been queued internally. | 
|  | 5047 | run_test    "Event-driven I/O, DTLS: session-id resume, UDP packing" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 5048 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 5049 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 5050 | "$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] | 5051 | 0 \ | 
|  | 5052 | -c "Read from server: .* bytes read" | 
|  | 5053 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5054 | # Tests for version negotiation | 
|  | 5055 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5056 | run_test    "Version check: all -> 1.2" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5057 | "$P_SRV" \ | 
|  | 5058 | "$P_CLI" \ | 
|  | 5059 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5060 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5061 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5062 | -s "Protocol is TLSv1.2" \ | 
|  | 5063 | -c "Protocol is TLSv1.2" | 
|  | 5064 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5065 | run_test    "Version check: cli max 1.1 -> 1.1" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5066 | "$P_SRV" \ | 
|  | 5067 | "$P_CLI max_version=tls1_1" \ | 
|  | 5068 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5069 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5070 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5071 | -s "Protocol is TLSv1.1" \ | 
|  | 5072 | -c "Protocol is TLSv1.1" | 
|  | 5073 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5074 | run_test    "Version check: srv max 1.1 -> 1.1" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5075 | "$P_SRV max_version=tls1_1" \ | 
|  | 5076 | "$P_CLI" \ | 
|  | 5077 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5078 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5079 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5080 | -s "Protocol is TLSv1.1" \ | 
|  | 5081 | -c "Protocol is TLSv1.1" | 
|  | 5082 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5083 | 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] | 5084 | "$P_SRV max_version=tls1_1" \ | 
|  | 5085 | "$P_CLI max_version=tls1_1" \ | 
|  | 5086 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5087 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5088 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5089 | -s "Protocol is TLSv1.1" \ | 
|  | 5090 | -c "Protocol is TLSv1.1" | 
|  | 5091 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5092 | 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] | 5093 | "$P_SRV min_version=tls1_1" \ | 
|  | 5094 | "$P_CLI max_version=tls1_1" \ | 
|  | 5095 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5096 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5097 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5098 | -s "Protocol is TLSv1.1" \ | 
|  | 5099 | -c "Protocol is TLSv1.1" | 
|  | 5100 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5101 | 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] | 5102 | "$P_SRV max_version=tls1_1" \ | 
|  | 5103 | "$P_CLI min_version=tls1_1" \ | 
|  | 5104 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5105 | -S "mbedtls_ssl_handshake returned" \ | 
|  | 5106 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5107 | -s "Protocol is TLSv1.1" \ | 
|  | 5108 | -c "Protocol is TLSv1.1" | 
|  | 5109 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5110 | 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] | 5111 | "$P_SRV max_version=tls1_1" \ | 
|  | 5112 | "$P_CLI min_version=tls1_2" \ | 
|  | 5113 | 1 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5114 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 5115 | -c "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5116 | -c "SSL - Handshake protocol not within min/max boundaries" | 
|  | 5117 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5118 | 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] | 5119 | "$P_SRV min_version=tls1_2" \ | 
|  | 5120 | "$P_CLI max_version=tls1_1" \ | 
|  | 5121 | 1 \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5122 | -s "mbedtls_ssl_handshake returned" \ | 
|  | 5123 | -c "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 5124 | -s "SSL - Handshake protocol not within min/max boundaries" | 
|  | 5125 |  | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5126 | # Tests for ALPN extension | 
|  | 5127 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5128 | run_test    "ALPN: none" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5129 | "$P_SRV debug_level=3" \ | 
|  | 5130 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5131 | 0 \ | 
|  | 5132 | -C "client hello, adding alpn extension" \ | 
|  | 5133 | -S "found alpn extension" \ | 
|  | 5134 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5135 | -S "server hello, adding alpn extension" \ | 
|  | 5136 | -C "found alpn extension " \ | 
|  | 5137 | -C "Application Layer Protocol is" \ | 
|  | 5138 | -S "Application Layer Protocol is" | 
|  | 5139 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5140 | run_test    "ALPN: client only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5141 | "$P_SRV debug_level=3" \ | 
|  | 5142 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5143 | 0 \ | 
|  | 5144 | -c "client hello, adding alpn extension" \ | 
|  | 5145 | -s "found alpn extension" \ | 
|  | 5146 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5147 | -S "server hello, adding alpn extension" \ | 
|  | 5148 | -C "found alpn extension " \ | 
|  | 5149 | -c "Application Layer Protocol is (none)" \ | 
|  | 5150 | -S "Application Layer Protocol is" | 
|  | 5151 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5152 | run_test    "ALPN: server only" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5153 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 5154 | "$P_CLI debug_level=3" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5155 | 0 \ | 
|  | 5156 | -C "client hello, adding alpn extension" \ | 
|  | 5157 | -S "found alpn extension" \ | 
|  | 5158 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5159 | -S "server hello, adding alpn extension" \ | 
|  | 5160 | -C "found alpn extension " \ | 
|  | 5161 | -C "Application Layer Protocol is" \ | 
|  | 5162 | -s "Application Layer Protocol is (none)" | 
|  | 5163 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5164 | run_test    "ALPN: both, common cli1-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5165 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 5166 | "$P_CLI debug_level=3 alpn=abc,1234" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5167 | 0 \ | 
|  | 5168 | -c "client hello, adding alpn extension" \ | 
|  | 5169 | -s "found alpn extension" \ | 
|  | 5170 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5171 | -s "server hello, adding alpn extension" \ | 
|  | 5172 | -c "found alpn extension" \ | 
|  | 5173 | -c "Application Layer Protocol is abc" \ | 
|  | 5174 | -s "Application Layer Protocol is abc" | 
|  | 5175 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5176 | run_test    "ALPN: both, common cli2-srv1" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5177 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 5178 | "$P_CLI debug_level=3 alpn=1234,abc" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5179 | 0 \ | 
|  | 5180 | -c "client hello, adding alpn extension" \ | 
|  | 5181 | -s "found alpn extension" \ | 
|  | 5182 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5183 | -s "server hello, adding alpn extension" \ | 
|  | 5184 | -c "found alpn extension" \ | 
|  | 5185 | -c "Application Layer Protocol is abc" \ | 
|  | 5186 | -s "Application Layer Protocol is abc" | 
|  | 5187 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5188 | run_test    "ALPN: both, common cli1-srv2" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5189 | "$P_SRV debug_level=3 alpn=abc,1234" \ | 
|  | 5190 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5191 | 0 \ | 
|  | 5192 | -c "client hello, adding alpn extension" \ | 
|  | 5193 | -s "found alpn extension" \ | 
|  | 5194 | -C "got an alert message, type: \\[2:120]" \ | 
|  | 5195 | -s "server hello, adding alpn extension" \ | 
|  | 5196 | -c "found alpn extension" \ | 
|  | 5197 | -c "Application Layer Protocol is 1234" \ | 
|  | 5198 | -s "Application Layer Protocol is 1234" | 
|  | 5199 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5200 | run_test    "ALPN: both, no common" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5201 | "$P_SRV debug_level=3 alpn=abc,123" \ | 
|  | 5202 | "$P_CLI debug_level=3 alpn=1234,abcde" \ | 
| Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5203 | 1 \ | 
|  | 5204 | -c "client hello, adding alpn extension" \ | 
|  | 5205 | -s "found alpn extension" \ | 
|  | 5206 | -c "got an alert message, type: \\[2:120]" \ | 
|  | 5207 | -S "server hello, adding alpn extension" \ | 
|  | 5208 | -C "found alpn extension" \ | 
|  | 5209 | -C "Application Layer Protocol is 1234" \ | 
|  | 5210 | -S "Application Layer Protocol is 1234" | 
|  | 5211 |  | 
| Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5212 |  | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5213 | # Tests for keyUsage in leaf certificates, part 1: | 
|  | 5214 | # server-side certificate/suite selection | 
|  | 5215 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5216 | run_test    "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5217 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 5218 | crt_file=data_files/server2.ku-ds.crt" \ | 
|  | 5219 | "$P_CLI" \ | 
|  | 5220 | 0 \ | 
| Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5221 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5222 |  | 
|  | 5223 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5224 | run_test    "keyUsage srv: RSA, keyEncipherment -> RSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5225 | "$P_SRV key_file=data_files/server2.key \ | 
|  | 5226 | crt_file=data_files/server2.ku-ke.crt" \ | 
|  | 5227 | "$P_CLI" \ | 
|  | 5228 | 0 \ | 
|  | 5229 | -c "Ciphersuite is TLS-RSA-WITH-" | 
|  | 5230 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5231 | run_test    "keyUsage srv: RSA, keyAgreement -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5232 | "$P_SRV key_file=data_files/server2.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5233 | crt_file=data_files/server2.ku-ka.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5234 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5235 | 1 \ | 
|  | 5236 | -C "Ciphersuite is " | 
|  | 5237 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5238 | run_test    "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5239 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5240 | crt_file=data_files/server5.ku-ds.crt" \ | 
|  | 5241 | "$P_CLI" \ | 
|  | 5242 | 0 \ | 
|  | 5243 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" | 
|  | 5244 |  | 
|  | 5245 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5246 | run_test    "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5247 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5248 | crt_file=data_files/server5.ku-ka.crt" \ | 
|  | 5249 | "$P_CLI" \ | 
|  | 5250 | 0 \ | 
|  | 5251 | -c "Ciphersuite is TLS-ECDH-" | 
|  | 5252 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5253 | run_test    "keyUsage srv: ECDSA, keyEncipherment -> fail" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5254 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5255 | crt_file=data_files/server5.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5256 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5257 | 1 \ | 
|  | 5258 | -C "Ciphersuite is " | 
|  | 5259 |  | 
|  | 5260 | # Tests for keyUsage in leaf certificates, part 2: | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5261 | # client-side checking of server cert | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5262 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5263 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5264 | "$O_SRV -key data_files/server2.key \ | 
|  | 5265 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5266 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5267 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5268 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5269 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5270 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5271 | -c "Ciphersuite is TLS-" | 
|  | 5272 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5273 | run_test    "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5274 | "$O_SRV -key data_files/server2.key \ | 
|  | 5275 | -cert data_files/server2.ku-ds_ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5276 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5277 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5278 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5279 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5280 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5281 | -c "Ciphersuite is TLS-" | 
|  | 5282 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5283 | run_test    "keyUsage cli: KeyEncipherment, RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5284 | "$O_SRV -key data_files/server2.key \ | 
|  | 5285 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5286 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5287 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5288 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5289 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5290 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5291 | -c "Ciphersuite is TLS-" | 
|  | 5292 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5293 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5294 | "$O_SRV -key data_files/server2.key \ | 
|  | 5295 | -cert data_files/server2.ku-ke.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5296 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5297 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5298 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5299 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5300 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 5301 | -C "Ciphersuite is TLS-" | 
|  | 5302 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5303 | run_test    "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ | 
|  | 5304 | "$O_SRV -key data_files/server2.key \ | 
|  | 5305 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 5306 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 5307 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5308 | 0 \ | 
|  | 5309 | -c "bad certificate (usage extensions)" \ | 
|  | 5310 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5311 | -c "Ciphersuite is TLS-" \ | 
|  | 5312 | -c "! Usage does not match the keyUsage extension" | 
|  | 5313 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5314 | run_test    "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5315 | "$O_SRV -key data_files/server2.key \ | 
|  | 5316 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5317 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5318 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5319 | 0 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5320 | -C "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5321 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5322 | -c "Ciphersuite is TLS-" | 
|  | 5323 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5324 | run_test    "keyUsage cli: DigitalSignature, RSA: fail" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5325 | "$O_SRV -key data_files/server2.key \ | 
|  | 5326 | -cert data_files/server2.ku-ds.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5327 | "$P_CLI debug_level=1 \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5328 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5329 | 1 \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5330 | -c "bad certificate (usage extensions)" \ | 
| Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5331 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 5332 | -C "Ciphersuite is TLS-" | 
|  | 5333 |  | 
| Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5334 | run_test    "keyUsage cli: DigitalSignature, RSA: fail, soft" \ | 
|  | 5335 | "$O_SRV -key data_files/server2.key \ | 
|  | 5336 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 5337 | "$P_CLI debug_level=1 auth_mode=optional \ | 
|  | 5338 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 5339 | 0 \ | 
|  | 5340 | -c "bad certificate (usage extensions)" \ | 
|  | 5341 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5342 | -c "Ciphersuite is TLS-" \ | 
|  | 5343 | -c "! Usage does not match the keyUsage extension" | 
|  | 5344 |  | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5345 | # Tests for keyUsage in leaf certificates, part 3: | 
|  | 5346 | # server-side checking of client cert | 
|  | 5347 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5348 | run_test    "keyUsage cli-auth: RSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5349 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5350 | "$O_CLI -key data_files/server2.key \ | 
|  | 5351 | -cert data_files/server2.ku-ds.crt" \ | 
|  | 5352 | 0 \ | 
|  | 5353 | -S "bad certificate (usage extensions)" \ | 
|  | 5354 | -S "Processing of the Certificate handshake message failed" | 
|  | 5355 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5356 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5357 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5358 | "$O_CLI -key data_files/server2.key \ | 
|  | 5359 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 5360 | 0 \ | 
|  | 5361 | -s "bad certificate (usage extensions)" \ | 
|  | 5362 | -S "Processing of the Certificate handshake message failed" | 
|  | 5363 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5364 | run_test    "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5365 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5366 | "$O_CLI -key data_files/server2.key \ | 
|  | 5367 | -cert data_files/server2.ku-ke.crt" \ | 
|  | 5368 | 1 \ | 
|  | 5369 | -s "bad certificate (usage extensions)" \ | 
|  | 5370 | -s "Processing of the Certificate handshake message failed" | 
|  | 5371 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5372 | run_test    "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5373 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5374 | "$O_CLI -key data_files/server5.key \ | 
|  | 5375 | -cert data_files/server5.ku-ds.crt" \ | 
|  | 5376 | 0 \ | 
|  | 5377 | -S "bad certificate (usage extensions)" \ | 
|  | 5378 | -S "Processing of the Certificate handshake message failed" | 
|  | 5379 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5380 | run_test    "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5381 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5382 | "$O_CLI -key data_files/server5.key \ | 
|  | 5383 | -cert data_files/server5.ku-ka.crt" \ | 
|  | 5384 | 0 \ | 
|  | 5385 | -s "bad certificate (usage extensions)" \ | 
|  | 5386 | -S "Processing of the Certificate handshake message failed" | 
|  | 5387 |  | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5388 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection | 
|  | 5389 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5390 | run_test    "extKeyUsage srv: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5391 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5392 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 5393 | "$P_CLI" \ | 
|  | 5394 | 0 | 
|  | 5395 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5396 | run_test    "extKeyUsage srv: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5397 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5398 | crt_file=data_files/server5.eku-srv.crt" \ | 
|  | 5399 | "$P_CLI" \ | 
|  | 5400 | 0 | 
|  | 5401 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5402 | run_test    "extKeyUsage srv: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5403 | "$P_SRV key_file=data_files/server5.key \ | 
|  | 5404 | crt_file=data_files/server5.eku-cs_any.crt" \ | 
|  | 5405 | "$P_CLI" \ | 
|  | 5406 | 0 | 
|  | 5407 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5408 | run_test    "extKeyUsage srv: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5409 | "$P_SRV key_file=data_files/server5.key \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5410 | crt_file=data_files/server5.eku-cli.crt" \ | 
| Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5411 | "$P_CLI" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5412 | 1 | 
|  | 5413 |  | 
|  | 5414 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert | 
|  | 5415 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5416 | run_test    "extKeyUsage cli: serverAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5417 | "$O_SRV -key data_files/server5.key \ | 
|  | 5418 | -cert data_files/server5.eku-srv.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5419 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5420 | 0 \ | 
|  | 5421 | -C "bad certificate (usage extensions)" \ | 
|  | 5422 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5423 | -c "Ciphersuite is TLS-" | 
|  | 5424 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5425 | run_test    "extKeyUsage cli: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5426 | "$O_SRV -key data_files/server5.key \ | 
|  | 5427 | -cert data_files/server5.eku-srv_cli.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5428 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5429 | 0 \ | 
|  | 5430 | -C "bad certificate (usage extensions)" \ | 
|  | 5431 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5432 | -c "Ciphersuite is TLS-" | 
|  | 5433 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5434 | run_test    "extKeyUsage cli: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5435 | "$O_SRV -key data_files/server5.key \ | 
|  | 5436 | -cert data_files/server5.eku-cs_any.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5437 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5438 | 0 \ | 
|  | 5439 | -C "bad certificate (usage extensions)" \ | 
|  | 5440 | -C "Processing of the Certificate handshake message failed" \ | 
|  | 5441 | -c "Ciphersuite is TLS-" | 
|  | 5442 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5443 | run_test    "extKeyUsage cli: codeSign -> fail" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5444 | "$O_SRV -key data_files/server5.key \ | 
|  | 5445 | -cert data_files/server5.eku-cs.crt" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5446 | "$P_CLI debug_level=1" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5447 | 1 \ | 
|  | 5448 | -c "bad certificate (usage extensions)" \ | 
|  | 5449 | -c "Processing of the Certificate handshake message failed" \ | 
|  | 5450 | -C "Ciphersuite is TLS-" | 
|  | 5451 |  | 
|  | 5452 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert | 
|  | 5453 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5454 | run_test    "extKeyUsage cli-auth: clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5455 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5456 | "$O_CLI -key data_files/server5.key \ | 
|  | 5457 | -cert data_files/server5.eku-cli.crt" \ | 
|  | 5458 | 0 \ | 
|  | 5459 | -S "bad certificate (usage extensions)" \ | 
|  | 5460 | -S "Processing of the Certificate handshake message failed" | 
|  | 5461 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5462 | run_test    "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5463 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5464 | "$O_CLI -key data_files/server5.key \ | 
|  | 5465 | -cert data_files/server5.eku-srv_cli.crt" \ | 
|  | 5466 | 0 \ | 
|  | 5467 | -S "bad certificate (usage extensions)" \ | 
|  | 5468 | -S "Processing of the Certificate handshake message failed" | 
|  | 5469 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5470 | run_test    "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5471 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5472 | "$O_CLI -key data_files/server5.key \ | 
|  | 5473 | -cert data_files/server5.eku-cs_any.crt" \ | 
|  | 5474 | 0 \ | 
|  | 5475 | -S "bad certificate (usage extensions)" \ | 
|  | 5476 | -S "Processing of the Certificate handshake message failed" | 
|  | 5477 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5478 | run_test    "extKeyUsage cli-auth: codeSign -> fail (soft)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5479 | "$P_SRV debug_level=1 auth_mode=optional" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5480 | "$O_CLI -key data_files/server5.key \ | 
|  | 5481 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 5482 | 0 \ | 
|  | 5483 | -s "bad certificate (usage extensions)" \ | 
|  | 5484 | -S "Processing of the Certificate handshake message failed" | 
|  | 5485 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5486 | run_test    "extKeyUsage cli-auth: codeSign -> fail (hard)" \ | 
| Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5487 | "$P_SRV debug_level=1 auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5488 | "$O_CLI -key data_files/server5.key \ | 
|  | 5489 | -cert data_files/server5.eku-cs.crt" \ | 
|  | 5490 | 1 \ | 
|  | 5491 | -s "bad certificate (usage extensions)" \ | 
|  | 5492 | -s "Processing of the Certificate handshake message failed" | 
|  | 5493 |  | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5494 | # Tests for DHM parameters loading | 
|  | 5495 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5496 | run_test    "DHM parameters: reference" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5497 | "$P_SRV" \ | 
|  | 5498 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5499 | debug_level=3" \ | 
|  | 5500 | 0 \ | 
|  | 5501 | -c "value of 'DHM: P ' (2048 bits)" \ | 
| Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5502 | -c "value of 'DHM: G ' (2 bits)" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5503 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5504 | run_test    "DHM parameters: other parameters" \ | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5505 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 5506 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5507 | debug_level=3" \ | 
|  | 5508 | 0 \ | 
|  | 5509 | -c "value of 'DHM: P ' (1024 bits)" \ | 
|  | 5510 | -c "value of 'DHM: G ' (2 bits)" | 
|  | 5511 |  | 
| Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5512 | # Tests for DHM client-side size checking | 
|  | 5513 |  | 
|  | 5514 | run_test    "DHM size: server default, client default, OK" \ | 
|  | 5515 | "$P_SRV" \ | 
|  | 5516 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5517 | debug_level=1" \ | 
|  | 5518 | 0 \ | 
|  | 5519 | -C "DHM prime too short:" | 
|  | 5520 |  | 
|  | 5521 | run_test    "DHM size: server default, client 2048, OK" \ | 
|  | 5522 | "$P_SRV" \ | 
|  | 5523 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5524 | debug_level=1 dhmlen=2048" \ | 
|  | 5525 | 0 \ | 
|  | 5526 | -C "DHM prime too short:" | 
|  | 5527 |  | 
|  | 5528 | run_test    "DHM size: server 1024, client default, OK" \ | 
|  | 5529 | "$P_SRV dhm_file=data_files/dhparams.pem" \ | 
|  | 5530 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5531 | debug_level=1" \ | 
|  | 5532 | 0 \ | 
|  | 5533 | -C "DHM prime too short:" | 
|  | 5534 |  | 
|  | 5535 | run_test    "DHM size: server 1000, client default, rejected" \ | 
|  | 5536 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ | 
|  | 5537 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5538 | debug_level=1" \ | 
|  | 5539 | 1 \ | 
|  | 5540 | -c "DHM prime too short:" | 
|  | 5541 |  | 
|  | 5542 | run_test    "DHM size: server default, client 2049, rejected" \ | 
|  | 5543 | "$P_SRV" \ | 
|  | 5544 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ | 
|  | 5545 | debug_level=1 dhmlen=2049" \ | 
|  | 5546 | 1 \ | 
|  | 5547 | -c "DHM prime too short:" | 
|  | 5548 |  | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5549 | # Tests for PSK callback | 
|  | 5550 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5551 | run_test    "PSK callback: psk, no callback" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5552 | "$P_SRV psk=abc123 psk_identity=foo" \ | 
|  | 5553 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5554 | psk_identity=foo psk=abc123" \ | 
|  | 5555 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5556 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5557 | -S "SSL - Unknown identity received" \ | 
|  | 5558 | -S "SSL - Verification of the message MAC failed" | 
|  | 5559 |  | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5560 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5561 | run_test    "PSK callback: opaque psk on client, no callback" \ | 
|  | 5562 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 5563 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5564 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5565 | 0 \ | 
|  | 5566 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5567 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5568 | -C "session hash for extended master secret"\ | 
|  | 5569 | -S "session hash for extended master secret"\ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5570 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5571 | -S "SSL - Unknown identity received" \ | 
|  | 5572 | -S "SSL - Verification of the message MAC failed" | 
|  | 5573 |  | 
|  | 5574 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5575 | run_test    "PSK callback: opaque psk on client, no callback, SHA-384" \ | 
|  | 5576 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ | 
|  | 5577 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5578 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5579 | 0 \ | 
|  | 5580 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5581 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5582 | -C "session hash for extended master secret"\ | 
|  | 5583 | -S "session hash for extended master secret"\ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5584 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5585 | -S "SSL - Unknown identity received" \ | 
|  | 5586 | -S "SSL - Verification of the message MAC failed" | 
|  | 5587 |  | 
|  | 5588 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5589 | run_test    "PSK callback: opaque psk on client, no callback, EMS" \ | 
|  | 5590 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 5591 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5592 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5593 | 0 \ | 
|  | 5594 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5595 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5596 | -c "session hash for extended master secret"\ | 
|  | 5597 | -s "session hash for extended master secret"\ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5598 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5599 | -S "SSL - Unknown identity received" \ | 
|  | 5600 | -S "SSL - Verification of the message MAC failed" | 
|  | 5601 |  | 
|  | 5602 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5603 | run_test    "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ | 
|  | 5604 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ | 
|  | 5605 | "$P_CLI extended_ms=1 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5606 | psk_identity=foo psk=abc123 psk_opaque=1" \ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5607 | 0 \ | 
|  | 5608 | -c "skip PMS generation for opaque PSK"\ | 
|  | 5609 | -S "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5610 | -c "session hash for extended master secret"\ | 
|  | 5611 | -s "session hash for extended master secret"\ | 
| Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5612 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5613 | -S "SSL - Unknown identity received" \ | 
|  | 5614 | -S "SSL - Verification of the message MAC failed" | 
|  | 5615 |  | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5616 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5617 | run_test    "PSK callback: raw psk on client, static opaque on server, no callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5618 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5619 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5620 | psk_identity=foo psk=abc123" \ | 
|  | 5621 | 0 \ | 
|  | 5622 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5623 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5624 | -C "session hash for extended master secret"\ | 
|  | 5625 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5626 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5627 | -S "SSL - Unknown identity received" \ | 
|  | 5628 | -S "SSL - Verification of the message MAC failed" | 
|  | 5629 |  | 
|  | 5630 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5631 | run_test    "PSK callback: raw psk on client, static opaque on server, no callback, SHA-384" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5632 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5633 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5634 | psk_identity=foo psk=abc123" \ | 
|  | 5635 | 0 \ | 
|  | 5636 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5637 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5638 | -C "session hash for extended master secret"\ | 
|  | 5639 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5640 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5641 | -S "SSL - Unknown identity received" \ | 
|  | 5642 | -S "SSL - Verification of the message MAC failed" | 
|  | 5643 |  | 
|  | 5644 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5645 | run_test    "PSK callback: raw psk on client, static opaque on server, no callback, EMS" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5646 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5647 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 5648 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5649 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 5650 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5651 | -c "session hash for extended master secret"\ | 
|  | 5652 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5653 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5654 | -s "skip PMS generation for opaque PSK"\ | 
|  | 5655 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5656 | -S "SSL - Unknown identity received" \ | 
|  | 5657 | -S "SSL - Verification of the message MAC failed" | 
|  | 5658 |  | 
|  | 5659 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5660 | run_test    "PSK callback: raw psk on client, static opaque on server, no callback, EMS, SHA384" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5661 | "$P_SRV debug_level=3 psk=abc123 psk_identity=foo psk_opaque=1 min_version=tls1_2 \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5662 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 5663 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5664 | psk_identity=foo psk=abc123 extended_ms=1" \ | 
|  | 5665 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5666 | -c "session hash for extended master secret"\ | 
|  | 5667 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5668 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5669 | -s "skip PMS generation for opaque PSK"\ | 
|  | 5670 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5671 | -S "SSL - Unknown identity received" \ | 
|  | 5672 | -S "SSL - Verification of the message MAC failed" | 
|  | 5673 |  | 
|  | 5674 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5675 | run_test    "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5676 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5677 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5678 | psk_identity=def psk=beef" \ | 
|  | 5679 | 0 \ | 
|  | 5680 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5681 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5682 | -C "session hash for extended master secret"\ | 
|  | 5683 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5684 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5685 | -S "SSL - Unknown identity received" \ | 
|  | 5686 | -S "SSL - Verification of the message MAC failed" | 
|  | 5687 |  | 
|  | 5688 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5689 | run_test    "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, SHA-384" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5690 | "$P_SRV extended_ms=0 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5691 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5692 | psk_identity=def psk=beef" \ | 
|  | 5693 | 0 \ | 
|  | 5694 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5695 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5696 | -C "session hash for extended master secret"\ | 
|  | 5697 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5698 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5699 | -S "SSL - Unknown identity received" \ | 
|  | 5700 | -S "SSL - Verification of the message MAC failed" | 
|  | 5701 |  | 
|  | 5702 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5703 | run_test    "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5704 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5705 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ | 
|  | 5706 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5707 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 5708 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5709 | -c "session hash for extended master secret"\ | 
|  | 5710 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5711 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5712 | -s "skip PMS generation for opaque PSK"\ | 
|  | 5713 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5714 | -S "SSL - Unknown identity received" \ | 
|  | 5715 | -S "SSL - Verification of the message MAC failed" | 
|  | 5716 |  | 
|  | 5717 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5718 | run_test    "PSK callback: raw psk on client, no static PSK on server, opaque PSK from callback, EMS, SHA384" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5719 | "$P_SRV debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5720 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ | 
|  | 5721 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ | 
|  | 5722 | psk_identity=abc psk=dead extended_ms=1" \ | 
|  | 5723 | 0 \ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5724 | -c "session hash for extended master secret"\ | 
|  | 5725 | -s "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5726 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5727 | -s "skip PMS generation for opaque PSK"\ | 
|  | 5728 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5729 | -S "SSL - Unknown identity received" \ | 
|  | 5730 | -S "SSL - Verification of the message MAC failed" | 
|  | 5731 |  | 
|  | 5732 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5733 | run_test    "PSK callback: raw psk on client, mismatching static raw PSK on server, opaque PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5734 | "$P_SRV extended_ms=0 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5735 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5736 | psk_identity=def psk=beef" \ | 
|  | 5737 | 0 \ | 
|  | 5738 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5739 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5740 | -C "session hash for extended master secret"\ | 
|  | 5741 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5742 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5743 | -S "SSL - Unknown identity received" \ | 
|  | 5744 | -S "SSL - Verification of the message MAC failed" | 
|  | 5745 |  | 
|  | 5746 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5747 | run_test    "PSK callback: raw psk on client, mismatching static opaque PSK on server, opaque PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5748 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef psk_list_opaque=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5749 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5750 | psk_identity=def psk=beef" \ | 
|  | 5751 | 0 \ | 
|  | 5752 | -C "skip PMS generation for opaque PSK"\ | 
|  | 5753 | -s "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5754 | -C "session hash for extended master secret"\ | 
|  | 5755 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5756 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5757 | -S "SSL - Unknown identity received" \ | 
|  | 5758 | -S "SSL - Verification of the message MAC failed" | 
|  | 5759 |  | 
|  | 5760 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5761 | run_test    "PSK callback: raw psk on client, mismatching static opaque PSK on server, raw PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5762 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=foo psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5763 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5764 | psk_identity=def psk=beef" \ | 
|  | 5765 | 0 \ | 
|  | 5766 | -C "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5767 | -C "session hash for extended master secret"\ | 
|  | 5768 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5769 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5770 | -S "SSL - Unknown identity received" \ | 
|  | 5771 | -S "SSL - Verification of the message MAC failed" | 
|  | 5772 |  | 
|  | 5773 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5774 | run_test    "PSK callback: raw psk on client, id-matching but wrong raw PSK on server, opaque PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5775 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=abc123 debug_level=3 psk_list=abc,dead,def,beef min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5776 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5777 | psk_identity=def psk=beef" \ | 
|  | 5778 | 0 \ | 
|  | 5779 | -C "skip PMS generation for opaque PSK"\ | 
| Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5780 | -C "session hash for extended master secret"\ | 
|  | 5781 | -S "session hash for extended master secret"\ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5782 | -S "SSL - None of the common ciphersuites is usable" \ | 
|  | 5783 | -S "SSL - Unknown identity received" \ | 
|  | 5784 | -S "SSL - Verification of the message MAC failed" | 
|  | 5785 |  | 
|  | 5786 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO | 
|  | 5787 | run_test    "PSK callback: raw psk on client, matching opaque PSK on server, wrong opaque PSK from callback" \ | 
| Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5788 | "$P_SRV extended_ms=0 psk_opaque=1 psk_identity=def psk=beef debug_level=3 psk_list=abc,dead,def,abc123 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA" \ | 
| Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5789 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5790 | psk_identity=def psk=beef" \ | 
|  | 5791 | 1 \ | 
|  | 5792 | -s "SSL - Verification of the message MAC failed" | 
|  | 5793 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5794 | run_test    "PSK callback: no psk, no callback" \ | 
| Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5795 | "$P_SRV" \ | 
|  | 5796 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5797 | psk_identity=foo psk=abc123" \ | 
|  | 5798 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5799 | -s "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5800 | -S "SSL - Unknown identity received" \ | 
|  | 5801 | -S "SSL - Verification of the message MAC failed" | 
|  | 5802 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5803 | run_test    "PSK callback: callback overrides other settings" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5804 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ | 
|  | 5805 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5806 | psk_identity=foo psk=abc123" \ | 
|  | 5807 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5808 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5809 | -s "SSL - Unknown identity received" \ | 
|  | 5810 | -S "SSL - Verification of the message MAC failed" | 
|  | 5811 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5812 | run_test    "PSK callback: first id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5813 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5814 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5815 | psk_identity=abc psk=dead" \ | 
|  | 5816 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5817 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5818 | -S "SSL - Unknown identity received" \ | 
|  | 5819 | -S "SSL - Verification of the message MAC failed" | 
|  | 5820 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5821 | run_test    "PSK callback: second id matches" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5822 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5823 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5824 | psk_identity=def psk=beef" \ | 
|  | 5825 | 0 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5826 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5827 | -S "SSL - Unknown identity received" \ | 
|  | 5828 | -S "SSL - Verification of the message MAC failed" | 
|  | 5829 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5830 | run_test    "PSK callback: no match" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5831 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5832 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5833 | psk_identity=ghi psk=beef" \ | 
|  | 5834 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5835 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5836 | -s "SSL - Unknown identity received" \ | 
|  | 5837 | -S "SSL - Verification of the message MAC failed" | 
|  | 5838 |  | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5839 | run_test    "PSK callback: wrong key" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5840 | "$P_SRV psk_list=abc,dead,def,beef" \ | 
|  | 5841 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ | 
|  | 5842 | psk_identity=abc psk=beef" \ | 
|  | 5843 | 1 \ | 
| Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5844 | -S "SSL - None of the common ciphersuites is usable" \ | 
| Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5845 | -S "SSL - Unknown identity received" \ | 
|  | 5846 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5847 |  | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5848 | # Tests for EC J-PAKE | 
|  | 5849 |  | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5850 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5851 | run_test    "ECJPAKE: client not configured" \ | 
|  | 5852 | "$P_SRV debug_level=3" \ | 
|  | 5853 | "$P_CLI debug_level=3" \ | 
|  | 5854 | 0 \ | 
| Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5855 | -C "add ciphersuite: 0xc0ff" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5856 | -C "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5857 | -S "found ecjpake kkpp extension" \ | 
|  | 5858 | -S "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5859 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5860 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5861 | -C "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5862 | -S "None of the common ciphersuites is usable" | 
|  | 5863 |  | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5864 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5865 | run_test    "ECJPAKE: server not configured" \ | 
|  | 5866 | "$P_SRV debug_level=3" \ | 
|  | 5867 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 5868 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5869 | 1 \ | 
| Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5870 | -c "add ciphersuite: 0xc0ff" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5871 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5872 | -s "found ecjpake kkpp extension" \ | 
|  | 5873 | -s "skip ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5874 | -s "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5875 | -S "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5876 | -C "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5877 | -s "None of the common ciphersuites is usable" | 
|  | 5878 |  | 
| Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5879 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5880 | run_test    "ECJPAKE: working, TLS" \ | 
|  | 5881 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 5882 | "$P_CLI debug_level=3 ecjpake_pw=bla \ | 
|  | 5883 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
| Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5884 | 0 \ | 
| Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5885 | -c "add ciphersuite: 0xc0ff" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5886 | -c "adding ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5887 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5888 | -s "found ecjpake kkpp extension" \ | 
|  | 5889 | -S "skip ecjpake kkpp extension" \ | 
|  | 5890 | -S "ciphersuite mismatch: ecjpake not configured" \ | 
| Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5891 | -s "server hello, ecjpake kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5892 | -c "found ecjpake_kkpp extension" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5893 | -S "None of the common ciphersuites is usable" \ | 
|  | 5894 | -S "SSL - Verification of the message MAC failed" | 
|  | 5895 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5896 | server_needs_more_time 1 | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5897 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5898 | run_test    "ECJPAKE: password mismatch, TLS" \ | 
|  | 5899 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ | 
|  | 5900 | "$P_CLI debug_level=3 ecjpake_pw=bad \ | 
|  | 5901 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5902 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5903 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5904 | -s "SSL - Verification of the message MAC failed" | 
|  | 5905 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5906 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5907 | run_test    "ECJPAKE: working, DTLS" \ | 
|  | 5908 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 5909 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 5910 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5911 | 0 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5912 | -c "re-using cached ecjpake parameters" \ | 
|  | 5913 | -S "SSL - Verification of the message MAC failed" | 
|  | 5914 |  | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5915 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5916 | run_test    "ECJPAKE: working, DTLS, no cookie" \ | 
|  | 5917 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ | 
|  | 5918 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ | 
|  | 5919 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5920 | 0 \ | 
|  | 5921 | -C "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5922 | -S "SSL - Verification of the message MAC failed" | 
|  | 5923 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5924 | server_needs_more_time 1 | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5925 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5926 | run_test    "ECJPAKE: password mismatch, DTLS" \ | 
|  | 5927 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ | 
|  | 5928 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ | 
|  | 5929 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5930 | 1 \ | 
| Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5931 | -c "re-using cached ecjpake parameters" \ | 
| Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5932 | -s "SSL - Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5933 |  | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5934 | # for tests with configs/config-thread.h | 
| Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5935 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE | 
| Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5936 | run_test    "ECJPAKE: working, DTLS, nolog" \ | 
|  | 5937 | "$P_SRV dtls=1 ecjpake_pw=bla" \ | 
|  | 5938 | "$P_CLI dtls=1 ecjpake_pw=bla \ | 
|  | 5939 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ | 
|  | 5940 | 0 | 
|  | 5941 |  | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5942 | # Tests for ciphersuites per version | 
|  | 5943 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 5944 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5945 | requires_config_enabled MBEDTLS_CAMELLIA_C | 
|  | 5946 | requires_config_enabled MBEDTLS_AES_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5947 | run_test    "Per-version suites: SSL3" \ | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5948 | "$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] | 5949 | "$P_CLI force_version=ssl3" \ | 
|  | 5950 | 0 \ | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5951 | -c "Ciphersuite is TLS-RSA-WITH-CAMELLIA-128-CBC-SHA" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5952 |  | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5953 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1 | 
|  | 5954 | requires_config_enabled MBEDTLS_CAMELLIA_C | 
|  | 5955 | requires_config_enabled MBEDTLS_AES_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5956 | run_test    "Per-version suites: TLS 1.0" \ | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5957 | "$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] | 5958 | "$P_CLI force_version=tls1 arc4=1" \ | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5959 | 0 \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 5960 | -c "Ciphersuite is TLS-RSA-WITH-AES-256-CBC-SHA" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5961 |  | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5962 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 5963 | requires_config_enabled MBEDTLS_CAMELLIA_C | 
|  | 5964 | requires_config_enabled MBEDTLS_AES_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5965 | run_test    "Per-version suites: TLS 1.1" \ | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5966 | "$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] | 5967 | "$P_CLI force_version=tls1_1" \ | 
|  | 5968 | 0 \ | 
|  | 5969 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-CBC-SHA" | 
|  | 5970 |  | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5971 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 5972 | requires_config_enabled MBEDTLS_CAMELLIA_C | 
|  | 5973 | requires_config_enabled MBEDTLS_AES_C | 
| Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5974 | run_test    "Per-version suites: TLS 1.2" \ | 
| Manuel Pégourié-Gonnard | aa946b2 | 2019-03-01 10:14:58 +0100 | [diff] [blame] | 5975 | "$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] | 5976 | "$P_CLI force_version=tls1_2" \ | 
|  | 5977 | 0 \ | 
|  | 5978 | -c "Ciphersuite is TLS-RSA-WITH-AES-128-GCM-SHA256" | 
|  | 5979 |  | 
| Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5980 | # Test for ClientHello without extensions | 
|  | 5981 |  | 
| Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5982 | requires_gnutls | 
| Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5983 | run_test    "ClientHello without extensions" \ | 
| Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5984 | "$P_SRV debug_level=3" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5985 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ | 
| Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5986 | 0 \ | 
|  | 5987 | -s "dumping 'client hello extensions' (0 bytes)" | 
|  | 5988 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5989 | # Tests for mbedtls_ssl_get_bytes_avail() | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5990 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5991 | run_test    "mbedtls_ssl_get_bytes_avail: no extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5992 | "$P_SRV" \ | 
|  | 5993 | "$P_CLI request_size=100" \ | 
|  | 5994 | 0 \ | 
|  | 5995 | -s "Read from client: 100 bytes read$" | 
|  | 5996 |  | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5997 | run_test    "mbedtls_ssl_get_bytes_avail: extra data" \ | 
| Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5998 | "$P_SRV" \ | 
|  | 5999 | "$P_CLI request_size=500" \ | 
|  | 6000 | 0 \ | 
|  | 6001 | -s "Read from client: 500 bytes read (.*+.*)" | 
| Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 6002 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6003 | # Tests for small client packets | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6004 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6005 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6006 | run_test    "Small client packet SSLv3 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6007 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6008 | "$P_CLI request_size=1 force_version=ssl3 \ | 
|  | 6009 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6010 | 0 \ | 
|  | 6011 | -s "Read from client: 1 bytes read" | 
|  | 6012 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6013 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6014 | run_test    "Small client packet SSLv3 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6015 | "$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] | 6016 | "$P_CLI request_size=1 force_version=ssl3 \ | 
|  | 6017 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6018 | 0 \ | 
|  | 6019 | -s "Read from client: 1 bytes read" | 
|  | 6020 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6021 | run_test    "Small client packet TLS 1.0 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6022 | "$P_SRV" \ | 
|  | 6023 | "$P_CLI request_size=1 force_version=tls1 \ | 
|  | 6024 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6025 | 0 \ | 
|  | 6026 | -s "Read from client: 1 bytes read" | 
|  | 6027 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6028 | 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] | 6029 | "$P_SRV" \ | 
|  | 6030 | "$P_CLI request_size=1 force_version=tls1 etm=0 \ | 
|  | 6031 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6032 | 0 \ | 
|  | 6033 | -s "Read from client: 1 bytes read" | 
|  | 6034 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6035 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6036 | run_test    "Small client packet TLS 1.0 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6037 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6038 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6039 | 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] | 6040 | 0 \ | 
|  | 6041 | -s "Read from client: 1 bytes read" | 
|  | 6042 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6043 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6044 | 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] | 6045 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6046 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6047 | 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] | 6048 | 0 \ | 
|  | 6049 | -s "Read from client: 1 bytes read" | 
|  | 6050 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6051 | run_test    "Small client packet TLS 1.0 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6052 | "$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] | 6053 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6054 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6055 | 0 \ | 
|  | 6056 | -s "Read from client: 1 bytes read" | 
|  | 6057 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6058 | run_test    "Small client packet TLS 1.0 StreamCipher, without EtM" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6059 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6060 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6061 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6062 | 0 \ | 
|  | 6063 | -s "Read from client: 1 bytes read" | 
|  | 6064 |  | 
|  | 6065 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6066 | run_test    "Small client packet TLS 1.0 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6067 | "$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] | 6068 | "$P_CLI request_size=1 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6069 | 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] | 6070 | 0 \ | 
|  | 6071 | -s "Read from client: 1 bytes read" | 
|  | 6072 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6073 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6074 | 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] | 6075 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6076 | "$P_CLI request_size=1 force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 6077 | trunc_hmac=1 etm=0" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6078 | 0 \ | 
|  | 6079 | -s "Read from client: 1 bytes read" | 
|  | 6080 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6081 | run_test    "Small client packet TLS 1.1 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6082 | "$P_SRV" \ | 
|  | 6083 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 6084 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6085 | 0 \ | 
|  | 6086 | -s "Read from client: 1 bytes read" | 
|  | 6087 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6088 | 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] | 6089 | "$P_SRV" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6090 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6091 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6092 | 0 \ | 
|  | 6093 | -s "Read from client: 1 bytes read" | 
|  | 6094 |  | 
|  | 6095 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6096 | run_test    "Small client packet TLS 1.1 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6097 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6098 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6099 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6100 | 0 \ | 
|  | 6101 | -s "Read from client: 1 bytes read" | 
|  | 6102 |  | 
|  | 6103 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6104 | 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] | 6105 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6106 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6107 | 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] | 6108 | 0 \ | 
|  | 6109 | -s "Read from client: 1 bytes read" | 
|  | 6110 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6111 | run_test    "Small client packet TLS 1.1 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6112 | "$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] | 6113 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
|  | 6114 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6115 | 0 \ | 
|  | 6116 | -s "Read from client: 1 bytes read" | 
|  | 6117 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6118 | run_test    "Small client packet TLS 1.1 StreamCipher, without EtM" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6119 | "$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] | 6120 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6121 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6122 | 0 \ | 
|  | 6123 | -s "Read from client: 1 bytes read" | 
|  | 6124 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6125 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6126 | run_test    "Small client packet TLS 1.1 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6127 | "$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] | 6128 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6129 | 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] | 6130 | 0 \ | 
|  | 6131 | -s "Read from client: 1 bytes read" | 
|  | 6132 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6133 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6134 | 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] | 6135 | "$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] | 6136 | "$P_CLI request_size=1 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6137 | 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] | 6138 | 0 \ | 
|  | 6139 | -s "Read from client: 1 bytes read" | 
|  | 6140 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6141 | run_test    "Small client packet TLS 1.2 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6142 | "$P_SRV" \ | 
|  | 6143 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 6144 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6145 | 0 \ | 
|  | 6146 | -s "Read from client: 1 bytes read" | 
|  | 6147 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6148 | 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] | 6149 | "$P_SRV" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6150 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6151 | 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] | 6152 | 0 \ | 
|  | 6153 | -s "Read from client: 1 bytes read" | 
|  | 6154 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6155 | 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] | 6156 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6157 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 6158 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6159 | 0 \ | 
|  | 6160 | -s "Read from client: 1 bytes read" | 
|  | 6161 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6162 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6163 | run_test    "Small client packet TLS 1.2 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6164 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6165 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6166 | 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] | 6167 | 0 \ | 
|  | 6168 | -s "Read from client: 1 bytes read" | 
|  | 6169 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6170 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6171 | 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] | 6172 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6173 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6174 | 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] | 6175 | 0 \ | 
|  | 6176 | -s "Read from client: 1 bytes read" | 
|  | 6177 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6178 | run_test    "Small client packet TLS 1.2 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6179 | "$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] | 6180 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 6181 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6182 | 0 \ | 
|  | 6183 | -s "Read from client: 1 bytes read" | 
|  | 6184 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6185 | 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] | 6186 | "$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] | 6187 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6188 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6189 | 0 \ | 
|  | 6190 | -s "Read from client: 1 bytes read" | 
|  | 6191 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6192 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6193 | run_test    "Small client packet TLS 1.2 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6194 | "$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] | 6195 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6196 | 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] | 6197 | 0 \ | 
|  | 6198 | -s "Read from client: 1 bytes read" | 
|  | 6199 |  | 
| Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 6200 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6201 | 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] | 6202 | "$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] | 6203 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6204 | 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] | 6205 | 0 \ | 
|  | 6206 | -s "Read from client: 1 bytes read" | 
|  | 6207 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6208 | run_test    "Small client packet TLS 1.2 AEAD" \ | 
| Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 6209 | "$P_SRV" \ | 
|  | 6210 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 6211 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 6212 | 0 \ | 
|  | 6213 | -s "Read from client: 1 bytes read" | 
|  | 6214 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6215 | 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] | 6216 | "$P_SRV" \ | 
|  | 6217 | "$P_CLI request_size=1 force_version=tls1_2 \ | 
|  | 6218 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 6219 | 0 \ | 
|  | 6220 | -s "Read from client: 1 bytes read" | 
|  | 6221 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6222 | # Tests for small client packets in DTLS | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6223 |  | 
|  | 6224 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6225 | run_test    "Small client packet DTLS 1.0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6226 | "$P_SRV dtls=1 force_version=dtls1" \ | 
|  | 6227 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 6228 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6229 | 0 \ | 
|  | 6230 | -s "Read from client: 1 bytes read" | 
|  | 6231 |  | 
|  | 6232 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6233 | run_test    "Small client packet DTLS 1.0, without EtM" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6234 | "$P_SRV dtls=1 force_version=dtls1 etm=0" \ | 
|  | 6235 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 6236 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6237 | 0 \ | 
|  | 6238 | -s "Read from client: 1 bytes read" | 
|  | 6239 |  | 
|  | 6240 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6241 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6242 | run_test    "Small client packet DTLS 1.0, truncated hmac" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6243 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1" \ | 
|  | 6244 | "$P_CLI dtls=1 request_size=1 trunc_hmac=1 \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6245 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6246 | 0 \ | 
|  | 6247 | -s "Read from client: 1 bytes read" | 
|  | 6248 |  | 
|  | 6249 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6250 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6251 | run_test    "Small client packet DTLS 1.0, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6252 | "$P_SRV dtls=1 force_version=dtls1 trunc_hmac=1 etm=0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6253 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6254 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6255 | 0 \ | 
|  | 6256 | -s "Read from client: 1 bytes read" | 
|  | 6257 |  | 
|  | 6258 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6259 | run_test    "Small client packet DTLS 1.2" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6260 | "$P_SRV dtls=1 force_version=dtls1_2" \ | 
|  | 6261 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 6262 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6263 | 0 \ | 
|  | 6264 | -s "Read from client: 1 bytes read" | 
|  | 6265 |  | 
|  | 6266 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6267 | run_test    "Small client packet DTLS 1.2, without EtM" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6268 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6269 | "$P_CLI dtls=1 request_size=1 \ | 
|  | 6270 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6271 | 0 \ | 
|  | 6272 | -s "Read from client: 1 bytes read" | 
|  | 6273 |  | 
|  | 6274 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6275 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6276 | run_test    "Small client packet DTLS 1.2, truncated hmac" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6277 | "$P_SRV dtls=1 force_version=dtls1_2 trunc_hmac=1" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6278 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6279 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6280 | 0 \ | 
|  | 6281 | -s "Read from client: 1 bytes read" | 
|  | 6282 |  | 
|  | 6283 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6284 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6285 | run_test    "Small client packet DTLS 1.2, without EtM, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6286 | "$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] | 6287 | "$P_CLI dtls=1 request_size=1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6288 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
| Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 6289 | 0 \ | 
|  | 6290 | -s "Read from client: 1 bytes read" | 
|  | 6291 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6292 | # Tests for small server packets | 
|  | 6293 |  | 
|  | 6294 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 6295 | run_test    "Small server packet SSLv3 BlockCipher" \ | 
|  | 6296 | "$P_SRV response_size=1 min_version=ssl3" \ | 
|  | 6297 | "$P_CLI force_version=ssl3 \ | 
|  | 6298 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6299 | 0 \ | 
|  | 6300 | -c "Read from server: 1 bytes read" | 
|  | 6301 |  | 
|  | 6302 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 6303 | run_test    "Small server packet SSLv3 StreamCipher" \ | 
|  | 6304 | "$P_SRV response_size=1 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6305 | "$P_CLI force_version=ssl3 \ | 
|  | 6306 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6307 | 0 \ | 
|  | 6308 | -c "Read from server: 1 bytes read" | 
|  | 6309 |  | 
|  | 6310 | run_test    "Small server packet TLS 1.0 BlockCipher" \ | 
|  | 6311 | "$P_SRV response_size=1" \ | 
|  | 6312 | "$P_CLI force_version=tls1 \ | 
|  | 6313 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6314 | 0 \ | 
|  | 6315 | -c "Read from server: 1 bytes read" | 
|  | 6316 |  | 
|  | 6317 | run_test    "Small server packet TLS 1.0 BlockCipher, without EtM" \ | 
|  | 6318 | "$P_SRV response_size=1" \ | 
|  | 6319 | "$P_CLI force_version=tls1 etm=0 \ | 
|  | 6320 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6321 | 0 \ | 
|  | 6322 | -c "Read from server: 1 bytes read" | 
|  | 6323 |  | 
|  | 6324 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6325 | run_test    "Small server packet TLS 1.0 BlockCipher, truncated MAC" \ | 
|  | 6326 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 6327 | "$P_CLI force_version=tls1 \ | 
|  | 6328 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
|  | 6329 | 0 \ | 
|  | 6330 | -c "Read from server: 1 bytes read" | 
|  | 6331 |  | 
|  | 6332 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6333 | run_test    "Small server packet TLS 1.0 BlockCipher, without EtM, truncated MAC" \ | 
|  | 6334 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 6335 | "$P_CLI force_version=tls1 \ | 
|  | 6336 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 6337 | 0 \ | 
|  | 6338 | -c "Read from server: 1 bytes read" | 
|  | 6339 |  | 
|  | 6340 | run_test    "Small server packet TLS 1.0 StreamCipher" \ | 
|  | 6341 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6342 | "$P_CLI force_version=tls1 \ | 
|  | 6343 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6344 | 0 \ | 
|  | 6345 | -c "Read from server: 1 bytes read" | 
|  | 6346 |  | 
|  | 6347 | run_test    "Small server packet TLS 1.0 StreamCipher, without EtM" \ | 
|  | 6348 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6349 | "$P_CLI force_version=tls1 \ | 
|  | 6350 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 6351 | 0 \ | 
|  | 6352 | -c "Read from server: 1 bytes read" | 
|  | 6353 |  | 
|  | 6354 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6355 | run_test    "Small server packet TLS 1.0 StreamCipher, truncated MAC" \ | 
|  | 6356 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6357 | "$P_CLI force_version=tls1 \ | 
|  | 6358 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6359 | 0 \ | 
|  | 6360 | -c "Read from server: 1 bytes read" | 
|  | 6361 |  | 
|  | 6362 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6363 | run_test    "Small server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ | 
|  | 6364 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6365 | "$P_CLI force_version=tls1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 6366 | trunc_hmac=1 etm=0" \ | 
|  | 6367 | 0 \ | 
|  | 6368 | -c "Read from server: 1 bytes read" | 
|  | 6369 |  | 
|  | 6370 | run_test    "Small server packet TLS 1.1 BlockCipher" \ | 
|  | 6371 | "$P_SRV response_size=1" \ | 
|  | 6372 | "$P_CLI force_version=tls1_1 \ | 
|  | 6373 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6374 | 0 \ | 
|  | 6375 | -c "Read from server: 1 bytes read" | 
|  | 6376 |  | 
|  | 6377 | run_test    "Small server packet TLS 1.1 BlockCipher, without EtM" \ | 
|  | 6378 | "$P_SRV response_size=1" \ | 
|  | 6379 | "$P_CLI force_version=tls1_1 \ | 
|  | 6380 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
|  | 6381 | 0 \ | 
|  | 6382 | -c "Read from server: 1 bytes read" | 
|  | 6383 |  | 
|  | 6384 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6385 | run_test    "Small server packet TLS 1.1 BlockCipher, truncated MAC" \ | 
|  | 6386 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 6387 | "$P_CLI force_version=tls1_1 \ | 
|  | 6388 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
|  | 6389 | 0 \ | 
|  | 6390 | -c "Read from server: 1 bytes read" | 
|  | 6391 |  | 
|  | 6392 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6393 | run_test    "Small server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ | 
|  | 6394 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 6395 | "$P_CLI force_version=tls1_1 \ | 
|  | 6396 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 6397 | 0 \ | 
|  | 6398 | -c "Read from server: 1 bytes read" | 
|  | 6399 |  | 
|  | 6400 | run_test    "Small server packet TLS 1.1 StreamCipher" \ | 
|  | 6401 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6402 | "$P_CLI force_version=tls1_1 \ | 
|  | 6403 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6404 | 0 \ | 
|  | 6405 | -c "Read from server: 1 bytes read" | 
|  | 6406 |  | 
|  | 6407 | run_test    "Small server packet TLS 1.1 StreamCipher, without EtM" \ | 
|  | 6408 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6409 | "$P_CLI force_version=tls1_1 \ | 
|  | 6410 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 6411 | 0 \ | 
|  | 6412 | -c "Read from server: 1 bytes read" | 
|  | 6413 |  | 
|  | 6414 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6415 | run_test    "Small server packet TLS 1.1 StreamCipher, truncated MAC" \ | 
|  | 6416 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6417 | "$P_CLI force_version=tls1_1 \ | 
|  | 6418 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6419 | 0 \ | 
|  | 6420 | -c "Read from server: 1 bytes read" | 
|  | 6421 |  | 
|  | 6422 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6423 | run_test    "Small server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ | 
|  | 6424 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6425 | "$P_CLI force_version=tls1_1 \ | 
|  | 6426 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ | 
|  | 6427 | 0 \ | 
|  | 6428 | -c "Read from server: 1 bytes read" | 
|  | 6429 |  | 
|  | 6430 | run_test    "Small server packet TLS 1.2 BlockCipher" \ | 
|  | 6431 | "$P_SRV response_size=1" \ | 
|  | 6432 | "$P_CLI force_version=tls1_2 \ | 
|  | 6433 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6434 | 0 \ | 
|  | 6435 | -c "Read from server: 1 bytes read" | 
|  | 6436 |  | 
|  | 6437 | run_test    "Small server packet TLS 1.2 BlockCipher, without EtM" \ | 
|  | 6438 | "$P_SRV response_size=1" \ | 
|  | 6439 | "$P_CLI force_version=tls1_2 \ | 
|  | 6440 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ | 
|  | 6441 | 0 \ | 
|  | 6442 | -c "Read from server: 1 bytes read" | 
|  | 6443 |  | 
|  | 6444 | run_test    "Small server packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 6445 | "$P_SRV response_size=1" \ | 
|  | 6446 | "$P_CLI force_version=tls1_2 \ | 
|  | 6447 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
|  | 6448 | 0 \ | 
|  | 6449 | -c "Read from server: 1 bytes read" | 
|  | 6450 |  | 
|  | 6451 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6452 | run_test    "Small server packet TLS 1.2 BlockCipher, truncated MAC" \ | 
|  | 6453 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 6454 | "$P_CLI force_version=tls1_2 \ | 
|  | 6455 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
|  | 6456 | 0 \ | 
|  | 6457 | -c "Read from server: 1 bytes read" | 
|  | 6458 |  | 
|  | 6459 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6460 | run_test    "Small server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ | 
|  | 6461 | "$P_SRV response_size=1 trunc_hmac=1" \ | 
|  | 6462 | "$P_CLI force_version=tls1_2 \ | 
|  | 6463 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 6464 | 0 \ | 
|  | 6465 | -c "Read from server: 1 bytes read" | 
|  | 6466 |  | 
|  | 6467 | run_test    "Small server packet TLS 1.2 StreamCipher" \ | 
|  | 6468 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6469 | "$P_CLI force_version=tls1_2 \ | 
|  | 6470 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6471 | 0 \ | 
|  | 6472 | -c "Read from server: 1 bytes read" | 
|  | 6473 |  | 
|  | 6474 | run_test    "Small server packet TLS 1.2 StreamCipher, without EtM" \ | 
|  | 6475 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6476 | "$P_CLI force_version=tls1_2 \ | 
|  | 6477 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 6478 | 0 \ | 
|  | 6479 | -c "Read from server: 1 bytes read" | 
|  | 6480 |  | 
|  | 6481 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6482 | run_test    "Small server packet TLS 1.2 StreamCipher, truncated MAC" \ | 
|  | 6483 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6484 | "$P_CLI force_version=tls1_2 \ | 
|  | 6485 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6486 | 0 \ | 
|  | 6487 | -c "Read from server: 1 bytes read" | 
|  | 6488 |  | 
|  | 6489 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6490 | run_test    "Small server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ | 
|  | 6491 | "$P_SRV response_size=1 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6492 | "$P_CLI force_version=tls1_2 \ | 
|  | 6493 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ | 
|  | 6494 | 0 \ | 
|  | 6495 | -c "Read from server: 1 bytes read" | 
|  | 6496 |  | 
|  | 6497 | run_test    "Small server packet TLS 1.2 AEAD" \ | 
|  | 6498 | "$P_SRV response_size=1" \ | 
|  | 6499 | "$P_CLI force_version=tls1_2 \ | 
|  | 6500 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 6501 | 0 \ | 
|  | 6502 | -c "Read from server: 1 bytes read" | 
|  | 6503 |  | 
|  | 6504 | run_test    "Small server packet TLS 1.2 AEAD shorter tag" \ | 
|  | 6505 | "$P_SRV response_size=1" \ | 
|  | 6506 | "$P_CLI force_version=tls1_2 \ | 
|  | 6507 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 6508 | 0 \ | 
|  | 6509 | -c "Read from server: 1 bytes read" | 
|  | 6510 |  | 
|  | 6511 | # Tests for small server packets in DTLS | 
|  | 6512 |  | 
|  | 6513 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6514 | run_test    "Small server packet DTLS 1.0" \ | 
|  | 6515 | "$P_SRV dtls=1 response_size=1 force_version=dtls1" \ | 
|  | 6516 | "$P_CLI dtls=1 \ | 
|  | 6517 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6518 | 0 \ | 
|  | 6519 | -c "Read from server: 1 bytes read" | 
|  | 6520 |  | 
|  | 6521 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6522 | run_test    "Small server packet DTLS 1.0, without EtM" \ | 
|  | 6523 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 etm=0" \ | 
|  | 6524 | "$P_CLI dtls=1 \ | 
|  | 6525 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6526 | 0 \ | 
|  | 6527 | -c "Read from server: 1 bytes read" | 
|  | 6528 |  | 
|  | 6529 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6530 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6531 | run_test    "Small server packet DTLS 1.0, truncated hmac" \ | 
|  | 6532 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1" \ | 
|  | 6533 | "$P_CLI dtls=1 trunc_hmac=1 \ | 
|  | 6534 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6535 | 0 \ | 
|  | 6536 | -c "Read from server: 1 bytes read" | 
|  | 6537 |  | 
|  | 6538 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6539 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6540 | run_test    "Small server packet DTLS 1.0, without EtM, truncated MAC" \ | 
|  | 6541 | "$P_SRV dtls=1 response_size=1 force_version=dtls1 trunc_hmac=1 etm=0" \ | 
|  | 6542 | "$P_CLI dtls=1 \ | 
|  | 6543 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
|  | 6544 | 0 \ | 
|  | 6545 | -c "Read from server: 1 bytes read" | 
|  | 6546 |  | 
|  | 6547 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6548 | run_test    "Small server packet DTLS 1.2" \ | 
|  | 6549 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ | 
|  | 6550 | "$P_CLI dtls=1 \ | 
|  | 6551 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6552 | 0 \ | 
|  | 6553 | -c "Read from server: 1 bytes read" | 
|  | 6554 |  | 
|  | 6555 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6556 | run_test    "Small server packet DTLS 1.2, without EtM" \ | 
|  | 6557 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ | 
|  | 6558 | "$P_CLI dtls=1 \ | 
|  | 6559 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6560 | 0 \ | 
|  | 6561 | -c "Read from server: 1 bytes read" | 
|  | 6562 |  | 
|  | 6563 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6564 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6565 | run_test    "Small server packet DTLS 1.2, truncated hmac" \ | 
|  | 6566 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1" \ | 
|  | 6567 | "$P_CLI dtls=1 \ | 
|  | 6568 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
|  | 6569 | 0 \ | 
|  | 6570 | -c "Read from server: 1 bytes read" | 
|  | 6571 |  | 
|  | 6572 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 6573 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6574 | run_test    "Small server packet DTLS 1.2, without EtM, truncated MAC" \ | 
|  | 6575 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 trunc_hmac=1 etm=0" \ | 
|  | 6576 | "$P_CLI dtls=1 \ | 
|  | 6577 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1"\ | 
|  | 6578 | 0 \ | 
|  | 6579 | -c "Read from server: 1 bytes read" | 
|  | 6580 |  | 
| Janos Follath | 00efff7 | 2016-05-06 13:48:23 +0100 | [diff] [blame] | 6581 | # A test for extensions in SSLv3 | 
|  | 6582 |  | 
|  | 6583 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 6584 | run_test    "SSLv3 with extensions, server side" \ | 
|  | 6585 | "$P_SRV min_version=ssl3 debug_level=3" \ | 
|  | 6586 | "$P_CLI force_version=ssl3 tickets=1 max_frag_len=4096 alpn=abc,1234" \ | 
|  | 6587 | 0 \ | 
|  | 6588 | -S "dumping 'client hello extensions'" \ | 
|  | 6589 | -S "server hello, total extension length:" | 
|  | 6590 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6591 | # Test for large client packets | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6592 |  | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6593 | # How many fragments do we expect to write $1 bytes? | 
|  | 6594 | fragments_for_write() { | 
|  | 6595 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" | 
|  | 6596 | } | 
|  | 6597 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6598 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6599 | run_test    "Large client packet SSLv3 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 448ea50 | 2015-01-12 11:40:14 +0100 | [diff] [blame] | 6600 | "$P_SRV min_version=ssl3" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6601 | "$P_CLI request_size=16384 force_version=ssl3 recsplit=0 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6602 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6603 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6604 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6605 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6606 |  | 
| Janos Follath | e2681a4 | 2016-03-07 15:57:05 +0000 | [diff] [blame] | 6607 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6608 | run_test    "Large client packet SSLv3 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6609 | "$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] | 6610 | "$P_CLI request_size=16384 force_version=ssl3 \ | 
|  | 6611 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6612 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6613 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6614 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6615 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6616 | run_test    "Large client packet TLS 1.0 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6617 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6618 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6619 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6620 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6621 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6622 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6623 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6624 | 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] | 6625 | "$P_SRV" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6626 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ | 
|  | 6627 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6628 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6629 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6630 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6631 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6632 | run_test    "Large client packet TLS 1.0 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6633 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6634 | "$P_CLI request_size=16384 force_version=tls1 recsplit=0 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6635 | 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] | 6636 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6637 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6638 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6639 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6640 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6641 | 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] | 6642 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6643 | "$P_CLI request_size=16384 force_version=tls1 etm=0 recsplit=0 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6644 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6645 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6646 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6647 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6648 | run_test    "Large client packet TLS 1.0 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6649 | "$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] | 6650 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6651 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6652 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6653 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6654 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6655 | run_test    "Large client packet TLS 1.0 StreamCipher, without EtM" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6656 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6657 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6658 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6659 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6660 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6661 |  | 
|  | 6662 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6663 | run_test    "Large client packet TLS 1.0 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6664 | "$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] | 6665 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6666 | 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] | 6667 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6668 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6669 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6670 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6671 | 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] | 6672 | "$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] | 6673 | "$P_CLI request_size=16384 force_version=tls1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6674 | 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] | 6675 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6676 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6677 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6678 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6679 | run_test    "Large client packet TLS 1.1 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6680 | "$P_SRV" \ | 
|  | 6681 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 6682 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6683 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6684 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6685 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6686 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6687 | run_test    "Large client packet TLS 1.1 BlockCipher, without EtM" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6688 | "$P_SRV" \ | 
|  | 6689 | "$P_CLI request_size=16384 force_version=tls1_1 etm=0 \ | 
|  | 6690 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6691 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6692 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6693 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6694 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6695 | run_test    "Large client packet TLS 1.1 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6696 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6697 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6698 | 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] | 6699 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6700 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6701 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6702 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6703 | 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] | 6704 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6705 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6706 | 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] | 6707 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6708 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6709 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6710 | run_test    "Large client packet TLS 1.1 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6711 | "$P_SRV arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6712 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
|  | 6713 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6714 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6715 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6716 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6717 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6718 | run_test    "Large client packet TLS 1.1 StreamCipher, without EtM" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6719 | "$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] | 6720 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6721 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6722 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6723 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6724 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6725 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6726 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6727 | run_test    "Large client packet TLS 1.1 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6728 | "$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] | 6729 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6730 | 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] | 6731 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6732 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6733 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6734 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6735 | 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] | 6736 | "$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] | 6737 | "$P_CLI request_size=16384 force_version=tls1_1 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6738 | 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] | 6739 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6740 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6741 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6742 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6743 | run_test    "Large client packet TLS 1.2 BlockCipher" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6744 | "$P_SRV" \ | 
|  | 6745 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 6746 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6747 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6748 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6749 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6750 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6751 | run_test    "Large client packet TLS 1.2 BlockCipher, without EtM" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6752 | "$P_SRV" \ | 
|  | 6753 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ | 
|  | 6754 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6755 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6756 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6757 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6758 | 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] | 6759 | "$P_SRV" \ | 
| Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 6760 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 6761 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6762 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6763 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6764 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6765 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6766 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6767 | run_test    "Large client packet TLS 1.2 BlockCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6768 | "$P_SRV trunc_hmac=1" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6769 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6770 | 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] | 6771 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6772 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6773 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6774 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6775 | 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] | 6776 | "$P_SRV trunc_hmac=1" \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6777 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6778 | 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] | 6779 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6780 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6781 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6782 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6783 | run_test    "Large client packet TLS 1.2 StreamCipher" \ | 
| Manuel Pégourié-Gonnard | ea0920f | 2015-03-24 09:50:15 +0100 | [diff] [blame] | 6784 | "$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] | 6785 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 6786 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6787 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6788 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6789 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6790 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6791 | 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] | 6792 | "$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] | 6793 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6794 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 6795 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6796 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6797 |  | 
| Hanno Becker | 32c5501 | 2017-11-10 08:42:54 +0000 | [diff] [blame] | 6798 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6799 | run_test    "Large client packet TLS 1.2 StreamCipher, truncated MAC" \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6800 | "$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] | 6801 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6802 | 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] | 6803 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6804 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6805 |  | 
| Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 6806 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6807 | 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] | 6808 | "$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] | 6809 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
| Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 6810 | 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] | 6811 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6812 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6813 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6814 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6815 | run_test    "Large client packet TLS 1.2 AEAD" \ | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6816 | "$P_SRV" \ | 
|  | 6817 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 6818 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 6819 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6820 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6821 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6822 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6823 | 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] | 6824 | "$P_SRV" \ | 
|  | 6825 | "$P_CLI request_size=16384 force_version=tls1_2 \ | 
|  | 6826 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 6827 | 0 \ | 
| Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 6828 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ | 
|  | 6829 | -s "Read from client: $MAX_CONTENT_LEN bytes read" | 
| Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 6830 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6831 | # Test for large server packets | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6832 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 6833 | run_test    "Large server packet SSLv3 StreamCipher" \ | 
|  | 6834 | "$P_SRV response_size=16384 min_version=ssl3 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6835 | "$P_CLI force_version=ssl3 \ | 
|  | 6836 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6837 | 0 \ | 
|  | 6838 | -c "Read from server: 16384 bytes read" | 
|  | 6839 |  | 
| Andrzej Kurek | 6a4f224 | 2018-08-27 08:00:13 -0400 | [diff] [blame] | 6840 | # Checking next 4 tests logs for 1n-1 split against BEAST too | 
|  | 6841 | requires_config_enabled MBEDTLS_SSL_PROTO_SSL3 | 
|  | 6842 | run_test    "Large server packet SSLv3 BlockCipher" \ | 
|  | 6843 | "$P_SRV response_size=16384 min_version=ssl3" \ | 
|  | 6844 | "$P_CLI force_version=ssl3 recsplit=0 \ | 
|  | 6845 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6846 | 0 \ | 
|  | 6847 | -c "Read from server: 1 bytes read"\ | 
|  | 6848 | -c "16383 bytes read"\ | 
|  | 6849 | -C "Read from server: 16384 bytes read" | 
|  | 6850 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6851 | run_test    "Large server packet TLS 1.0 BlockCipher" \ | 
|  | 6852 | "$P_SRV response_size=16384" \ | 
|  | 6853 | "$P_CLI force_version=tls1 recsplit=0 \ | 
|  | 6854 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6855 | 0 \ | 
|  | 6856 | -c "Read from server: 1 bytes read"\ | 
|  | 6857 | -c "16383 bytes read"\ | 
|  | 6858 | -C "Read from server: 16384 bytes read" | 
|  | 6859 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6860 | run_test    "Large server packet TLS 1.0 BlockCipher, without EtM" \ | 
|  | 6861 | "$P_SRV response_size=16384" \ | 
|  | 6862 | "$P_CLI force_version=tls1 etm=0 recsplit=0 \ | 
|  | 6863 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6864 | 0 \ | 
|  | 6865 | -c "Read from server: 1 bytes read"\ | 
|  | 6866 | -c "16383 bytes read"\ | 
|  | 6867 | -C "Read from server: 16384 bytes read" | 
|  | 6868 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6869 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6870 | run_test    "Large server packet TLS 1.0 BlockCipher truncated MAC" \ | 
|  | 6871 | "$P_SRV response_size=16384" \ | 
|  | 6872 | "$P_CLI force_version=tls1 recsplit=0 \ | 
|  | 6873 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 6874 | trunc_hmac=1" \ | 
|  | 6875 | 0 \ | 
|  | 6876 | -c "Read from server: 1 bytes read"\ | 
|  | 6877 | -c "16383 bytes read"\ | 
|  | 6878 | -C "Read from server: 16384 bytes read" | 
|  | 6879 |  | 
|  | 6880 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6881 | run_test    "Large server packet TLS 1.0 StreamCipher truncated MAC" \ | 
|  | 6882 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6883 | "$P_CLI force_version=tls1 \ | 
|  | 6884 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 6885 | trunc_hmac=1" \ | 
|  | 6886 | 0 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6887 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6888 | -c "Read from server: 16384 bytes read" | 
|  | 6889 |  | 
|  | 6890 | run_test    "Large server packet TLS 1.0 StreamCipher" \ | 
|  | 6891 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6892 | "$P_CLI force_version=tls1 \ | 
|  | 6893 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6894 | 0 \ | 
|  | 6895 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6896 | -c "Read from server: 16384 bytes read" | 
|  | 6897 |  | 
|  | 6898 | run_test    "Large server packet TLS 1.0 StreamCipher, without EtM" \ | 
|  | 6899 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6900 | "$P_CLI force_version=tls1 \ | 
|  | 6901 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 6902 | 0 \ | 
|  | 6903 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6904 | -c "Read from server: 16384 bytes read" | 
|  | 6905 |  | 
|  | 6906 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6907 | run_test    "Large server packet TLS 1.0 StreamCipher, truncated MAC" \ | 
|  | 6908 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6909 | "$P_CLI force_version=tls1 \ | 
|  | 6910 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6911 | 0 \ | 
|  | 6912 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6913 | -c "Read from server: 16384 bytes read" | 
|  | 6914 |  | 
|  | 6915 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6916 | run_test    "Large server packet TLS 1.0 StreamCipher, without EtM, truncated MAC" \ | 
|  | 6917 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6918 | "$P_CLI force_version=tls1 \ | 
|  | 6919 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ | 
|  | 6920 | 0 \ | 
|  | 6921 | -s "16384 bytes written in 1 fragments" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6922 | -c "Read from server: 16384 bytes read" | 
|  | 6923 |  | 
|  | 6924 | run_test    "Large server packet TLS 1.1 BlockCipher" \ | 
|  | 6925 | "$P_SRV response_size=16384" \ | 
|  | 6926 | "$P_CLI force_version=tls1_1 \ | 
|  | 6927 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6928 | 0 \ | 
|  | 6929 | -c "Read from server: 16384 bytes read" | 
|  | 6930 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6931 | run_test    "Large server packet TLS 1.1 BlockCipher, without EtM" \ | 
|  | 6932 | "$P_SRV response_size=16384" \ | 
|  | 6933 | "$P_CLI force_version=tls1_1 etm=0 \ | 
|  | 6934 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6935 | 0 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6936 | -s "16384 bytes written in 1 fragments" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6937 | -c "Read from server: 16384 bytes read" | 
|  | 6938 |  | 
|  | 6939 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 6940 | run_test    "Large server packet TLS 1.1 BlockCipher truncated MAC" \ | 
|  | 6941 | "$P_SRV response_size=16384" \ | 
|  | 6942 | "$P_CLI force_version=tls1_1 \ | 
|  | 6943 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 6944 | trunc_hmac=1" \ | 
|  | 6945 | 0 \ | 
|  | 6946 | -c "Read from server: 16384 bytes read" | 
|  | 6947 |  | 
|  | 6948 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6949 | run_test    "Large server packet TLS 1.1 BlockCipher, without EtM, truncated MAC" \ | 
|  | 6950 | "$P_SRV response_size=16384 trunc_hmac=1" \ | 
|  | 6951 | "$P_CLI force_version=tls1_1 \ | 
|  | 6952 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 6953 | 0 \ | 
|  | 6954 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6955 | -c "Read from server: 16384 bytes read" | 
|  | 6956 |  | 
|  | 6957 | run_test    "Large server packet TLS 1.1 StreamCipher" \ | 
|  | 6958 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6959 | "$P_CLI force_version=tls1_1 \ | 
|  | 6960 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6961 | 0 \ | 
|  | 6962 | -c "Read from server: 16384 bytes read" | 
|  | 6963 |  | 
|  | 6964 | run_test    "Large server packet TLS 1.1 StreamCipher, without EtM" \ | 
|  | 6965 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6966 | "$P_CLI force_version=tls1_1 \ | 
|  | 6967 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 6968 | 0 \ | 
|  | 6969 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6970 | -c "Read from server: 16384 bytes read" | 
|  | 6971 |  | 
|  | 6972 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6973 | run_test    "Large server packet TLS 1.1 StreamCipher truncated MAC" \ | 
|  | 6974 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 6975 | "$P_CLI force_version=tls1_1 \ | 
|  | 6976 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 6977 | trunc_hmac=1" \ | 
|  | 6978 | 0 \ | 
|  | 6979 | -c "Read from server: 16384 bytes read" | 
|  | 6980 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6981 | run_test    "Large server packet TLS 1.1 StreamCipher, without EtM, truncated MAC" \ | 
|  | 6982 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 6983 | "$P_CLI force_version=tls1_1 \ | 
|  | 6984 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ | 
|  | 6985 | 0 \ | 
|  | 6986 | -s "16384 bytes written in 1 fragments" \ | 
|  | 6987 | -c "Read from server: 16384 bytes read" | 
|  | 6988 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 6989 | run_test    "Large server packet TLS 1.2 BlockCipher" \ | 
|  | 6990 | "$P_SRV response_size=16384" \ | 
|  | 6991 | "$P_CLI force_version=tls1_2 \ | 
|  | 6992 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 6993 | 0 \ | 
|  | 6994 | -c "Read from server: 16384 bytes read" | 
|  | 6995 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 6996 | run_test    "Large server packet TLS 1.2 BlockCipher, without EtM" \ | 
|  | 6997 | "$P_SRV response_size=16384" \ | 
|  | 6998 | "$P_CLI force_version=tls1_2 etm=0 \ | 
|  | 6999 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ | 
|  | 7000 | 0 \ | 
|  | 7001 | -s "16384 bytes written in 1 fragments" \ | 
|  | 7002 | -c "Read from server: 16384 bytes read" | 
|  | 7003 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7004 | run_test    "Large server packet TLS 1.2 BlockCipher larger MAC" \ | 
|  | 7005 | "$P_SRV response_size=16384" \ | 
|  | 7006 | "$P_CLI force_version=tls1_2 \ | 
|  | 7007 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ | 
|  | 7008 | 0 \ | 
|  | 7009 | -c "Read from server: 16384 bytes read" | 
|  | 7010 |  | 
|  | 7011 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 7012 | run_test    "Large server packet TLS 1.2 BlockCipher truncated MAC" \ | 
|  | 7013 | "$P_SRV response_size=16384" \ | 
|  | 7014 | "$P_CLI force_version=tls1_2 \ | 
|  | 7015 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA \ | 
|  | 7016 | trunc_hmac=1" \ | 
|  | 7017 | 0 \ | 
|  | 7018 | -c "Read from server: 16384 bytes read" | 
|  | 7019 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7020 | run_test    "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ | 
|  | 7021 | "$P_SRV response_size=16384 trunc_hmac=1" \ | 
|  | 7022 | "$P_CLI force_version=tls1_2 \ | 
|  | 7023 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ | 
|  | 7024 | 0 \ | 
|  | 7025 | -s "16384 bytes written in 1 fragments" \ | 
|  | 7026 | -c "Read from server: 16384 bytes read" | 
|  | 7027 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7028 | run_test    "Large server packet TLS 1.2 StreamCipher" \ | 
|  | 7029 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 7030 | "$P_CLI force_version=tls1_2 \ | 
|  | 7031 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 7032 | 0 \ | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7033 | -s "16384 bytes written in 1 fragments" \ | 
|  | 7034 | -c "Read from server: 16384 bytes read" | 
|  | 7035 |  | 
|  | 7036 | run_test    "Large server packet TLS 1.2 StreamCipher, without EtM" \ | 
|  | 7037 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 7038 | "$P_CLI force_version=tls1_2 \ | 
|  | 7039 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA etm=0" \ | 
|  | 7040 | 0 \ | 
|  | 7041 | -s "16384 bytes written in 1 fragments" \ | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7042 | -c "Read from server: 16384 bytes read" | 
|  | 7043 |  | 
|  | 7044 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 7045 | run_test    "Large server packet TLS 1.2 StreamCipher truncated MAC" \ | 
|  | 7046 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA" \ | 
|  | 7047 | "$P_CLI force_version=tls1_2 \ | 
|  | 7048 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA \ | 
|  | 7049 | trunc_hmac=1" \ | 
|  | 7050 | 0 \ | 
|  | 7051 | -c "Read from server: 16384 bytes read" | 
|  | 7052 |  | 
| Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 7053 | requires_config_enabled MBEDTLS_SSL_TRUNCATED_HMAC | 
|  | 7054 | run_test    "Large server packet TLS 1.2 StreamCipher, without EtM, truncated MAC" \ | 
|  | 7055 | "$P_SRV response_size=16384 arc4=1 force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1" \ | 
|  | 7056 | "$P_CLI force_version=tls1_2 \ | 
|  | 7057 | force_ciphersuite=TLS-RSA-WITH-RC4-128-SHA trunc_hmac=1 etm=0" \ | 
|  | 7058 | 0 \ | 
|  | 7059 | -s "16384 bytes written in 1 fragments" \ | 
|  | 7060 | -c "Read from server: 16384 bytes read" | 
|  | 7061 |  | 
| Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 7062 | run_test    "Large server packet TLS 1.2 AEAD" \ | 
|  | 7063 | "$P_SRV response_size=16384" \ | 
|  | 7064 | "$P_CLI force_version=tls1_2 \ | 
|  | 7065 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ | 
|  | 7066 | 0 \ | 
|  | 7067 | -c "Read from server: 16384 bytes read" | 
|  | 7068 |  | 
|  | 7069 | run_test    "Large server packet TLS 1.2 AEAD shorter tag" \ | 
|  | 7070 | "$P_SRV response_size=16384" \ | 
|  | 7071 | "$P_CLI force_version=tls1_2 \ | 
|  | 7072 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ | 
|  | 7073 | 0 \ | 
|  | 7074 | -c "Read from server: 16384 bytes read" | 
|  | 7075 |  | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7076 | # Tests for restartable ECC | 
|  | 7077 |  | 
|  | 7078 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 7079 | run_test    "EC restart: TLS, default" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7080 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7081 | "$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] | 7082 | 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] | 7083 | debug_level=1" \ | 
|  | 7084 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7085 | -C "x509_verify_cert.*4b00" \ | 
|  | 7086 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 7087 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 7088 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7089 |  | 
|  | 7090 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 7091 | run_test    "EC restart: TLS, max_ops=0" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7092 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7093 | "$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] | 7094 | 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] | 7095 | debug_level=1 ec_max_ops=0" \ | 
|  | 7096 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7097 | -C "x509_verify_cert.*4b00" \ | 
|  | 7098 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 7099 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 7100 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7101 |  | 
|  | 7102 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 7103 | run_test    "EC restart: TLS, max_ops=65535" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7104 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7105 | "$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] | 7106 | 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] | 7107 | debug_level=1 ec_max_ops=65535" \ | 
|  | 7108 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7109 | -C "x509_verify_cert.*4b00" \ | 
|  | 7110 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 7111 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 7112 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7113 |  | 
|  | 7114 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 7115 | run_test    "EC restart: TLS, max_ops=1000" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7116 | "$P_SRV auth_mode=required" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7117 | "$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] | 7118 | 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] | 7119 | debug_level=1 ec_max_ops=1000" \ | 
|  | 7120 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7121 | -c "x509_verify_cert.*4b00" \ | 
|  | 7122 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 7123 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 7124 | -c "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7125 |  | 
|  | 7126 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7127 | run_test    "EC restart: TLS, max_ops=1000, badsign" \ | 
|  | 7128 | "$P_SRV auth_mode=required \ | 
|  | 7129 | crt_file=data_files/server5-badsign.crt \ | 
|  | 7130 | key_file=data_files/server5.key" \ | 
|  | 7131 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7132 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 7133 | debug_level=1 ec_max_ops=1000" \ | 
|  | 7134 | 1 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7135 | -c "x509_verify_cert.*4b00" \ | 
|  | 7136 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 7137 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 7138 | -C "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7139 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 7140 | -c "! mbedtls_ssl_handshake returned" \ | 
|  | 7141 | -c "X509 - Certificate verification failed" | 
|  | 7142 |  | 
|  | 7143 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 7144 | run_test    "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ | 
|  | 7145 | "$P_SRV auth_mode=required \ | 
|  | 7146 | crt_file=data_files/server5-badsign.crt \ | 
|  | 7147 | key_file=data_files/server5.key" \ | 
|  | 7148 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7149 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 7150 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ | 
|  | 7151 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7152 | -c "x509_verify_cert.*4b00" \ | 
|  | 7153 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 7154 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 7155 | -c "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7156 | -c "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 7157 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 7158 | -C "X509 - Certificate verification failed" | 
|  | 7159 |  | 
|  | 7160 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 7161 | run_test    "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ | 
|  | 7162 | "$P_SRV auth_mode=required \ | 
|  | 7163 | crt_file=data_files/server5-badsign.crt \ | 
|  | 7164 | key_file=data_files/server5.key" \ | 
|  | 7165 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7166 | key_file=data_files/server5.key crt_file=data_files/server5.crt  \ | 
|  | 7167 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ | 
|  | 7168 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7169 | -C "x509_verify_cert.*4b00" \ | 
|  | 7170 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 7171 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 7172 | -c "mbedtls_pk_sign.*4b00" \ | 
| Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 7173 | -C "! The certificate is not correctly signed by the trusted CA" \ | 
|  | 7174 | -C "! mbedtls_ssl_handshake returned" \ | 
|  | 7175 | -C "X509 - Certificate verification failed" | 
|  | 7176 |  | 
|  | 7177 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7178 | run_test    "EC restart: DTLS, max_ops=1000" \ | 
| Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 7179 | "$P_SRV auth_mode=required dtls=1" \ | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7180 | "$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] | 7181 | 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] | 7182 | dtls=1 debug_level=1 ec_max_ops=1000" \ | 
|  | 7183 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7184 | -c "x509_verify_cert.*4b00" \ | 
|  | 7185 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 7186 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 7187 | -c "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 7188 |  | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7189 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 7190 | run_test    "EC restart: TLS, max_ops=1000 no client auth" \ | 
|  | 7191 | "$P_SRV" \ | 
|  | 7192 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 7193 | debug_level=1 ec_max_ops=1000" \ | 
|  | 7194 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7195 | -c "x509_verify_cert.*4b00" \ | 
|  | 7196 | -c "mbedtls_pk_verify.*4b00" \ | 
|  | 7197 | -c "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 7198 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7199 |  | 
|  | 7200 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE | 
|  | 7201 | run_test    "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ | 
|  | 7202 | "$P_SRV psk=abc123" \ | 
|  | 7203 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ | 
|  | 7204 | psk=abc123 debug_level=1 ec_max_ops=1000" \ | 
|  | 7205 | 0 \ | 
| Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 7206 | -C "x509_verify_cert.*4b00" \ | 
|  | 7207 | -C "mbedtls_pk_verify.*4b00" \ | 
|  | 7208 | -C "mbedtls_ecdh_make_public.*4b00" \ | 
|  | 7209 | -C "mbedtls_pk_sign.*4b00" | 
| Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 7210 |  | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7211 | # Tests of asynchronous private key support in SSL | 
|  | 7212 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7213 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7214 | run_test    "SSL async private: sign, delay=0" \ | 
|  | 7215 | "$P_SRV \ | 
|  | 7216 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7217 | "$P_CLI" \ | 
|  | 7218 | 0 \ | 
|  | 7219 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7220 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7221 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7222 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7223 | run_test    "SSL async private: sign, delay=1" \ | 
|  | 7224 | "$P_SRV \ | 
|  | 7225 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7226 | "$P_CLI" \ | 
|  | 7227 | 0 \ | 
|  | 7228 | -s "Async sign callback: using key slot " \ | 
|  | 7229 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7230 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 7231 |  | 
| Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 7232 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 7233 | run_test    "SSL async private: sign, delay=2" \ | 
|  | 7234 | "$P_SRV \ | 
|  | 7235 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ | 
|  | 7236 | "$P_CLI" \ | 
|  | 7237 | 0 \ | 
|  | 7238 | -s "Async sign callback: using key slot " \ | 
|  | 7239 | -U "Async sign callback: using key slot " \ | 
|  | 7240 | -s "Async resume (slot [0-9]): call 1 more times." \ | 
|  | 7241 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 7242 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 7243 |  | 
| Gilles Peskine | d326883 | 2018-04-26 06:23:59 +0200 | [diff] [blame] | 7244 | # Test that the async callback correctly signs the 36-byte hash of TLS 1.0/1.1 | 
|  | 7245 | # with RSA PKCS#1v1.5 as used in TLS 1.0/1.1. | 
|  | 7246 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 7247 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 7248 | run_test    "SSL async private: sign, RSA, TLS 1.1" \ | 
|  | 7249 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt \ | 
|  | 7250 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ | 
|  | 7251 | "$P_CLI force_version=tls1_1" \ | 
|  | 7252 | 0 \ | 
|  | 7253 | -s "Async sign callback: using key slot " \ | 
|  | 7254 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 7255 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7256 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 7257 | run_test    "SSL async private: sign, SNI" \ | 
|  | 7258 | "$P_SRV debug_level=3 \ | 
|  | 7259 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ | 
|  | 7260 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ | 
|  | 7261 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ | 
|  | 7262 | "$P_CLI server_name=polarssl.example" \ | 
|  | 7263 | 0 \ | 
|  | 7264 | -s "Async sign callback: using key slot " \ | 
|  | 7265 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 7266 | -s "parse ServerName extension" \ | 
|  | 7267 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ | 
|  | 7268 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" | 
|  | 7269 |  | 
|  | 7270 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7271 | run_test    "SSL async private: decrypt, delay=0" \ | 
|  | 7272 | "$P_SRV \ | 
|  | 7273 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 7274 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7275 | 0 \ | 
|  | 7276 | -s "Async decrypt callback: using key slot " \ | 
|  | 7277 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 7278 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7279 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7280 | run_test    "SSL async private: decrypt, delay=1" \ | 
|  | 7281 | "$P_SRV \ | 
|  | 7282 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 7283 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7284 | 0 \ | 
|  | 7285 | -s "Async decrypt callback: using key slot " \ | 
|  | 7286 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 7287 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 7288 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7289 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7290 | run_test    "SSL async private: decrypt RSA-PSK, delay=0" \ | 
|  | 7291 | "$P_SRV psk=abc123 \ | 
|  | 7292 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ | 
|  | 7293 | "$P_CLI psk=abc123 \ | 
|  | 7294 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 7295 | 0 \ | 
|  | 7296 | -s "Async decrypt callback: using key slot " \ | 
|  | 7297 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 7298 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7299 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7300 | run_test    "SSL async private: decrypt RSA-PSK, delay=1" \ | 
|  | 7301 | "$P_SRV psk=abc123 \ | 
|  | 7302 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 7303 | "$P_CLI psk=abc123 \ | 
|  | 7304 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ | 
|  | 7305 | 0 \ | 
|  | 7306 | -s "Async decrypt callback: using key slot " \ | 
|  | 7307 | -s "Async resume (slot [0-9]): call 0 more times." \ | 
|  | 7308 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 7309 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7310 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7311 | run_test    "SSL async private: sign callback not present" \ | 
|  | 7312 | "$P_SRV \ | 
|  | 7313 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ | 
|  | 7314 | "$P_CLI; [ \$? -eq 1 ] && | 
|  | 7315 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7316 | 0 \ | 
|  | 7317 | -S "Async sign callback" \ | 
|  | 7318 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7319 | -s "The own private key or pre-shared key is not set, but needed" \ | 
|  | 7320 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ | 
|  | 7321 | -s "Successful connection" | 
|  | 7322 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7323 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7324 | run_test    "SSL async private: decrypt callback not present" \ | 
|  | 7325 | "$P_SRV debug_level=1 \ | 
|  | 7326 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ | 
|  | 7327 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; | 
|  | 7328 | [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 7329 | 0 \ | 
|  | 7330 | -S "Async decrypt callback" \ | 
|  | 7331 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7332 | -s "got no RSA private key" \ | 
|  | 7333 | -s "Async resume (slot [0-9]): sign done, status=0" \ | 
|  | 7334 | -s "Successful connection" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7335 |  | 
|  | 7336 | # key1: ECDSA, key2: RSA; use key1 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7337 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7338 | run_test    "SSL async private: slot 0 used with key1" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7339 | "$P_SRV \ | 
|  | 7340 | async_operations=s async_private_delay1=1 \ | 
|  | 7341 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7342 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7343 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7344 | 0 \ | 
|  | 7345 | -s "Async sign callback: using key slot 0," \ | 
|  | 7346 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7347 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7348 |  | 
|  | 7349 | # key1: ECDSA, key2: RSA; use key2 from slot 0 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7350 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7351 | run_test    "SSL async private: slot 0 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7352 | "$P_SRV \ | 
|  | 7353 | async_operations=s async_private_delay2=1 \ | 
|  | 7354 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7355 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7356 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7357 | 0 \ | 
|  | 7358 | -s "Async sign callback: using key slot 0," \ | 
|  | 7359 | -s "Async resume (slot 0): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7360 | -s "Async resume (slot 0): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7361 |  | 
|  | 7362 | # key1: ECDSA, key2: RSA; use key2 from slot 1 | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7363 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 7364 | run_test    "SSL async private: slot 1 used with key2" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7365 | "$P_SRV \ | 
| Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 7366 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7367 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7368 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7369 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7370 | 0 \ | 
|  | 7371 | -s "Async sign callback: using key slot 1," \ | 
|  | 7372 | -s "Async resume (slot 1): call 0 more times." \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7373 | -s "Async resume (slot 1): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7374 |  | 
|  | 7375 | # key1: ECDSA, key2: RSA; use key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7376 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7377 | run_test    "SSL async private: fall back to transparent key" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7378 | "$P_SRV \ | 
|  | 7379 | async_operations=s async_private_delay1=1 \ | 
|  | 7380 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7381 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7382 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7383 | 0 \ | 
|  | 7384 | -s "Async sign callback: no key matches this certificate." | 
|  | 7385 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7386 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7387 | run_test    "SSL async private: sign, error in start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7388 | "$P_SRV \ | 
|  | 7389 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7390 | async_private_error=1" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7391 | "$P_CLI" \ | 
|  | 7392 | 1 \ | 
|  | 7393 | -s "Async sign callback: injected error" \ | 
|  | 7394 | -S "Async resume" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7395 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7396 | -s "! mbedtls_ssl_handshake returned" | 
|  | 7397 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7398 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7399 | run_test    "SSL async private: sign, cancel after start" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7400 | "$P_SRV \ | 
|  | 7401 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7402 | async_private_error=2" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7403 | "$P_CLI" \ | 
|  | 7404 | 1 \ | 
|  | 7405 | -s "Async sign callback: using key slot " \ | 
|  | 7406 | -S "Async resume" \ | 
|  | 7407 | -s "Async cancel" | 
|  | 7408 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7409 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7410 | run_test    "SSL async private: sign, error in resume" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7411 | "$P_SRV \ | 
|  | 7412 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7413 | async_private_error=3" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7414 | "$P_CLI" \ | 
|  | 7415 | 1 \ | 
|  | 7416 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7417 | -s "Async resume callback: sign done but injected error" \ | 
| Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 7418 | -S "Async cancel" \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7419 | -s "! mbedtls_ssl_handshake returned" | 
|  | 7420 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7421 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7422 | run_test    "SSL async private: decrypt, error in start" \ | 
|  | 7423 | "$P_SRV \ | 
|  | 7424 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7425 | async_private_error=1" \ | 
|  | 7426 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7427 | 1 \ | 
|  | 7428 | -s "Async decrypt callback: injected error" \ | 
|  | 7429 | -S "Async resume" \ | 
|  | 7430 | -S "Async cancel" \ | 
|  | 7431 | -s "! mbedtls_ssl_handshake returned" | 
|  | 7432 |  | 
|  | 7433 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 7434 | run_test    "SSL async private: decrypt, cancel after start" \ | 
|  | 7435 | "$P_SRV \ | 
|  | 7436 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7437 | async_private_error=2" \ | 
|  | 7438 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7439 | 1 \ | 
|  | 7440 | -s "Async decrypt callback: using key slot " \ | 
|  | 7441 | -S "Async resume" \ | 
|  | 7442 | -s "Async cancel" | 
|  | 7443 |  | 
|  | 7444 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
|  | 7445 | run_test    "SSL async private: decrypt, error in resume" \ | 
|  | 7446 | "$P_SRV \ | 
|  | 7447 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7448 | async_private_error=3" \ | 
|  | 7449 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7450 | 1 \ | 
|  | 7451 | -s "Async decrypt callback: using key slot " \ | 
|  | 7452 | -s "Async resume callback: decrypt done but injected error" \ | 
|  | 7453 | -S "Async cancel" \ | 
|  | 7454 | -s "! mbedtls_ssl_handshake returned" | 
|  | 7455 |  | 
|  | 7456 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7457 | run_test    "SSL async private: cancel after start then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7458 | "$P_SRV \ | 
|  | 7459 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7460 | async_private_error=-2" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7461 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 7462 | 0 \ | 
|  | 7463 | -s "Async cancel" \ | 
|  | 7464 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7465 | -s "Async resume" \ | 
|  | 7466 | -s "Successful connection" | 
|  | 7467 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7468 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7469 | run_test    "SSL async private: error in resume then operate correctly" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7470 | "$P_SRV \ | 
|  | 7471 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7472 | async_private_error=-3" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7473 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ | 
|  | 7474 | 0 \ | 
|  | 7475 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7476 | -s "Async resume" \ | 
|  | 7477 | -s "Successful connection" | 
|  | 7478 |  | 
|  | 7479 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7480 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7481 | 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] | 7482 | "$P_SRV \ | 
|  | 7483 | async_operations=s async_private_delay1=1 async_private_error=-2 \ | 
|  | 7484 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7485 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7486 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 7487 | [ \$? -eq 1 ] && | 
|  | 7488 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7489 | 0 \ | 
| Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 7490 | -s "Async sign callback: using key slot 0" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7491 | -S "Async resume" \ | 
|  | 7492 | -s "Async cancel" \ | 
|  | 7493 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7494 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 7495 | -s "Successful connection" | 
|  | 7496 |  | 
|  | 7497 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7498 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 7499 | 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] | 7500 | "$P_SRV \ | 
|  | 7501 | async_operations=s async_private_delay1=1 async_private_error=-3 \ | 
|  | 7502 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ | 
|  | 7503 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ | 
| Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 7504 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; | 
|  | 7505 | [ \$? -eq 1 ] && | 
|  | 7506 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7507 | 0 \ | 
|  | 7508 | -s "Async resume" \ | 
|  | 7509 | -s "! mbedtls_ssl_handshake returned" \ | 
|  | 7510 | -s "Async sign callback: no key matches this certificate." \ | 
|  | 7511 | -s "Successful connection" | 
|  | 7512 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7513 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7514 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7515 | run_test    "SSL async private: renegotiation: client-initiated, sign" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7516 | "$P_SRV \ | 
|  | 7517 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7518 | exchanges=2 renegotiation=1" \ | 
|  | 7519 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 7520 | 0 \ | 
|  | 7521 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7522 | -s "Async resume (slot [0-9]): sign done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7523 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7524 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7525 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7526 | run_test    "SSL async private: renegotiation: server-initiated, sign" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7527 | "$P_SRV \ | 
|  | 7528 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7529 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 7530 | "$P_CLI exchanges=2 renegotiation=1" \ | 
|  | 7531 | 0 \ | 
|  | 7532 | -s "Async sign callback: using key slot " \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7533 | -s "Async resume (slot [0-9]): sign done, status=0" | 
|  | 7534 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7535 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7536 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7537 | run_test    "SSL async private: renegotiation: client-initiated, decrypt" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7538 | "$P_SRV \ | 
|  | 7539 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7540 | exchanges=2 renegotiation=1" \ | 
|  | 7541 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ | 
|  | 7542 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7543 | 0 \ | 
|  | 7544 | -s "Async decrypt callback: using key slot " \ | 
|  | 7545 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
|  | 7546 |  | 
| Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 7547 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7548 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 7549 | run_test    "SSL async private: renegotiation: server-initiated, decrypt" \ | 
| Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 7550 | "$P_SRV \ | 
|  | 7551 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ | 
|  | 7552 | exchanges=2 renegotiation=1 renegotiate=1" \ | 
|  | 7553 | "$P_CLI exchanges=2 renegotiation=1 \ | 
|  | 7554 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 7555 | 0 \ | 
|  | 7556 | -s "Async decrypt callback: using key slot " \ | 
|  | 7557 | -s "Async resume (slot [0-9]): decrypt done, status=0" | 
| Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 7558 |  | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7559 | # Tests for ECC extensions (rfc 4492) | 
|  | 7560 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7561 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7562 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7563 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7564 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7565 | run_test    "Force a non ECC ciphersuite in the client side" \ | 
|  | 7566 | "$P_SRV debug_level=3" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7567 | "$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] | 7568 | 0 \ | 
|  | 7569 | -C "client hello, adding supported_elliptic_curves extension" \ | 
|  | 7570 | -C "client hello, adding supported_point_formats extension" \ | 
|  | 7571 | -S "found supported elliptic curves extension" \ | 
|  | 7572 | -S "found supported point formats extension" | 
|  | 7573 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7574 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7575 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7576 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7577 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7578 | run_test    "Force a non ECC ciphersuite in the server side" \ | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7579 | "$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] | 7580 | "$P_CLI debug_level=3" \ | 
|  | 7581 | 0 \ | 
|  | 7582 | -C "found supported_point_formats extension" \ | 
|  | 7583 | -S "server hello, supported_point_formats extension" | 
|  | 7584 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7585 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7586 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7587 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7588 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7589 | run_test    "Force an ECC ciphersuite in the client side" \ | 
|  | 7590 | "$P_SRV debug_level=3" \ | 
|  | 7591 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7592 | 0 \ | 
|  | 7593 | -c "client hello, adding supported_elliptic_curves extension" \ | 
|  | 7594 | -c "client hello, adding supported_point_formats extension" \ | 
|  | 7595 | -s "found supported elliptic curves extension" \ | 
|  | 7596 | -s "found supported point formats extension" | 
|  | 7597 |  | 
| Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 7598 | requires_config_enabled MBEDTLS_AES_C | 
|  | 7599 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 7600 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 7601 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED | 
| Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 7602 | run_test    "Force an ECC ciphersuite in the server side" \ | 
|  | 7603 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ | 
|  | 7604 | "$P_CLI debug_level=3" \ | 
|  | 7605 | 0 \ | 
|  | 7606 | -c "found supported_point_formats extension" \ | 
|  | 7607 | -s "server hello, supported_point_formats extension" | 
|  | 7608 |  | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7609 | # Tests for DTLS HelloVerifyRequest | 
|  | 7610 |  | 
|  | 7611 | run_test    "DTLS cookie: enabled" \ | 
|  | 7612 | "$P_SRV dtls=1 debug_level=2" \ | 
|  | 7613 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7614 | 0 \ | 
|  | 7615 | -s "cookie verification failed" \ | 
|  | 7616 | -s "cookie verification passed" \ | 
|  | 7617 | -S "cookie verification skipped" \ | 
|  | 7618 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7619 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7620 | -S "SSL - The requested feature is not available" | 
|  | 7621 |  | 
|  | 7622 | run_test    "DTLS cookie: disabled" \ | 
|  | 7623 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ | 
|  | 7624 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7625 | 0 \ | 
|  | 7626 | -S "cookie verification failed" \ | 
|  | 7627 | -S "cookie verification passed" \ | 
|  | 7628 | -s "cookie verification skipped" \ | 
|  | 7629 | -C "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7630 | -S "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7631 | -S "SSL - The requested feature is not available" | 
|  | 7632 |  | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7633 | run_test    "DTLS cookie: default (failing)" \ | 
|  | 7634 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ | 
|  | 7635 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ | 
|  | 7636 | 1 \ | 
|  | 7637 | -s "cookie verification failed" \ | 
|  | 7638 | -S "cookie verification passed" \ | 
|  | 7639 | -S "cookie verification skipped" \ | 
|  | 7640 | -C "received hello verify request" \ | 
|  | 7641 | -S "hello verification requested" \ | 
|  | 7642 | -s "SSL - The requested feature is not available" | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7643 |  | 
|  | 7644 | requires_ipv6 | 
|  | 7645 | run_test    "DTLS cookie: enabled, IPv6" \ | 
|  | 7646 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 7647 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ | 
|  | 7648 | 0 \ | 
|  | 7649 | -s "cookie verification failed" \ | 
|  | 7650 | -s "cookie verification passed" \ | 
|  | 7651 | -S "cookie verification skipped" \ | 
|  | 7652 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7653 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 7654 | -S "SSL - The requested feature is not available" | 
|  | 7655 |  | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7656 | run_test    "DTLS cookie: enabled, nbio" \ | 
|  | 7657 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ | 
|  | 7658 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 7659 | 0 \ | 
|  | 7660 | -s "cookie verification failed" \ | 
|  | 7661 | -s "cookie verification passed" \ | 
|  | 7662 | -S "cookie verification skipped" \ | 
|  | 7663 | -c "received hello verify request" \ | 
| Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 7664 | -s "hello verification requested" \ | 
| Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 7665 | -S "SSL - The requested feature is not available" | 
|  | 7666 |  | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7667 | # Tests for client reconnecting from the same port with DTLS | 
|  | 7668 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7669 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7670 | run_test    "DTLS client reconnect from same port: reference" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7671 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ | 
|  | 7672 | "$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] | 7673 | 0 \ | 
|  | 7674 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7675 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7676 | -S "Client initiated reconnection from same port" | 
|  | 7677 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7678 | not_with_valgrind # spurious resend | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7679 | run_test    "DTLS client reconnect from same port: reconnect" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7680 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ | 
|  | 7681 | "$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] | 7682 | 0 \ | 
|  | 7683 | -C "resend" \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7684 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7685 | -s "Client initiated reconnection from same port" | 
|  | 7686 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7687 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) | 
|  | 7688 | 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] | 7689 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ | 
|  | 7690 | "$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] | 7691 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7692 | -S "The operation timed out" \ | 
| Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 7693 | -s "Client initiated reconnection from same port" | 
|  | 7694 |  | 
| Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 7695 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout | 
|  | 7696 | run_test    "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ | 
|  | 7697 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ | 
|  | 7698 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ | 
|  | 7699 | 0 \ | 
|  | 7700 | -S "The operation timed out" \ | 
|  | 7701 | -s "Client initiated reconnection from same port" | 
|  | 7702 |  | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7703 | run_test    "DTLS client reconnect from same port: no cookies" \ | 
|  | 7704 | "$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] | 7705 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ | 
|  | 7706 | 0 \ | 
| Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 7707 | -s "The operation timed out" \ | 
|  | 7708 | -S "Client initiated reconnection from same port" | 
|  | 7709 |  | 
| Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 7710 | run_test    "DTLS client reconnect from same port: attacker-injected" \ | 
|  | 7711 | -p "$P_PXY inject_clihlo=1" \ | 
|  | 7712 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ | 
|  | 7713 | "$P_CLI dtls=1 exchanges=2" \ | 
|  | 7714 | 0 \ | 
|  | 7715 | -s "possible client reconnect from the same port" \ | 
|  | 7716 | -S "Client initiated reconnection from same port" | 
|  | 7717 |  | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7718 | # Tests for various cases of client authentication with DTLS | 
|  | 7719 | # (focused on handshake flows and message parsing) | 
|  | 7720 |  | 
|  | 7721 | run_test    "DTLS client auth: required" \ | 
|  | 7722 | "$P_SRV dtls=1 auth_mode=required" \ | 
|  | 7723 | "$P_CLI dtls=1" \ | 
|  | 7724 | 0 \ | 
|  | 7725 | -s "Verifying peer X.509 certificate... ok" | 
|  | 7726 |  | 
|  | 7727 | run_test    "DTLS client auth: optional, client has no cert" \ | 
|  | 7728 | "$P_SRV dtls=1 auth_mode=optional" \ | 
|  | 7729 | "$P_CLI dtls=1 crt_file=none key_file=none" \ | 
|  | 7730 | 0 \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7731 | -s "! Certificate was missing" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7732 |  | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7733 | run_test    "DTLS client auth: none, client has no cert" \ | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7734 | "$P_SRV dtls=1 auth_mode=none" \ | 
|  | 7735 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ | 
|  | 7736 | 0 \ | 
|  | 7737 | -c "skip write certificate$" \ | 
| Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 7738 | -s "! Certificate verification was skipped" | 
| Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 7739 |  | 
| Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 7740 | run_test    "DTLS wrong PSK: badmac alert" \ | 
|  | 7741 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ | 
|  | 7742 | "$P_CLI dtls=1 psk=abc124" \ | 
|  | 7743 | 1 \ | 
|  | 7744 | -s "SSL - Verification of the message MAC failed" \ | 
|  | 7745 | -c "SSL - A fatal alert message was received from our peer" | 
|  | 7746 |  | 
| Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 7747 | # Tests for receiving fragmented handshake messages with DTLS | 
|  | 7748 |  | 
|  | 7749 | requires_gnutls | 
|  | 7750 | run_test    "DTLS reassembly: no fragmentation (gnutls server)" \ | 
|  | 7751 | "$G_SRV -u --mtu 2048 -a" \ | 
|  | 7752 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7753 | 0 \ | 
|  | 7754 | -C "found fragmented DTLS handshake message" \ | 
|  | 7755 | -C "error" | 
|  | 7756 |  | 
|  | 7757 | requires_gnutls | 
|  | 7758 | run_test    "DTLS reassembly: some fragmentation (gnutls server)" \ | 
|  | 7759 | "$G_SRV -u --mtu 512" \ | 
|  | 7760 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7761 | 0 \ | 
|  | 7762 | -c "found fragmented DTLS handshake message" \ | 
|  | 7763 | -C "error" | 
|  | 7764 |  | 
|  | 7765 | requires_gnutls | 
|  | 7766 | run_test    "DTLS reassembly: more fragmentation (gnutls server)" \ | 
|  | 7767 | "$G_SRV -u --mtu 128" \ | 
|  | 7768 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7769 | 0 \ | 
|  | 7770 | -c "found fragmented DTLS handshake message" \ | 
|  | 7771 | -C "error" | 
|  | 7772 |  | 
|  | 7773 | requires_gnutls | 
|  | 7774 | run_test    "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ | 
|  | 7775 | "$G_SRV -u --mtu 128" \ | 
|  | 7776 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 7777 | 0 \ | 
|  | 7778 | -c "found fragmented DTLS handshake message" \ | 
|  | 7779 | -C "error" | 
|  | 7780 |  | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7781 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7782 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7783 | run_test    "DTLS reassembly: fragmentation, renego (gnutls server)" \ | 
|  | 7784 | "$G_SRV -u --mtu 256" \ | 
|  | 7785 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 7786 | 0 \ | 
|  | 7787 | -c "found fragmented DTLS handshake message" \ | 
|  | 7788 | -c "client hello, adding renegotiation extension" \ | 
|  | 7789 | -c "found renegotiation extension" \ | 
|  | 7790 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7791 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7792 | -C "error" \ | 
|  | 7793 | -s "Extra-header:" | 
|  | 7794 |  | 
|  | 7795 | requires_gnutls | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 7796 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7797 | run_test    "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ | 
|  | 7798 | "$G_SRV -u --mtu 256" \ | 
|  | 7799 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ | 
|  | 7800 | 0 \ | 
|  | 7801 | -c "found fragmented DTLS handshake message" \ | 
|  | 7802 | -c "client hello, adding renegotiation extension" \ | 
|  | 7803 | -c "found renegotiation extension" \ | 
|  | 7804 | -c "=> renegotiate" \ | 
| Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 7805 | -C "mbedtls_ssl_handshake returned" \ | 
| Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 7806 | -C "error" \ | 
|  | 7807 | -s "Extra-header:" | 
|  | 7808 |  | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7809 | run_test    "DTLS reassembly: no fragmentation (openssl server)" \ | 
|  | 7810 | "$O_SRV -dtls1 -mtu 2048" \ | 
|  | 7811 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7812 | 0 \ | 
|  | 7813 | -C "found fragmented DTLS handshake message" \ | 
|  | 7814 | -C "error" | 
|  | 7815 |  | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7816 | run_test    "DTLS reassembly: some fragmentation (openssl server)" \ | 
|  | 7817 | "$O_SRV -dtls1 -mtu 768" \ | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7818 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7819 | 0 \ | 
|  | 7820 | -c "found fragmented DTLS handshake message" \ | 
|  | 7821 | -C "error" | 
|  | 7822 |  | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7823 | run_test    "DTLS reassembly: more fragmentation (openssl server)" \ | 
| Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7824 | "$O_SRV -dtls1 -mtu 256" \ | 
|  | 7825 | "$P_CLI dtls=1 debug_level=2" \ | 
|  | 7826 | 0 \ | 
|  | 7827 | -c "found fragmented DTLS handshake message" \ | 
|  | 7828 | -C "error" | 
|  | 7829 |  | 
|  | 7830 | run_test    "DTLS reassembly: fragmentation, nbio (openssl server)" \ | 
|  | 7831 | "$O_SRV -dtls1 -mtu 256" \ | 
|  | 7832 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ | 
|  | 7833 | 0 \ | 
|  | 7834 | -c "found fragmented DTLS handshake message" \ | 
|  | 7835 | -C "error" | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7836 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7837 | # Tests for sending fragmented handshake messages with DTLS | 
|  | 7838 | # | 
|  | 7839 | # Use client auth when we need the client to send large messages, | 
|  | 7840 | # and use large cert chains on both sides too (the long chains we have all use | 
|  | 7841 | # both RSA and ECDSA, but ideally we should have long chains with either). | 
|  | 7842 | # Sizes reached (UDP payload): | 
|  | 7843 | # - 2037B for server certificate | 
|  | 7844 | # - 1542B for client certificate | 
|  | 7845 | # - 1013B for newsessionticket | 
|  | 7846 | # - all others below 512B | 
|  | 7847 | # All those tests assume MAX_CONTENT_LEN is at least 2048 | 
|  | 7848 |  | 
|  | 7849 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7850 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7851 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7852 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 7853 | run_test    "DTLS fragmenting: none (for reference)" \ | 
|  | 7854 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7855 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7856 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7857 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7858 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7859 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7860 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7861 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7862 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 7863 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7864 | 0 \ | 
|  | 7865 | -S "found fragmented DTLS handshake message" \ | 
|  | 7866 | -C "found fragmented DTLS handshake message" \ | 
|  | 7867 | -C "error" | 
|  | 7868 |  | 
|  | 7869 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7870 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7871 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7872 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7873 | run_test    "DTLS fragmenting: server only (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7874 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7875 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7876 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7877 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7878 | max_frag_len=1024" \ | 
|  | 7879 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7880 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7881 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7882 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7883 | max_frag_len=2048" \ | 
|  | 7884 | 0 \ | 
|  | 7885 | -S "found fragmented DTLS handshake message" \ | 
|  | 7886 | -c "found fragmented DTLS handshake message" \ | 
|  | 7887 | -C "error" | 
|  | 7888 |  | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7889 | # With the MFL extension, the server has no way of forcing | 
|  | 7890 | # the client to not exceed a certain MTU; hence, the following | 
|  | 7891 | # test can't be replicated with an MTU proxy such as the one | 
|  | 7892 | # `client-initiated, server only (max_frag_len)` below. | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7893 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7894 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7895 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7896 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7897 | run_test    "DTLS fragmenting: server only (more) (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7898 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7899 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7900 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7901 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7902 | max_frag_len=512" \ | 
|  | 7903 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7904 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7905 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7906 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 7907 | max_frag_len=4096" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7908 | 0 \ | 
|  | 7909 | -S "found fragmented DTLS handshake message" \ | 
|  | 7910 | -c "found fragmented DTLS handshake message" \ | 
|  | 7911 | -C "error" | 
|  | 7912 |  | 
|  | 7913 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7914 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7915 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7916 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7917 | 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] | 7918 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 7919 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7920 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7921 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7922 | max_frag_len=2048" \ | 
|  | 7923 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7924 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7925 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7926 | hs_timeout=2500-60000 \ | 
|  | 7927 | max_frag_len=1024" \ | 
|  | 7928 | 0 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7929 | -S "found fragmented DTLS handshake message" \ | 
|  | 7930 | -c "found fragmented DTLS handshake message" \ | 
|  | 7931 | -C "error" | 
|  | 7932 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7933 | # While not required by the standard defining the MFL extension | 
|  | 7934 | # (according to which it only applies to records, not to datagrams), | 
|  | 7935 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 7936 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 7937 | # to the peer. | 
|  | 7938 | # The next test checks that no datagrams significantly larger than the | 
|  | 7939 | # negotiated MFL are sent. | 
|  | 7940 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7941 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7942 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7943 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 7944 | 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] | 7945 | -p "$P_PXY mtu=1110" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7946 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ | 
|  | 7947 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7948 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7949 | hs_timeout=2500-60000 \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7950 | max_frag_len=2048" \ | 
|  | 7951 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7952 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7953 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7954 | hs_timeout=2500-60000 \ | 
|  | 7955 | max_frag_len=1024" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7956 | 0 \ | 
|  | 7957 | -S "found fragmented DTLS handshake message" \ | 
|  | 7958 | -c "found fragmented DTLS handshake message" \ | 
|  | 7959 | -C "error" | 
|  | 7960 |  | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7961 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7962 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7963 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7964 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7965 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len)" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7966 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7967 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7968 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7969 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7970 | max_frag_len=2048" \ | 
|  | 7971 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 7972 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 7973 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7974 | hs_timeout=2500-60000 \ | 
|  | 7975 | max_frag_len=1024" \ | 
| Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 7976 | 0 \ | 
|  | 7977 | -s "found fragmented DTLS handshake message" \ | 
|  | 7978 | -c "found fragmented DTLS handshake message" \ | 
|  | 7979 | -C "error" | 
|  | 7980 |  | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7981 | # While not required by the standard defining the MFL extension | 
|  | 7982 | # (according to which it only applies to records, not to datagrams), | 
|  | 7983 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, | 
|  | 7984 | # as otherwise there wouldn't be any means to communicate MTU restrictions | 
|  | 7985 | # to the peer. | 
|  | 7986 | # The next test checks that no datagrams significantly larger than the | 
|  | 7987 | # negotiated MFL are sent. | 
|  | 7988 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 7989 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 7990 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 7991 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 7992 | run_test    "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ | 
| Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 7993 | -p "$P_PXY mtu=1110" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7994 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 7995 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 7996 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7997 | hs_timeout=2500-60000 \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 7998 | max_frag_len=2048" \ | 
|  | 7999 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8000 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8001 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8002 | hs_timeout=2500-60000 \ | 
|  | 8003 | max_frag_len=1024" \ | 
| Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 8004 | 0 \ | 
|  | 8005 | -s "found fragmented DTLS handshake message" \ | 
|  | 8006 | -c "found fragmented DTLS handshake message" \ | 
|  | 8007 | -C "error" | 
|  | 8008 |  | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8009 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8010 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8011 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8012 | run_test    "DTLS fragmenting: none (for reference) (MTU)" \ | 
|  | 8013 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8014 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8015 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8016 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8017 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8018 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8019 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8020 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8021 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8022 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8023 | 0 \ | 
|  | 8024 | -S "found fragmented DTLS handshake message" \ | 
|  | 8025 | -C "found fragmented DTLS handshake message" \ | 
|  | 8026 | -C "error" | 
|  | 8027 |  | 
|  | 8028 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8029 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8030 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8031 | run_test    "DTLS fragmenting: client (MTU)" \ | 
|  | 8032 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8033 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8034 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8035 | hs_timeout=3500-60000 \ | 
| Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 8036 | mtu=4096" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8037 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8038 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8039 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8040 | hs_timeout=3500-60000 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8041 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8042 | 0 \ | 
|  | 8043 | -s "found fragmented DTLS handshake message" \ | 
|  | 8044 | -C "found fragmented DTLS handshake message" \ | 
|  | 8045 | -C "error" | 
|  | 8046 |  | 
|  | 8047 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8048 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8049 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8050 | run_test    "DTLS fragmenting: server (MTU)" \ | 
|  | 8051 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8052 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8053 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8054 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8055 | mtu=512" \ | 
|  | 8056 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8057 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8058 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8059 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8060 | mtu=2048" \ | 
|  | 8061 | 0 \ | 
|  | 8062 | -S "found fragmented DTLS handshake message" \ | 
|  | 8063 | -c "found fragmented DTLS handshake message" \ | 
|  | 8064 | -C "error" | 
|  | 8065 |  | 
|  | 8066 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8067 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8068 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8069 | run_test    "DTLS fragmenting: both (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8070 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8071 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8072 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8073 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8074 | hs_timeout=2500-60000 \ | 
| Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 8075 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8076 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8077 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8078 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8079 | hs_timeout=2500-60000 \ | 
|  | 8080 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 8081 | 0 \ | 
|  | 8082 | -s "found fragmented DTLS handshake message" \ | 
|  | 8083 | -c "found fragmented DTLS handshake message" \ | 
|  | 8084 | -C "error" | 
|  | 8085 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8086 | # 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] | 8087 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8088 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8089 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8090 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 8091 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8092 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8093 | requires_config_enabled MBEDTLS_GCM_C | 
|  | 8094 | run_test    "DTLS fragmenting: both (MTU=512)" \ | 
| Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 8095 | -p "$P_PXY mtu=512" \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8096 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8097 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8098 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8099 | hs_timeout=2500-60000 \ | 
| Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 8100 | mtu=512" \ | 
|  | 8101 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8102 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8103 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8104 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8105 | hs_timeout=2500-60000 \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8106 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8107 | 0 \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8108 | -s "found fragmented DTLS handshake message" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8109 | -c "found fragmented DTLS handshake message" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8110 | -C "error" | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8111 |  | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8112 | # Test for automatic MTU reduction on repeated resend. | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8113 | # 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] | 8114 | # The ratio of max/min timeout should ideally equal 4 to accept two | 
|  | 8115 | # retransmissions, but in some cases (like both the server and client using | 
|  | 8116 | # fragmentation and auto-reduction) an extra retransmission might occur, | 
|  | 8117 | # hence the ratio of 8. | 
| Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 8118 | not_with_valgrind | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8119 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8120 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8121 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8122 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8123 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8124 | requires_config_enabled MBEDTLS_GCM_C | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8125 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8126 | -p "$P_PXY mtu=508" \ | 
|  | 8127 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8128 | crt_file=data_files/server7_int-ca.crt \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8129 | key_file=data_files/server7.key \ | 
|  | 8130 | hs_timeout=400-3200" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8131 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8132 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8133 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8134 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8135 | hs_timeout=400-3200" \ | 
| Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 8136 | 0 \ | 
|  | 8137 | -s "found fragmented DTLS handshake message" \ | 
|  | 8138 | -c "found fragmented DTLS handshake message" \ | 
|  | 8139 | -C "error" | 
|  | 8140 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8141 | # 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] | 8142 | only_with_valgrind | 
|  | 8143 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8144 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8145 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8146 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8147 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8148 | requires_config_enabled MBEDTLS_GCM_C | 
| Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 8149 | run_test    "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8150 | -p "$P_PXY mtu=508" \ | 
|  | 8151 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8152 | crt_file=data_files/server7_int-ca.crt \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8153 | key_file=data_files/server7.key \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8154 | hs_timeout=250-10000" \ | 
|  | 8155 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8156 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8157 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8158 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 8159 | hs_timeout=250-10000" \ | 
|  | 8160 | 0 \ | 
|  | 8161 | -s "found fragmented DTLS handshake message" \ | 
|  | 8162 | -c "found fragmented DTLS handshake message" \ | 
|  | 8163 | -C "error" | 
|  | 8164 |  | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8165 | # 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] | 8166 | # OTOH the client might resend if the server is to slow to reset after sending | 
|  | 8167 | # a HelloVerifyRequest, so only check for no retransmission server-side | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8168 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8169 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8170 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8171 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8172 | run_test    "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8173 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8174 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8175 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8176 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8177 | hs_timeout=10000-60000 \ | 
|  | 8178 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8179 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8180 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8181 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8182 | hs_timeout=10000-60000 \ | 
|  | 8183 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8184 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8185 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8186 | -s "found fragmented DTLS handshake message" \ | 
|  | 8187 | -c "found fragmented DTLS handshake message" \ | 
|  | 8188 | -C "error" | 
|  | 8189 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8190 | # 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] | 8191 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend | 
|  | 8192 | # OTOH the client might resend if the server is to slow to reset after sending | 
|  | 8193 | # a HelloVerifyRequest, so only check for no retransmission server-side | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8194 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8195 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8196 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8197 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8198 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8199 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8200 | requires_config_enabled MBEDTLS_GCM_C | 
|  | 8201 | run_test    "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8202 | -p "$P_PXY mtu=512" \ | 
|  | 8203 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8204 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8205 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8206 | hs_timeout=10000-60000 \ | 
|  | 8207 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8208 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8209 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8210 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8211 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8212 | hs_timeout=10000-60000 \ | 
|  | 8213 | mtu=512" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8214 | 0 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8215 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8216 | -s "found fragmented DTLS handshake message" \ | 
|  | 8217 | -c "found fragmented DTLS handshake message" \ | 
|  | 8218 | -C "error" | 
|  | 8219 |  | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8220 | not_with_valgrind # spurious autoreduction due to timeout | 
|  | 8221 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8222 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8223 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8224 | run_test    "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8225 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8226 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8227 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8228 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8229 | hs_timeout=10000-60000 \ | 
|  | 8230 | mtu=1024 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8231 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8232 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8233 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8234 | hs_timeout=10000-60000 \ | 
|  | 8235 | mtu=1024 nbio=2" \ | 
|  | 8236 | 0 \ | 
|  | 8237 | -S "autoreduction" \ | 
|  | 8238 | -s "found fragmented DTLS handshake message" \ | 
|  | 8239 | -c "found fragmented DTLS handshake message" \ | 
|  | 8240 | -C "error" | 
|  | 8241 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8242 | # 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] | 8243 | not_with_valgrind # spurious autoreduction due to timeout | 
|  | 8244 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8245 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8246 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8247 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8248 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8249 | requires_config_enabled MBEDTLS_GCM_C | 
|  | 8250 | run_test    "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ | 
|  | 8251 | -p "$P_PXY mtu=512" \ | 
|  | 8252 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8253 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8254 | key_file=data_files/server7.key \ | 
|  | 8255 | hs_timeout=10000-60000 \ | 
|  | 8256 | mtu=512 nbio=2" \ | 
|  | 8257 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8258 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8259 | key_file=data_files/server8.key \ | 
|  | 8260 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
|  | 8261 | hs_timeout=10000-60000 \ | 
|  | 8262 | mtu=512 nbio=2" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8263 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8264 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8265 | -s "found fragmented DTLS handshake message" \ | 
|  | 8266 | -c "found fragmented DTLS handshake message" \ | 
|  | 8267 | -C "error" | 
|  | 8268 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8269 | # 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] | 8270 | # This ensures things still work after session_reset(). | 
|  | 8271 | # It also exercises the "resumed handshake" flow. | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8272 | # Since we don't support reading fragmented ClientHello yet, | 
|  | 8273 | # up the MTU to 1450 (larger than ClientHello with session ticket, | 
|  | 8274 | # but still smaller than client's Certificate to ensure fragmentation). | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8275 | # An autoreduction on the client-side might happen if the server is | 
|  | 8276 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
| Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 8277 | # reco_delay avoids races where the client reconnects before the server has | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8278 | # resumed listening, which would result in a spurious autoreduction. | 
|  | 8279 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8280 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8281 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8282 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8283 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8284 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8285 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8286 | run_test    "DTLS fragmenting: proxy MTU, resumed handshake" \ | 
|  | 8287 | -p "$P_PXY mtu=1450" \ | 
|  | 8288 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8289 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8290 | key_file=data_files/server7.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8291 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8292 | mtu=1450" \ | 
|  | 8293 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8294 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8295 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8296 | hs_timeout=10000-60000 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8297 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 8298 | 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] | 8299 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8300 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 8301 | -s "found fragmented DTLS handshake message" \ | 
|  | 8302 | -c "found fragmented DTLS handshake message" \ | 
|  | 8303 | -C "error" | 
|  | 8304 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8305 | # An autoreduction on the client-side might happen if the server is | 
|  | 8306 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 8307 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8308 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8309 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8310 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8311 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 8312 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8313 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 8314 | requires_config_enabled MBEDTLS_CHACHAPOLY_C | 
|  | 8315 | run_test    "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ | 
|  | 8316 | -p "$P_PXY mtu=512" \ | 
|  | 8317 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8318 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8319 | key_file=data_files/server7.key \ | 
|  | 8320 | exchanges=2 renegotiation=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8321 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8322 | mtu=512" \ | 
|  | 8323 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8324 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8325 | key_file=data_files/server8.key \ | 
|  | 8326 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8327 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8328 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8329 | mtu=512" \ | 
|  | 8330 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8331 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8332 | -s "found fragmented DTLS handshake message" \ | 
|  | 8333 | -c "found fragmented DTLS handshake message" \ | 
|  | 8334 | -C "error" | 
|  | 8335 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8336 | # An autoreduction on the client-side might happen if the server is | 
|  | 8337 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 8338 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8339 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8340 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8341 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8342 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 8343 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8344 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 8345 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8346 | requires_config_enabled MBEDTLS_GCM_C | 
|  | 8347 | run_test    "DTLS fragmenting: proxy MTU, AES-GCM renego" \ | 
|  | 8348 | -p "$P_PXY mtu=512" \ | 
|  | 8349 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8350 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8351 | key_file=data_files/server7.key \ | 
|  | 8352 | exchanges=2 renegotiation=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8353 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8354 | mtu=512" \ | 
|  | 8355 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8356 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8357 | key_file=data_files/server8.key \ | 
|  | 8358 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8359 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8360 | hs_timeout=10000-60000 \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8361 | mtu=512" \ | 
|  | 8362 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8363 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8364 | -s "found fragmented DTLS handshake message" \ | 
|  | 8365 | -c "found fragmented DTLS handshake message" \ | 
|  | 8366 | -C "error" | 
|  | 8367 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8368 | # An autoreduction on the client-side might happen if the server is | 
|  | 8369 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 8370 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8371 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8372 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8373 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8374 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 8375 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8376 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 8377 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8378 | requires_config_enabled MBEDTLS_CCM_C | 
|  | 8379 | run_test    "DTLS fragmenting: proxy MTU, AES-CCM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8380 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8381 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8382 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8383 | key_file=data_files/server7.key \ | 
|  | 8384 | exchanges=2 renegotiation=1 \ | 
|  | 8385 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8386 | hs_timeout=10000-60000 \ | 
|  | 8387 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8388 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8389 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8390 | key_file=data_files/server8.key \ | 
|  | 8391 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8392 | hs_timeout=10000-60000 \ | 
|  | 8393 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8394 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8395 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8396 | -s "found fragmented DTLS handshake message" \ | 
|  | 8397 | -c "found fragmented DTLS handshake message" \ | 
|  | 8398 | -C "error" | 
|  | 8399 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8400 | # An autoreduction on the client-side might happen if the server is | 
|  | 8401 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 8402 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8403 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8404 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8405 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8406 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 8407 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8408 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 8409 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8410 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 8411 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC | 
|  | 8412 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8413 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8414 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8415 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8416 | key_file=data_files/server7.key \ | 
|  | 8417 | exchanges=2 renegotiation=1 \ | 
|  | 8418 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8419 | hs_timeout=10000-60000 \ | 
|  | 8420 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8421 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8422 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8423 | key_file=data_files/server8.key \ | 
|  | 8424 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8425 | hs_timeout=10000-60000 \ | 
|  | 8426 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8427 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8428 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8429 | -s "found fragmented DTLS handshake message" \ | 
|  | 8430 | -c "found fragmented DTLS handshake message" \ | 
|  | 8431 | -C "error" | 
|  | 8432 |  | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8433 | # An autoreduction on the client-side might happen if the server is | 
|  | 8434 | # slow to reset, therefore omitting '-C "autoreduction"' below. | 
|  | 8435 | not_with_valgrind # spurious autoreduction due to timeout | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8436 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8437 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8438 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8439 | requires_config_enabled MBEDTLS_SHA256_C | 
|  | 8440 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8441 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
|  | 8442 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8443 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC | 
|  | 8444 | run_test    "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8445 | -p "$P_PXY mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8446 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8447 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8448 | key_file=data_files/server7.key \ | 
|  | 8449 | exchanges=2 renegotiation=1 \ | 
|  | 8450 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8451 | hs_timeout=10000-60000 \ | 
|  | 8452 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8453 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8454 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8455 | key_file=data_files/server8.key \ | 
|  | 8456 | exchanges=2 renegotiation=1 renegotiate=1 \ | 
| Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 8457 | hs_timeout=10000-60000 \ | 
|  | 8458 | mtu=1024" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8459 | 0 \ | 
| Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 8460 | -S "autoreduction" \ | 
| Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 8461 | -s "found fragmented DTLS handshake message" \ | 
|  | 8462 | -c "found fragmented DTLS handshake message" \ | 
|  | 8463 | -C "error" | 
|  | 8464 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8465 | # 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] | 8466 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8467 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8468 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8469 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8470 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8471 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8472 | client_needs_more_time 2 | 
|  | 8473 | run_test    "DTLS fragmenting: proxy MTU + 3d" \ | 
|  | 8474 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8475 | "$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] | 8476 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8477 | key_file=data_files/server7.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8478 | hs_timeout=250-10000 mtu=512" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8479 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8480 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8481 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8482 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8483 | hs_timeout=250-10000 mtu=512" \ | 
| Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 8484 | 0 \ | 
|  | 8485 | -s "found fragmented DTLS handshake message" \ | 
|  | 8486 | -c "found fragmented DTLS handshake message" \ | 
|  | 8487 | -C "error" | 
|  | 8488 |  | 
| Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 8489 | # 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] | 8490 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8491 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8492 | requires_config_enabled MBEDTLS_ECDSA_C | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8493 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA | 
|  | 8494 | requires_config_enabled MBEDTLS_AES_C | 
|  | 8495 | requires_config_enabled MBEDTLS_GCM_C | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8496 | client_needs_more_time 2 | 
|  | 8497 | run_test    "DTLS fragmenting: proxy MTU + 3d, nbio" \ | 
|  | 8498 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ | 
|  | 8499 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ | 
|  | 8500 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8501 | key_file=data_files/server7.key \ | 
|  | 8502 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 8503 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8504 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8505 | key_file=data_files/server8.key \ | 
| Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 8506 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ | 
| Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 8507 | hs_timeout=250-10000 mtu=512 nbio=2" \ | 
|  | 8508 | 0 \ | 
|  | 8509 | -s "found fragmented DTLS handshake message" \ | 
|  | 8510 | -c "found fragmented DTLS handshake message" \ | 
|  | 8511 | -C "error" | 
|  | 8512 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8513 | # interop tests for DTLS fragmentating with reliable connection | 
|  | 8514 | # | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8515 | # here and below we just want to test that the we fragment in a way that | 
|  | 8516 | # pleases other implementations, so we don't need the peer to fragment | 
|  | 8517 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8518 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8519 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8520 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8521 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8522 | run_test    "DTLS fragmenting: gnutls server, DTLS 1.2" \ | 
|  | 8523 | "$G_SRV -u" \ | 
|  | 8524 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8525 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8526 | key_file=data_files/server8.key \ | 
|  | 8527 | mtu=512 force_version=dtls1_2" \ | 
|  | 8528 | 0 \ | 
|  | 8529 | -c "fragmenting handshake message" \ | 
|  | 8530 | -C "error" | 
|  | 8531 |  | 
|  | 8532 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8533 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8534 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8536 | requires_gnutls | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8537 | run_test    "DTLS fragmenting: gnutls server, DTLS 1.0" \ | 
|  | 8538 | "$G_SRV -u" \ | 
|  | 8539 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8540 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8541 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8542 | mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8543 | 0 \ | 
|  | 8544 | -c "fragmenting handshake message" \ | 
|  | 8545 | -C "error" | 
|  | 8546 |  | 
| Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8547 | # We use --insecure for the GnuTLS client because it expects | 
|  | 8548 | # the hostname / IP it connects to to be the name used in the | 
|  | 8549 | # certificate obtained from the server. Here, however, it | 
|  | 8550 | # connects to 127.0.0.1 while our test certificates use 'localhost' | 
|  | 8551 | # as the server name in the certificate. This will make the | 
|  | 8552 | # certifiate validation fail, but passing --insecure makes | 
|  | 8553 | # GnuTLS continue the connection nonetheless. | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8554 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8555 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8556 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8557 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8558 | requires_gnutls | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8559 | requires_not_i686 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8560 | run_test    "DTLS fragmenting: gnutls client, DTLS 1.2" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8561 | "$P_SRV dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8562 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8563 | key_file=data_files/server7.key \ | 
|  | 8564 | mtu=512 force_version=dtls1_2" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8565 | "$G_CLI -u --insecure 127.0.0.1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8566 | 0 \ | 
|  | 8567 | -s "fragmenting handshake message" | 
|  | 8568 |  | 
| Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 8569 | # See previous test for the reason to use --insecure | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8570 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8571 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8572 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8573 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 8574 | requires_gnutls | 
| Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 8575 | requires_not_i686 | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8576 | run_test    "DTLS fragmenting: gnutls client, DTLS 1.0" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8577 | "$P_SRV dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8578 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8579 | key_file=data_files/server7.key \ | 
|  | 8580 | mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 8581 | "$G_CLI -u --insecure 127.0.0.1" \ | 
| Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 8582 | 0 \ | 
|  | 8583 | -s "fragmenting handshake message" | 
|  | 8584 |  | 
|  | 8585 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8586 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8587 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8588 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8589 | run_test    "DTLS fragmenting: openssl server, DTLS 1.2" \ | 
|  | 8590 | "$O_SRV -dtls1_2 -verify 10" \ | 
|  | 8591 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8592 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8593 | key_file=data_files/server8.key \ | 
|  | 8594 | mtu=512 force_version=dtls1_2" \ | 
|  | 8595 | 0 \ | 
|  | 8596 | -c "fragmenting handshake message" \ | 
|  | 8597 | -C "error" | 
|  | 8598 |  | 
|  | 8599 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8600 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8601 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8602 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 8603 | run_test    "DTLS fragmenting: openssl server, DTLS 1.0" \ | 
|  | 8604 | "$O_SRV -dtls1 -verify 10" \ | 
|  | 8605 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8606 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8607 | key_file=data_files/server8.key \ | 
|  | 8608 | mtu=512 force_version=dtls1" \ | 
|  | 8609 | 0 \ | 
|  | 8610 | -c "fragmenting handshake message" \ | 
|  | 8611 | -C "error" | 
|  | 8612 |  | 
|  | 8613 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8614 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8615 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8616 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8617 | run_test    "DTLS fragmenting: openssl client, DTLS 1.2" \ | 
|  | 8618 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8619 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8620 | key_file=data_files/server7.key \ | 
|  | 8621 | mtu=512 force_version=dtls1_2" \ | 
|  | 8622 | "$O_CLI -dtls1_2" \ | 
|  | 8623 | 0 \ | 
|  | 8624 | -s "fragmenting handshake message" | 
|  | 8625 |  | 
|  | 8626 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8627 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8628 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 8630 | run_test    "DTLS fragmenting: openssl client, DTLS 1.0" \ | 
|  | 8631 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8632 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8633 | key_file=data_files/server7.key \ | 
|  | 8634 | mtu=512 force_version=dtls1" \ | 
|  | 8635 | "$O_CLI -dtls1" \ | 
|  | 8636 | 0 \ | 
|  | 8637 | -s "fragmenting handshake message" | 
|  | 8638 |  | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8639 | # interop tests for DTLS fragmentating with unreliable connection | 
|  | 8640 | # | 
|  | 8641 | # again we just want to test that the we fragment in a way that | 
|  | 8642 | # pleases other implementations, so we don't need the peer to fragment | 
|  | 8643 | requires_gnutls_next | 
|  | 8644 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8645 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8646 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8647 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8648 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8649 | run_test    "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ | 
|  | 8650 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8651 | "$G_NEXT_SRV -u" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8652 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8653 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8654 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8655 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8656 | 0 \ | 
|  | 8657 | -c "fragmenting handshake message" \ | 
|  | 8658 | -C "error" | 
|  | 8659 |  | 
|  | 8660 | requires_gnutls_next | 
|  | 8661 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8662 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8663 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8665 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8666 | run_test    "DTLS fragmenting: 3d, gnutls server, DTLS 1.0" \ | 
|  | 8667 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8668 | "$G_NEXT_SRV -u" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8669 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8670 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8671 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8672 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8673 | 0 \ | 
|  | 8674 | -c "fragmenting handshake message" \ | 
|  | 8675 | -C "error" | 
|  | 8676 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8677 | requires_gnutls_next | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8678 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8679 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8680 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8681 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8682 | client_needs_more_time 4 | 
|  | 8683 | run_test    "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ | 
|  | 8684 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8685 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8686 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8687 | key_file=data_files/server7.key \ | 
|  | 8688 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8689 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8690 | 0 \ | 
|  | 8691 | -s "fragmenting handshake message" | 
|  | 8692 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8693 | requires_gnutls_next | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8694 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8695 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8696 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8697 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
|  | 8698 | client_needs_more_time 4 | 
|  | 8699 | run_test    "DTLS fragmenting: 3d, gnutls client, DTLS 1.0" \ | 
|  | 8700 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8701 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8702 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8703 | key_file=data_files/server7.key \ | 
|  | 8704 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8705 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ | 
| Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 8706 | 0 \ | 
|  | 8707 | -s "fragmenting handshake message" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8708 |  | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8709 | ## Interop test with OpenSSL might trigger a bug in recent versions (including | 
|  | 8710 | ## all versions installed on the CI machines), reported here: | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8711 | ## Bug report: https://github.com/openssl/openssl/issues/6902 | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8712 | ## They should be re-enabled once a fixed version of OpenSSL is available | 
|  | 8713 | ## (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] | 8714 | skip_next_test | 
|  | 8715 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8716 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8717 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8718 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8719 | client_needs_more_time 4 | 
|  | 8720 | run_test    "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ | 
|  | 8721 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8722 | "$O_SRV -dtls1_2 -verify 10" \ | 
|  | 8723 | "$P_CLI dtls=1 debug_level=2 \ | 
|  | 8724 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8725 | key_file=data_files/server8.key \ | 
|  | 8726 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
|  | 8727 | 0 \ | 
|  | 8728 | -c "fragmenting handshake message" \ | 
|  | 8729 | -C "error" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8730 |  | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8731 | skip_next_test | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8732 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8733 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8734 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8735 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8736 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8737 | run_test    "DTLS fragmenting: 3d, openssl server, DTLS 1.0" \ | 
|  | 8738 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8739 | "$O_SRV -dtls1 -verify 10" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8740 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8741 | crt_file=data_files/server8_int-ca2.crt \ | 
|  | 8742 | key_file=data_files/server8.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8743 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8744 | 0 \ | 
|  | 8745 | -c "fragmenting handshake message" \ | 
|  | 8746 | -C "error" | 
|  | 8747 |  | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8748 | skip_next_test | 
|  | 8749 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8750 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8751 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8752 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 | 
|  | 8753 | client_needs_more_time 4 | 
|  | 8754 | run_test    "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ | 
|  | 8755 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
|  | 8756 | "$P_SRV dtls=1 debug_level=2 \ | 
|  | 8757 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8758 | key_file=data_files/server7.key \ | 
|  | 8759 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ | 
|  | 8760 | "$O_CLI -dtls1_2" \ | 
|  | 8761 | 0 \ | 
|  | 8762 | -s "fragmenting handshake message" | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8763 |  | 
|  | 8764 | # -nbio is added to prevent s_client from blocking in case of duplicated | 
|  | 8765 | # messages at the end of the handshake | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8766 | skip_next_test | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8767 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS | 
|  | 8768 | requires_config_enabled MBEDTLS_RSA_C | 
|  | 8769 | requires_config_enabled MBEDTLS_ECDSA_C | 
|  | 8770 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_1 | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8771 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8772 | run_test    "DTLS fragmenting: 3d, openssl client, DTLS 1.0" \ | 
|  | 8773 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8774 | "$P_SRV dgram_packing=0 dtls=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8775 | crt_file=data_files/server7_int-ca.crt \ | 
|  | 8776 | key_file=data_files/server7.key \ | 
| Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 8777 | hs_timeout=250-60000 mtu=512 force_version=dtls1" \ | 
| Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 8778 | "$O_CLI -nbio -dtls1" \ | 
| Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 8779 | 0 \ | 
|  | 8780 | -s "fragmenting handshake message" | 
|  | 8781 |  | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8782 | # Tests for DTLS-SRTP (RFC 5764) | 
|  | 8783 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8784 | run_test  "DTLS-SRTP all profiles supported" \ | 
|  | 8785 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8786 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8787 | 0 \ | 
|  | 8788 | -s "found use_srtp extension" \ | 
|  | 8789 | -s "found srtp profile" \ | 
|  | 8790 | -s "selected srtp profile" \ | 
|  | 8791 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8792 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8793 | -c "client hello, adding use_srtp extension" \ | 
|  | 8794 | -c "found use_srtp extension" \ | 
|  | 8795 | -c "found srtp profile" \ | 
|  | 8796 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8797 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8798 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8799 | -C "error" | 
|  | 8800 |  | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8801 |  | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8802 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8803 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile." \ | 
|  | 8804 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8805 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=5 debug_level=3" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8806 | 0 \ | 
|  | 8807 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8808 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
|  | 8809 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8810 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8811 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8812 | -c "client hello, adding use_srtp extension" \ | 
|  | 8813 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8814 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8815 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8816 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8817 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8818 | -C "error" | 
|  | 8819 |  | 
|  | 8820 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8821 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles." \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8822 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8823 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8824 | 0 \ | 
|  | 8825 | -s "found use_srtp extension" \ | 
|  | 8826 | -s "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8827 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8828 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8829 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8830 | -c "client hello, adding use_srtp extension" \ | 
|  | 8831 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8832 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8833 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8834 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8835 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8836 | -C "error" | 
|  | 8837 |  | 
|  | 8838 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8839 | run_test  "DTLS-SRTP server and Client support only one matching profile." \ | 
|  | 8840 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8841 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 8842 | 0 \ | 
|  | 8843 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8844 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 8845 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8846 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8847 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8848 | -c "client hello, adding use_srtp extension" \ | 
|  | 8849 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8850 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8851 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8852 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8853 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8854 | -C "error" | 
|  | 8855 |  | 
|  | 8856 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8857 | run_test  "DTLS-SRTP server and Client support only one different profile." \ | 
|  | 8858 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8859 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8860 | 0 \ | 
|  | 8861 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8862 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8863 | -S "selected srtp profile" \ | 
|  | 8864 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8865 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8866 | -c "client hello, adding use_srtp extension" \ | 
|  | 8867 | -C "found use_srtp extension" \ | 
|  | 8868 | -C "found srtp profile" \ | 
|  | 8869 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8870 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8871 | -C "error" | 
|  | 8872 |  | 
|  | 8873 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8874 | run_test  "DTLS-SRTP server doesn't support use_srtp extension." \ | 
|  | 8875 | "$P_SRV dtls=1 debug_level=3" \ | 
|  | 8876 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8877 | 0 \ | 
|  | 8878 | -s "found use_srtp extension" \ | 
|  | 8879 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8880 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8881 | -c "client hello, adding use_srtp extension" \ | 
|  | 8882 | -C "found use_srtp extension" \ | 
|  | 8883 | -C "found srtp profile" \ | 
|  | 8884 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8885 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8886 | -C "error" | 
|  | 8887 |  | 
|  | 8888 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8889 | run_test  "DTLS-SRTP all profiles supported. mki used" \ | 
|  | 8890 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ | 
|  | 8891 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 8892 | 0 \ | 
|  | 8893 | -s "found use_srtp extension" \ | 
|  | 8894 | -s "found srtp profile" \ | 
|  | 8895 | -s "selected srtp profile" \ | 
|  | 8896 | -s "server hello, adding use_srtp extension" \ | 
|  | 8897 | -s "dumping 'using mki' (8 bytes)" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8898 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8899 | -c "client hello, adding use_srtp extension" \ | 
|  | 8900 | -c "found use_srtp extension" \ | 
|  | 8901 | -c "found srtp profile" \ | 
|  | 8902 | -c "selected srtp profile" \ | 
|  | 8903 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 8904 | -c "dumping 'received mki' (8 bytes)" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8905 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8906 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8907 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8908 | -C "error" | 
|  | 8909 |  | 
|  | 8910 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8911 | run_test  "DTLS-SRTP all profiles supported. server doesn't support mki." \ | 
|  | 8912 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 8913 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 8914 | 0 \ | 
|  | 8915 | -s "found use_srtp extension" \ | 
|  | 8916 | -s "found srtp profile" \ | 
|  | 8917 | -s "selected srtp profile" \ | 
|  | 8918 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8919 | -s "DTLS-SRTP key material is"\ | 
| Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8920 | -s "DTLS-SRTP no mki value negotiated"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8921 | -S "dumping 'using mki' (8 bytes)" \ | 
|  | 8922 | -c "client hello, adding use_srtp extension" \ | 
|  | 8923 | -c "found use_srtp extension" \ | 
|  | 8924 | -c "found srtp profile" \ | 
|  | 8925 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8926 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 8927 | -c "DTLS-SRTP no mki value negotiated"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8928 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 8929 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 8930 | -C "dumping 'received mki' (8 bytes)" \ | 
|  | 8931 | -C "error" | 
|  | 8932 |  | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8933 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8934 | run_test  "DTLS-SRTP all profiles supported. openssl client." \ | 
|  | 8935 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8936 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8937 | 0 \ | 
|  | 8938 | -s "found use_srtp extension" \ | 
|  | 8939 | -s "found srtp profile" \ | 
|  | 8940 | -s "selected srtp profile" \ | 
|  | 8941 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8942 | -s "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8943 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8944 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" | 
|  | 8945 |  | 
|  | 8946 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8947 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ | 
|  | 8948 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8949 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8950 | 0 \ | 
|  | 8951 | -s "found use_srtp extension" \ | 
|  | 8952 | -s "found srtp profile" \ | 
|  | 8953 | -s "selected srtp profile" \ | 
|  | 8954 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8955 | -s "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8956 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8957 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 8958 |  | 
|  | 8959 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8960 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ | 
|  | 8961 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8962 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8963 | 0 \ | 
|  | 8964 | -s "found use_srtp extension" \ | 
|  | 8965 | -s "found srtp profile" \ | 
|  | 8966 | -s "selected srtp profile" \ | 
|  | 8967 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8968 | -s "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8969 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8970 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 8971 |  | 
|  | 8972 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8973 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ | 
|  | 8974 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8975 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8976 | 0 \ | 
|  | 8977 | -s "found use_srtp extension" \ | 
|  | 8978 | -s "found srtp profile" \ | 
|  | 8979 | -s "selected srtp profile" \ | 
|  | 8980 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8981 | -s "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8982 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8983 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 8984 |  | 
|  | 8985 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8986 | run_test  "DTLS-SRTP server and Client support only one matching profile. openssl client." \ | 
|  | 8987 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 8988 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8989 | 0 \ | 
|  | 8990 | -s "found use_srtp extension" \ | 
|  | 8991 | -s "found srtp profile" \ | 
|  | 8992 | -s "selected srtp profile" \ | 
|  | 8993 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8994 | -s "DTLS-SRTP key material is"\ | 
| Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 8995 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8996 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" | 
|  | 8997 |  | 
|  | 8998 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 8999 | run_test  "DTLS-SRTP server and Client support only one different profile. openssl client." \ | 
|  | 9000 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9001 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9002 | 0 \ | 
|  | 9003 | -s "found use_srtp extension" \ | 
|  | 9004 | -s "found srtp profile" \ | 
|  | 9005 | -S "selected srtp profile" \ | 
|  | 9006 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9007 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9008 | -C "SRTP Extension negotiated, profile" | 
|  | 9009 |  | 
|  | 9010 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 9011 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ | 
|  | 9012 | "$P_SRV dtls=1 debug_level=3" \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9013 | "$O_CLI -dtls1 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9014 | 0 \ | 
|  | 9015 | -s "found use_srtp extension" \ | 
|  | 9016 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9017 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9018 | -C "SRTP Extension negotiated, profile" | 
|  | 9019 |  | 
|  | 9020 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 9021 | run_test  "DTLS-SRTP all profiles supported. openssl server" \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9022 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9023 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 9024 | 0 \ | 
|  | 9025 | -c "client hello, adding use_srtp extension" \ | 
|  | 9026 | -c "found use_srtp extension" \ | 
|  | 9027 | -c "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9028 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9029 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9030 | -C "error" | 
|  | 9031 |  | 
|  | 9032 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 9033 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9034 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9035 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 9036 | 0 \ | 
|  | 9037 | -c "client hello, adding use_srtp extension" \ | 
|  | 9038 | -c "found use_srtp extension" \ | 
|  | 9039 | -c "found srtp profile" \ | 
|  | 9040 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9041 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9042 | -C "error" | 
|  | 9043 |  | 
|  | 9044 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 9045 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9046 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9047 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 9048 | 0 \ | 
|  | 9049 | -c "client hello, adding use_srtp extension" \ | 
|  | 9050 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9051 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9052 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9053 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9054 | -C "error" | 
|  | 9055 |  | 
|  | 9056 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 9057 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9058 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9059 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 9060 | 0 \ | 
|  | 9061 | -c "client hello, adding use_srtp extension" \ | 
|  | 9062 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9063 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9064 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9065 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9066 | -C "error" | 
|  | 9067 |  | 
|  | 9068 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 9069 | run_test  "DTLS-SRTP server and Client support only one matching profile. openssl server." \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9070 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9071 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 9072 | 0 \ | 
|  | 9073 | -c "client hello, adding use_srtp extension" \ | 
|  | 9074 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9075 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9076 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9077 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9078 | -C "error" | 
|  | 9079 |  | 
|  | 9080 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 9081 | run_test  "DTLS-SRTP server and Client support only one different profile. openssl server." \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9082 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9083 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9084 | 0 \ | 
|  | 9085 | -c "client hello, adding use_srtp extension" \ | 
|  | 9086 | -C "found use_srtp extension" \ | 
|  | 9087 | -C "found srtp profile" \ | 
|  | 9088 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9089 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9090 | -C "error" | 
|  | 9091 |  | 
|  | 9092 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 9093 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ | 
|  | 9094 | "$O_SRV -dtls1" \ | 
|  | 9095 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 9096 | 0 \ | 
|  | 9097 | -c "client hello, adding use_srtp extension" \ | 
|  | 9098 | -C "found use_srtp extension" \ | 
|  | 9099 | -C "found srtp profile" \ | 
|  | 9100 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9101 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9102 | -C "error" | 
|  | 9103 |  | 
|  | 9104 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
|  | 9105 | run_test  "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ | 
| Johan Pascal | 39cfd3b | 2020-09-23 18:49:13 +0200 | [diff] [blame] | 9106 | "$O_SRV -dtls1 -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9107 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 9108 | 0 \ | 
|  | 9109 | -c "client hello, adding use_srtp extension" \ | 
|  | 9110 | -c "found use_srtp extension" \ | 
|  | 9111 | -c "found srtp profile" \ | 
|  | 9112 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9113 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 9114 | -c "DTLS-SRTP no mki value negotiated"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9115 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 9116 | -C "dumping 'received mki' (8 bytes)" \ | 
|  | 9117 | -C "error" | 
|  | 9118 |  | 
|  | 9119 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9120 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9121 | run_test  "DTLS-SRTP all profiles supported. gnutls client." \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9122 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 9123 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9124 | 0 \ | 
|  | 9125 | -s "found use_srtp extension" \ | 
|  | 9126 | -s "found srtp profile" \ | 
|  | 9127 | -s "selected srtp profile" \ | 
|  | 9128 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9129 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9130 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" | 
|  | 9131 |  | 
|  | 9132 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9133 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9134 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls client." \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9135 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 9136 | "$G_CLI -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9137 | 0 \ | 
|  | 9138 | -s "found use_srtp extension" \ | 
|  | 9139 | -s "found srtp profile" \ | 
|  | 9140 | -s "selected srtp profile" \ | 
|  | 9141 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9142 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9143 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" | 
|  | 9144 |  | 
|  | 9145 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9146 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9147 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls client." \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9148 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 9149 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9150 | 0 \ | 
|  | 9151 | -s "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9152 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 9153 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9154 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9155 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9156 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" | 
|  | 9157 |  | 
|  | 9158 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9159 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9160 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls client." \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9161 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9162 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9163 | 0 \ | 
|  | 9164 | -s "found use_srtp extension" \ | 
|  | 9165 | -s "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9166 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9167 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9168 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9169 | -c "SRTP profile: SRTP_NULL_SHA1_32" | 
|  | 9170 |  | 
|  | 9171 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9172 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9173 | run_test  "DTLS-SRTP server and Client support only one matching profile. gnutls client." \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9174 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 9175 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9176 | 0 \ | 
|  | 9177 | -s "found use_srtp extension" \ | 
|  | 9178 | -s "found srtp profile" \ | 
|  | 9179 | -s "selected srtp profile" \ | 
|  | 9180 | -s "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9181 | -s "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9182 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" | 
|  | 9183 |  | 
|  | 9184 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9185 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9186 | run_test  "DTLS-SRTP server and Client support only one different profile. gnutls client." \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9187 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ | 
|  | 9188 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9189 | 0 \ | 
|  | 9190 | -s "found use_srtp extension" \ | 
|  | 9191 | -s "found srtp profile" \ | 
|  | 9192 | -S "selected srtp profile" \ | 
|  | 9193 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9194 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9195 | -C "SRTP profile:" | 
|  | 9196 |  | 
|  | 9197 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9198 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9199 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. gnutls client" \ | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9200 | "$P_SRV dtls=1 debug_level=3" \ | 
|  | 9201 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9202 | 0 \ | 
|  | 9203 | -s "found use_srtp extension" \ | 
|  | 9204 | -S "server hello, adding use_srtp extension" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9205 | -S "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9206 | -C "SRTP profile:" | 
|  | 9207 |  | 
|  | 9208 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9209 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9210 | run_test  "DTLS-SRTP all profiles supported. gnutls server" \ | 
|  | 9211 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ | 
|  | 9212 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 9213 | 0 \ | 
|  | 9214 | -c "client hello, adding use_srtp extension" \ | 
|  | 9215 | -c "found use_srtp extension" \ | 
|  | 9216 | -c "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9217 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9218 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9219 | -C "error" | 
|  | 9220 |  | 
|  | 9221 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9222 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9223 | run_test  "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ | 
|  | 9224 | "$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ | 
|  | 9225 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 9226 | 0 \ | 
|  | 9227 | -c "client hello, adding use_srtp extension" \ | 
|  | 9228 | -c "found use_srtp extension" \ | 
|  | 9229 | -c "found srtp profile" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9230 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9231 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9232 | -C "error" | 
|  | 9233 |  | 
|  | 9234 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9235 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9236 | run_test  "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ | 
|  | 9237 | "$G_SRV -u --srtp-profiles=SRTP_NULL_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_AES128_CM_HMAC_SHA1_80:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ | 
|  | 9238 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 9239 | 0 \ | 
|  | 9240 | -c "client hello, adding use_srtp extension" \ | 
|  | 9241 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9242 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9243 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9244 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9245 | -C "error" | 
|  | 9246 |  | 
|  | 9247 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9248 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9249 | run_test  "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ | 
|  | 9250 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9251 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9252 | 0 \ | 
|  | 9253 | -c "client hello, adding use_srtp extension" \ | 
|  | 9254 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9255 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9256 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9257 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9258 | -C "error" | 
|  | 9259 |  | 
|  | 9260 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9261 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9262 | run_test  "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ | 
|  | 9263 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ | 
|  | 9264 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ | 
|  | 9265 | 0 \ | 
|  | 9266 | -c "client hello, adding use_srtp extension" \ | 
|  | 9267 | -c "found use_srtp extension" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9268 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9269 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9270 | -c "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9271 | -C "error" | 
|  | 9272 |  | 
|  | 9273 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9274 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9275 | run_test  "DTLS-SRTP server and Client support only one different profile. gnutls server." \ | 
|  | 9276 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ | 
| Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 9277 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9278 | 0 \ | 
|  | 9279 | -c "client hello, adding use_srtp extension" \ | 
|  | 9280 | -C "found use_srtp extension" \ | 
|  | 9281 | -C "found srtp profile" \ | 
|  | 9282 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9283 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9284 | -C "error" | 
|  | 9285 |  | 
|  | 9286 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9287 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9288 | run_test  "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ | 
|  | 9289 | "$G_SRV -u" \ | 
|  | 9290 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ | 
|  | 9291 | 0 \ | 
|  | 9292 | -c "client hello, adding use_srtp extension" \ | 
|  | 9293 | -C "found use_srtp extension" \ | 
|  | 9294 | -C "found srtp profile" \ | 
|  | 9295 | -C "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9296 | -C "DTLS-SRTP key material is"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9297 | -C "error" | 
|  | 9298 |  | 
|  | 9299 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP | 
| Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 9300 | requires_gnutls | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9301 | run_test  "DTLS-SRTP all profiles supported. mki used. gnutls server." \ | 
|  | 9302 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32" \ | 
|  | 9303 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ | 
|  | 9304 | 0 \ | 
|  | 9305 | -c "client hello, adding use_srtp extension" \ | 
|  | 9306 | -c "found use_srtp extension" \ | 
|  | 9307 | -c "found srtp profile" \ | 
|  | 9308 | -c "selected srtp profile" \ | 
| Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 9309 | -c "DTLS-SRTP key material is"\ | 
| Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 9310 | -c "DTLS-SRTP mki value:"\ | 
| Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 9311 | -c "dumping 'sending mki' (8 bytes)" \ | 
|  | 9312 | -c "dumping 'received mki' (8 bytes)" \ | 
|  | 9313 | -C "error" | 
|  | 9314 |  | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9315 | # Tests for specific things with "unreliable" UDP connection | 
|  | 9316 |  | 
|  | 9317 | not_with_valgrind # spurious resend due to timeout | 
|  | 9318 | run_test    "DTLS proxy: reference" \ | 
|  | 9319 | -p "$P_PXY" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9320 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ | 
|  | 9321 | "$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] | 9322 | 0 \ | 
|  | 9323 | -C "replayed record" \ | 
|  | 9324 | -S "replayed record" \ | 
| Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 9325 | -C "Buffer record from epoch" \ | 
|  | 9326 | -S "Buffer record from epoch" \ | 
|  | 9327 | -C "ssl_buffer_message" \ | 
|  | 9328 | -S "ssl_buffer_message" \ | 
| Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 9329 | -C "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9330 | -S "discarding invalid record" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9331 | -S "resend" \ | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9332 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 9333 | -c "HTTP/1.0 200 OK" | 
|  | 9334 |  | 
|  | 9335 | not_with_valgrind # spurious resend due to timeout | 
| Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 9336 | run_test    "DTLS proxy: duplicate every packet" \ | 
|  | 9337 | -p "$P_PXY duplicate=1" \ | 
| Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 9338 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ | 
|  | 9339 | "$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] | 9340 | 0 \ | 
|  | 9341 | -c "replayed record" \ | 
|  | 9342 | -s "replayed record" \ | 
|  | 9343 | -c "record from another epoch" \ | 
|  | 9344 | -s "record from another epoch" \ | 
|  | 9345 | -S "resend" \ | 
|  | 9346 | -s "Extra-header:" \ | 
|  | 9347 | -c "HTTP/1.0 200 OK" | 
|  | 9348 |  | 
|  | 9349 | run_test    "DTLS proxy: duplicate every packet, server anti-replay off" \ | 
|  | 9350 | -p "$P_PXY duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9351 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ | 
|  | 9352 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9353 | 0 \ | 
|  | 9354 | -c "replayed record" \ | 
|  | 9355 | -S "replayed record" \ | 
|  | 9356 | -c "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9357 | -s "record from another epoch" \ | 
|  | 9358 | -c "resend" \ | 
|  | 9359 | -s "resend" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9360 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9361 | -c "HTTP/1.0 200 OK" | 
|  | 9362 |  | 
|  | 9363 | run_test    "DTLS proxy: multiple records in same datagram" \ | 
|  | 9364 | -p "$P_PXY pack=50" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9365 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 9366 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 9367 | 0 \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9368 | -c "next record in same datagram" \ | 
|  | 9369 | -s "next record in same datagram" | 
|  | 9370 |  | 
|  | 9371 | run_test    "DTLS proxy: multiple records in same datagram, duplicate every packet" \ | 
|  | 9372 | -p "$P_PXY pack=50 duplicate=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9373 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ | 
|  | 9374 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9375 | 0 \ | 
|  | 9376 | -c "next record in same datagram" \ | 
|  | 9377 | -s "next record in same datagram" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9378 |  | 
| Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 9379 | run_test    "DTLS proxy: inject invalid AD record, default badmac_limit" \ | 
|  | 9380 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9381 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ | 
|  | 9382 | "$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] | 9383 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9384 | -c "discarding invalid record (mac)" \ | 
|  | 9385 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9386 | -s "Extra-header:" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9387 | -c "HTTP/1.0 200 OK" \ | 
|  | 9388 | -S "too many records with bad MAC" \ | 
|  | 9389 | -S "Verification of the message MAC failed" | 
|  | 9390 |  | 
|  | 9391 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 1" \ | 
|  | 9392 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9393 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ | 
|  | 9394 | "$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] | 9395 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9396 | -C "discarding invalid record (mac)" \ | 
|  | 9397 | -S "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9398 | -S "Extra-header:" \ | 
|  | 9399 | -C "HTTP/1.0 200 OK" \ | 
|  | 9400 | -s "too many records with bad MAC" \ | 
|  | 9401 | -s "Verification of the message MAC failed" | 
|  | 9402 |  | 
|  | 9403 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2" \ | 
|  | 9404 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9405 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ | 
|  | 9406 | "$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] | 9407 | 0 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9408 | -c "discarding invalid record (mac)" \ | 
|  | 9409 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9410 | -s "Extra-header:" \ | 
|  | 9411 | -c "HTTP/1.0 200 OK" \ | 
|  | 9412 | -S "too many records with bad MAC" \ | 
|  | 9413 | -S "Verification of the message MAC failed" | 
|  | 9414 |  | 
|  | 9415 | run_test    "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ | 
|  | 9416 | -p "$P_PXY bad_ad=1" \ | 
| Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 9417 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ | 
|  | 9418 | "$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] | 9419 | 1 \ | 
| Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 9420 | -c "discarding invalid record (mac)" \ | 
|  | 9421 | -s "discarding invalid record (mac)" \ | 
| Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 9422 | -s "Extra-header:" \ | 
|  | 9423 | -c "HTTP/1.0 200 OK" \ | 
|  | 9424 | -s "too many records with bad MAC" \ | 
|  | 9425 | -s "Verification of the message MAC failed" | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9426 |  | 
|  | 9427 | run_test    "DTLS proxy: delay ChangeCipherSpec" \ | 
|  | 9428 | -p "$P_PXY delay_ccs=1" \ | 
| Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 9429 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ | 
|  | 9430 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9431 | 0 \ | 
|  | 9432 | -c "record from another epoch" \ | 
|  | 9433 | -s "record from another epoch" \ | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9434 | -s "Extra-header:" \ | 
|  | 9435 | -c "HTTP/1.0 200 OK" | 
|  | 9436 |  | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9437 | # Tests for reordering support with DTLS | 
|  | 9438 |  | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9439 | run_test    "DTLS reordering: Buffer out-of-order handshake message on client" \ | 
|  | 9440 | -p "$P_PXY delay_srv=ServerHello" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9441 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9442 | hs_timeout=2500-60000" \ | 
|  | 9443 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9444 | hs_timeout=2500-60000" \ | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9445 | 0 \ | 
|  | 9446 | -c "Buffering HS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9447 | -c "Next handshake message has been buffered - load"\ | 
|  | 9448 | -S "Buffering HS message" \ | 
|  | 9449 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9450 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9451 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9452 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9453 | -S "Remember CCS message" | 
| Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 9454 |  | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9455 | run_test    "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ | 
|  | 9456 | -p "$P_PXY delay_srv=ServerHello" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9457 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9458 | hs_timeout=2500-60000" \ | 
|  | 9459 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9460 | hs_timeout=2500-60000" \ | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9461 | 0 \ | 
|  | 9462 | -c "Buffering HS message" \ | 
|  | 9463 | -c "found fragmented DTLS handshake message"\ | 
|  | 9464 | -c "Next handshake message 1 not or only partially bufffered" \ | 
|  | 9465 | -c "Next handshake message has been buffered - load"\ | 
|  | 9466 | -S "Buffering HS message" \ | 
|  | 9467 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9468 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 9469 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9470 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 9471 | -S "Remember CCS message" | 
|  | 9472 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9473 | # The client buffers the ServerKeyExchange before receiving the fragmented | 
|  | 9474 | # Certificate message; at the time of writing, together these are aroudn 1200b | 
|  | 9475 | # in size, so that the bound below ensures that the certificate can be reassembled | 
|  | 9476 | # while keeping the ServerKeyExchange. | 
|  | 9477 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 | 
|  | 9478 | 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] | 9479 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9480 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9481 | hs_timeout=2500-60000" \ | 
|  | 9482 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9483 | hs_timeout=2500-60000" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9484 | 0 \ | 
|  | 9485 | -c "Buffering HS message" \ | 
|  | 9486 | -c "Next handshake message has been buffered - load"\ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9487 | -C "attempt to make space by freeing buffered messages" \ | 
|  | 9488 | -S "Buffering HS message" \ | 
|  | 9489 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9490 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9491 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9492 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9493 | -S "Remember CCS message" | 
|  | 9494 |  | 
|  | 9495 | # The size constraints ensure that the delayed certificate message can't | 
|  | 9496 | # be reassembled while keeping the ServerKeyExchange message, but it can | 
|  | 9497 | # when dropping it first. | 
|  | 9498 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 | 
|  | 9499 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 | 
|  | 9500 | run_test    "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ | 
|  | 9501 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9502 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9503 | hs_timeout=2500-60000" \ | 
|  | 9504 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9505 | hs_timeout=2500-60000" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9506 | 0 \ | 
|  | 9507 | -c "Buffering HS message" \ | 
|  | 9508 | -c "attempt to make space by freeing buffered future messages" \ | 
|  | 9509 | -c "Enough space available after freeing buffered HS messages" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9510 | -S "Buffering HS message" \ | 
|  | 9511 | -S "Next handshake message has been buffered - load"\ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9512 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9513 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9514 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 9515 | -S "Remember CCS message" | 
|  | 9516 |  | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9517 | run_test    "DTLS reordering: Buffer out-of-order handshake message on server" \ | 
|  | 9518 | -p "$P_PXY delay_cli=Certificate" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9519 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ | 
|  | 9520 | hs_timeout=2500-60000" \ | 
|  | 9521 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9522 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9523 | 0 \ | 
|  | 9524 | -C "Buffering HS message" \ | 
|  | 9525 | -C "Next handshake message has been buffered - load"\ | 
|  | 9526 | -s "Buffering HS message" \ | 
|  | 9527 | -s "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9528 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9529 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9530 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9531 | -S "Remember CCS message" | 
|  | 9532 |  | 
|  | 9533 | run_test    "DTLS reordering: Buffer out-of-order CCS message on client"\ | 
|  | 9534 | -p "$P_PXY delay_srv=NewSessionTicket" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9535 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9536 | hs_timeout=2500-60000" \ | 
|  | 9537 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9538 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9539 | 0 \ | 
|  | 9540 | -C "Buffering HS message" \ | 
|  | 9541 | -C "Next handshake message has been buffered - load"\ | 
|  | 9542 | -S "Buffering HS message" \ | 
|  | 9543 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9544 | -c "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9545 | -c "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9546 | -S "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9547 | -S "Remember CCS message" | 
|  | 9548 |  | 
|  | 9549 | run_test    "DTLS reordering: Buffer out-of-order CCS message on server"\ | 
|  | 9550 | -p "$P_PXY delay_cli=ClientKeyExchange" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9551 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9552 | hs_timeout=2500-60000" \ | 
|  | 9553 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9554 | hs_timeout=2500-60000" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9555 | 0 \ | 
|  | 9556 | -C "Buffering HS message" \ | 
|  | 9557 | -C "Next handshake message has been buffered - load"\ | 
|  | 9558 | -S "Buffering HS message" \ | 
|  | 9559 | -S "Next handshake message has been buffered - load" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9560 | -C "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9561 | -C "Remember CCS message" \ | 
| Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 9562 | -s "Injecting buffered CCS message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9563 | -s "Remember CCS message" | 
|  | 9564 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9565 | run_test    "DTLS reordering: Buffer encrypted Finished message" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9566 | -p "$P_PXY delay_ccs=1" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9567 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ | 
|  | 9568 | hs_timeout=2500-60000" \ | 
|  | 9569 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ | 
|  | 9570 | hs_timeout=2500-60000" \ | 
| Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 9571 | 0 \ | 
|  | 9572 | -s "Buffer record from epoch 1" \ | 
| Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 9573 | -s "Found buffered record from current epoch - load" \ | 
|  | 9574 | -c "Buffer record from epoch 1" \ | 
|  | 9575 | -c "Found buffered record from current epoch - load" | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9576 |  | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9577 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec | 
|  | 9578 | # from the server are delayed, so that the encrypted Finished message | 
|  | 9579 | # is received and buffered. When the fragmented NewSessionTicket comes | 
|  | 9580 | # in afterwards, the encrypted Finished message must be freed in order | 
|  | 9581 | # to make space for the NewSessionTicket to be reassembled. | 
|  | 9582 | # This works only in very particular circumstances: | 
|  | 9583 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering | 
|  | 9584 | #   of the NewSessionTicket, but small enough to also allow buffering of | 
|  | 9585 | #   the encrypted Finished message. | 
|  | 9586 | # - The MTU setting on the server must be so small that the NewSessionTicket | 
|  | 9587 | #   needs to be fragmented. | 
|  | 9588 | # - All messages sent by the server must be small enough to be either sent | 
|  | 9589 | #   without fragmentation or be reassembled within the bounds of | 
|  | 9590 | #   MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based | 
|  | 9591 | #   handshake, omitting CRTs. | 
| Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9592 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 | 
|  | 9593 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9594 | run_test    "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ | 
|  | 9595 | -p "$P_PXY delay_srv=NewSessionTicket delay_srv=NewSessionTicket delay_ccs=1" \ | 
| Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 9596 | "$P_SRV mtu=140 response_size=90 dgram_packing=0 psk=abc123 psk_identity=foo cookies=0 dtls=1 debug_level=2" \ | 
| Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 9597 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ | 
|  | 9598 | 0 \ | 
|  | 9599 | -s "Buffer record from epoch 1" \ | 
|  | 9600 | -s "Found buffered record from current epoch - load" \ | 
|  | 9601 | -c "Buffer record from epoch 1" \ | 
|  | 9602 | -C "Found buffered record from current epoch - load" \ | 
|  | 9603 | -c "Enough space available after freeing future epoch record" | 
|  | 9604 |  | 
| Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 9605 | # Tests for "randomly unreliable connection": try a variety of flows and peers | 
|  | 9606 |  | 
|  | 9607 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 9608 | run_test    "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ | 
|  | 9609 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9610 | "$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] | 9611 | psk=abc123" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9612 | "$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] | 9613 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9614 | 0 \ | 
|  | 9615 | -s "Extra-header:" \ | 
|  | 9616 | -c "HTTP/1.0 200 OK" | 
|  | 9617 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9618 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9619 | run_test    "DTLS proxy: 3d, \"short\" RSA handshake" \ | 
|  | 9620 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9621 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ | 
|  | 9622 | "$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] | 9623 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ | 
|  | 9624 | 0 \ | 
|  | 9625 | -s "Extra-header:" \ | 
|  | 9626 | -c "HTTP/1.0 200 OK" | 
|  | 9627 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9628 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9629 | run_test    "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ | 
|  | 9630 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9631 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ | 
|  | 9632 | "$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] | 9633 | 0 \ | 
|  | 9634 | -s "Extra-header:" \ | 
|  | 9635 | -c "HTTP/1.0 200 OK" | 
|  | 9636 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9637 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9638 | run_test    "DTLS proxy: 3d, FS, client auth" \ | 
|  | 9639 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9640 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ | 
|  | 9641 | "$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] | 9642 | 0 \ | 
|  | 9643 | -s "Extra-header:" \ | 
|  | 9644 | -c "HTTP/1.0 200 OK" | 
|  | 9645 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9646 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9647 | run_test    "DTLS proxy: 3d, FS, ticket" \ | 
|  | 9648 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9649 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ | 
|  | 9650 | "$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] | 9651 | 0 \ | 
|  | 9652 | -s "Extra-header:" \ | 
|  | 9653 | -c "HTTP/1.0 200 OK" | 
|  | 9654 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9655 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 9656 | run_test    "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ | 
|  | 9657 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9658 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ | 
|  | 9659 | "$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] | 9660 | 0 \ | 
|  | 9661 | -s "Extra-header:" \ | 
|  | 9662 | -c "HTTP/1.0 200 OK" | 
|  | 9663 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9664 | client_needs_more_time 2 | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9665 | run_test    "DTLS proxy: 3d, max handshake, nbio" \ | 
|  | 9666 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9667 | "$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] | 9668 | auth_mode=required" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9669 | "$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] | 9670 | 0 \ | 
|  | 9671 | -s "Extra-header:" \ | 
|  | 9672 | -c "HTTP/1.0 200 OK" | 
|  | 9673 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9674 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 9675 | run_test    "DTLS proxy: 3d, min handshake, resumption" \ | 
|  | 9676 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9677 | "$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] | 9678 | psk=abc123 debug_level=3" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9679 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 9680 | 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] | 9681 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9682 | 0 \ | 
|  | 9683 | -s "a session has been resumed" \ | 
|  | 9684 | -c "a session has been resumed" \ | 
|  | 9685 | -s "Extra-header:" \ | 
|  | 9686 | -c "HTTP/1.0 200 OK" | 
|  | 9687 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9688 | client_needs_more_time 4 | 
| Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 9689 | run_test    "DTLS proxy: 3d, min handshake, resumption, nbio" \ | 
|  | 9690 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9691 | "$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] | 9692 | psk=abc123 debug_level=3 nbio=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9693 | "$P_CLI dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 psk=abc123 \ | 
| Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 9694 | 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] | 9695 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ | 
|  | 9696 | 0 \ | 
|  | 9697 | -s "a session has been resumed" \ | 
|  | 9698 | -c "a session has been resumed" \ | 
|  | 9699 | -s "Extra-header:" \ | 
|  | 9700 | -c "HTTP/1.0 200 OK" | 
|  | 9701 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9702 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9703 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9704 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego" \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9705 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9706 | "$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] | 9707 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9708 | "$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] | 9709 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 9710 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9711 | 0 \ | 
|  | 9712 | -c "=> renegotiate" \ | 
|  | 9713 | -s "=> renegotiate" \ | 
|  | 9714 | -s "Extra-header:" \ | 
|  | 9715 | -c "HTTP/1.0 200 OK" | 
|  | 9716 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9717 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9718 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9719 | run_test    "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ | 
|  | 9720 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9721 | "$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] | 9722 | psk=abc123 renegotiation=1 debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9723 | "$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] | 9724 | renegotiate=1 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9725 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9726 | 0 \ | 
|  | 9727 | -c "=> renegotiate" \ | 
|  | 9728 | -s "=> renegotiate" \ | 
|  | 9729 | -s "Extra-header:" \ | 
|  | 9730 | -c "HTTP/1.0 200 OK" | 
|  | 9731 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9732 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9733 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9734 | run_test    "DTLS proxy: 3d, min handshake, server-initiated renego" \ | 
| Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 9735 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9736 | "$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] | 9737 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9738 | debug_level=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9739 | "$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] | 9740 | renegotiation=1 exchanges=4 debug_level=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9741 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9742 | 0 \ | 
|  | 9743 | -c "=> renegotiate" \ | 
|  | 9744 | -s "=> renegotiate" \ | 
|  | 9745 | -s "Extra-header:" \ | 
|  | 9746 | -c "HTTP/1.0 200 OK" | 
|  | 9747 |  | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9748 | client_needs_more_time 4 | 
| Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 9749 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9750 | 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] | 9751 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9752 | "$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] | 9753 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9754 | debug_level=2 nbio=2" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9755 | "$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] | 9756 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ | 
| Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 9757 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ | 
|  | 9758 | 0 \ | 
|  | 9759 | -c "=> renegotiate" \ | 
|  | 9760 | -s "=> renegotiate" \ | 
|  | 9761 | -s "Extra-header:" \ | 
|  | 9762 | -c "HTTP/1.0 200 OK" | 
|  | 9763 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9764 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including | 
|  | 9765 | ## all versions installed on the CI machines), reported here: | 
|  | 9766 | ## Bug report: https://github.com/openssl/openssl/issues/6902 | 
|  | 9767 | ## They should be re-enabled once a fixed version of OpenSSL is available | 
|  | 9768 | ## (this should happen in some 1.1.1_ release according to the ticket). | 
|  | 9769 | skip_next_test | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9770 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9771 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9772 | run_test    "DTLS proxy: 3d, openssl server" \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9773 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 9774 | "$O_SRV -dtls1 -mtu 2048" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9775 | "$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] | 9776 | 0 \ | 
| Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 9777 | -c "HTTP/1.0 200 OK" | 
|  | 9778 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9779 | skip_next_test # see above | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9780 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9781 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9782 | run_test    "DTLS proxy: 3d, openssl server, fragmentation" \ | 
|  | 9783 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 9784 | "$O_SRV -dtls1 -mtu 768" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9785 | "$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] | 9786 | 0 \ | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9787 | -c "HTTP/1.0 200 OK" | 
|  | 9788 |  | 
| Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 9789 | skip_next_test # see above | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9790 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9791 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9792 | run_test    "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ | 
|  | 9793 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ | 
|  | 9794 | "$O_SRV -dtls1 -mtu 768" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9795 | "$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] | 9796 | 0 \ | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9797 | -c "HTTP/1.0 200 OK" | 
|  | 9798 |  | 
| Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 9799 | requires_gnutls | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9800 | client_needs_more_time 6 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9801 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9802 | run_test    "DTLS proxy: 3d, gnutls server" \ | 
|  | 9803 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
|  | 9804 | "$G_SRV -u --mtu 2048 -a" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9805 | "$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] | 9806 | 0 \ | 
|  | 9807 | -s "Extra-header:" \ | 
|  | 9808 | -c "Extra-header:" | 
|  | 9809 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9810 | requires_gnutls_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9811 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9812 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 9813 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation" \ | 
|  | 9814 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9815 | "$G_NEXT_SRV -u --mtu 512" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9816 | "$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] | 9817 | 0 \ | 
|  | 9818 | -s "Extra-header:" \ | 
|  | 9819 | -c "Extra-header:" | 
|  | 9820 |  | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9821 | requires_gnutls_next | 
| Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 9822 | client_needs_more_time 8 | 
| Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 9823 | not_with_valgrind # risk of non-mbedtls peer timing out | 
| Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 9824 | run_test    "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ | 
|  | 9825 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ | 
| k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 9826 | "$G_NEXT_SRV -u --mtu 512" \ | 
| Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 9827 | "$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] | 9828 | 0 \ | 
|  | 9829 | -s "Extra-header:" \ | 
|  | 9830 | -c "Extra-header:" | 
|  | 9831 |  | 
| Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9832 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS | 
|  | 9833 | run_test    "export keys functionality" \ | 
|  | 9834 | "$P_SRV eap_tls=1 debug_level=3" \ | 
|  | 9835 | "$P_CLI eap_tls=1 debug_level=3" \ | 
|  | 9836 | 0 \ | 
|  | 9837 | -s "exported maclen is " \ | 
|  | 9838 | -s "exported keylen is " \ | 
|  | 9839 | -s "exported ivlen is "  \ | 
|  | 9840 | -c "exported maclen is " \ | 
|  | 9841 | -c "exported keylen is " \ | 
| Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 9842 | -c "exported ivlen is " \ | 
|  | 9843 | -c "EAP-TLS key material is:"\ | 
|  | 9844 | -s "EAP-TLS key material is:"\ | 
|  | 9845 | -c "EAP-TLS IV is:" \ | 
|  | 9846 | -s "EAP-TLS IV is:" | 
| Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 9847 |  | 
| Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 9848 | # Test heap memory usage after handshake | 
|  | 9849 | requires_config_enabled MBEDTLS_MEMORY_DEBUG | 
|  | 9850 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C | 
|  | 9851 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH | 
|  | 9852 | run_tests_memory_after_hanshake | 
|  | 9853 |  | 
| Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 9854 | # Final report | 
|  | 9855 |  | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9856 | echo "------------------------------------------------------------------------" | 
|  | 9857 |  | 
|  | 9858 | if [ $FAILS = 0 ]; then | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9859 | printf "PASSED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9860 | else | 
| Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 9861 | printf "FAILED" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9862 | fi | 
| Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 9863 | PASSES=$(( $TESTS - $FAILS )) | 
| Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 9864 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" | 
| Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 9865 |  | 
|  | 9866 | exit $FAILS |