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 | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 117 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 118 | printf " -e|--exclude\tMatching tests are excluded (substring or 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 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 181 | # Read boolean configuration options from config.h for easy and quick |
| 182 | # testing. Skip non-boolean options (with something other than spaces |
| 183 | # and a comment after "#define SYMBOL"). The variable contains a |
| 184 | # space-separated list of symbols. |
| 185 | CONFIGS_ENABLED=" $(<"$CONFIG_H" \ |
| 186 | sed -n 's!^ *#define *\([A-Za-z][0-9A-Z_a-z]*\) *\(/*\)*!\1!p' | |
| 187 | tr '\n' ' ')" |
| 188 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 189 | # Skip next test; use this macro to skip tests which are legitimate |
| 190 | # in theory and expected to be re-introduced at some point, but |
| 191 | # aren't expected to succeed at the moment due to problems outside |
| 192 | # our control (such as bugs in other TLS implementations). |
| 193 | skip_next_test() { |
| 194 | SKIP_NEXT="YES" |
| 195 | } |
| 196 | |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 197 | # skip next test if the flag is not enabled in config.h |
| 198 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 199 | case $CONFIGS_ENABLED in |
| 200 | *" $1 "*) :;; |
| 201 | *) SKIP_NEXT="YES";; |
| 202 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 203 | } |
| 204 | |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 205 | # skip next test if the flag is enabled in config.h |
| 206 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 207 | case $CONFIGS_ENABLED in |
| 208 | *" $1 "*) SKIP_NEXT="YES";; |
| 209 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 210 | } |
| 211 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 212 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 213 | # This function uses the query_config command line option to query the |
| 214 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 215 | # program. The command will always return a success value if the |
| 216 | # configuration is defined and the value will be printed to stdout. |
| 217 | # |
| 218 | # Note that if the configuration is not defined or is defined to nothing, |
| 219 | # the output of this function will be an empty string. |
| 220 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 224 | VAL="$( get_config_value_or_default "$1" )" |
| 225 | if [ -z "$VAL" ]; then |
| 226 | # Should never happen |
| 227 | echo "Mbed TLS configuration $1 is not defined" |
| 228 | exit 1 |
| 229 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 230 | SKIP_NEXT="YES" |
| 231 | fi |
| 232 | } |
| 233 | |
| 234 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 235 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 236 | if [ -z "$VAL" ]; then |
| 237 | # Should never happen |
| 238 | echo "Mbed TLS configuration $1 is not defined" |
| 239 | exit 1 |
| 240 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 241 | SKIP_NEXT="YES" |
| 242 | fi |
| 243 | } |
| 244 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 245 | # Space-separated list of ciphersuites supported by this build of |
| 246 | # Mbed TLS. |
| 247 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
| 248 | grep TLS- | |
| 249 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 250 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 251 | case $P_CIPHERSUITES in |
| 252 | *" $1 "*) :;; |
| 253 | *) SKIP_NEXT="YES";; |
| 254 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 255 | } |
| 256 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 257 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 258 | # If CMD (call to a TLS client or server program) requires a specific |
| 259 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
| 260 | # enabled. As an exception, do run the test case if it expects a ciphersuite |
| 261 | # mismatch. |
| 262 | maybe_requires_ciphersuite_enabled() { |
| 263 | case "$1" in |
| 264 | *\ force_ciphersuite=*) :;; |
| 265 | *) return;; # No specific required ciphersuite |
| 266 | esac |
| 267 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 268 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 269 | shift |
| 270 | |
| 271 | case "$*" in |
| 272 | *"-s SSL - The server has no ciphersuites in common"*) |
| 273 | # This test case expects a ciphersuite mismatch, so it doesn't |
| 274 | # require the ciphersuite to be enabled. |
| 275 | ;; |
| 276 | *) |
| 277 | requires_ciphersuite_enabled "$ciphersuite" |
| 278 | ;; |
| 279 | esac |
| 280 | |
| 281 | unset ciphersuite |
| 282 | } |
| 283 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 284 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 285 | requires_openssl_with_fallback_scsv() { |
| 286 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 287 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 288 | then |
| 289 | OPENSSL_HAS_FBSCSV="YES" |
| 290 | else |
| 291 | OPENSSL_HAS_FBSCSV="NO" |
| 292 | fi |
| 293 | fi |
| 294 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 295 | SKIP_NEXT="YES" |
| 296 | fi |
| 297 | } |
| 298 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 299 | # skip next test if GnuTLS isn't available |
| 300 | requires_gnutls() { |
| 301 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 302 | 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] | 303 | GNUTLS_AVAILABLE="YES" |
| 304 | else |
| 305 | GNUTLS_AVAILABLE="NO" |
| 306 | fi |
| 307 | fi |
| 308 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 309 | SKIP_NEXT="YES" |
| 310 | fi |
| 311 | } |
| 312 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 313 | # skip next test if GnuTLS-next isn't available |
| 314 | requires_gnutls_next() { |
| 315 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 316 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 317 | GNUTLS_NEXT_AVAILABLE="YES" |
| 318 | else |
| 319 | GNUTLS_NEXT_AVAILABLE="NO" |
| 320 | fi |
| 321 | fi |
| 322 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 323 | SKIP_NEXT="YES" |
| 324 | fi |
| 325 | } |
| 326 | |
| 327 | # skip next test if OpenSSL-legacy isn't available |
| 328 | requires_openssl_legacy() { |
| 329 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 330 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 331 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 332 | else |
| 333 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 334 | fi |
| 335 | fi |
| 336 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 337 | SKIP_NEXT="YES" |
| 338 | fi |
| 339 | } |
| 340 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 341 | # skip next test if IPv6 isn't available on this host |
| 342 | requires_ipv6() { |
| 343 | if [ -z "${HAS_IPV6:-}" ]; then |
| 344 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 345 | SRV_PID=$! |
| 346 | sleep 1 |
| 347 | kill $SRV_PID >/dev/null 2>&1 |
| 348 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 349 | HAS_IPV6="NO" |
| 350 | else |
| 351 | HAS_IPV6="YES" |
| 352 | fi |
| 353 | rm -r $SRV_OUT |
| 354 | fi |
| 355 | |
| 356 | if [ "$HAS_IPV6" = "NO" ]; then |
| 357 | SKIP_NEXT="YES" |
| 358 | fi |
| 359 | } |
| 360 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 361 | # skip next test if it's i686 or uname is not available |
| 362 | requires_not_i686() { |
| 363 | if [ -z "${IS_I686:-}" ]; then |
| 364 | IS_I686="YES" |
| 365 | if which "uname" >/dev/null 2>&1; then |
| 366 | if [ -z "$(uname -a | grep i686)" ]; then |
| 367 | IS_I686="NO" |
| 368 | fi |
| 369 | fi |
| 370 | fi |
| 371 | if [ "$IS_I686" = "YES" ]; then |
| 372 | SKIP_NEXT="YES" |
| 373 | fi |
| 374 | } |
| 375 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 376 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 377 | MAX_CONTENT_LEN=16384 |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 378 | MAX_IN_LEN=$( ../scripts/config.py get MBEDTLS_SSL_IN_CONTENT_LEN || echo "$MAX_CONTENT_LEN") |
| 379 | 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] | 380 | |
| 381 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 382 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 383 | fi |
| 384 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 385 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 386 | fi |
| 387 | |
| 388 | # skip the next test if the SSL output buffer is less than 16KB |
| 389 | requires_full_size_output_buffer() { |
| 390 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 391 | SKIP_NEXT="YES" |
| 392 | fi |
| 393 | } |
| 394 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 395 | # skip the next test if valgrind is in use |
| 396 | not_with_valgrind() { |
| 397 | if [ "$MEMCHECK" -gt 0 ]; then |
| 398 | SKIP_NEXT="YES" |
| 399 | fi |
| 400 | } |
| 401 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 402 | # skip the next test if valgrind is NOT in use |
| 403 | only_with_valgrind() { |
| 404 | if [ "$MEMCHECK" -eq 0 ]; then |
| 405 | SKIP_NEXT="YES" |
| 406 | fi |
| 407 | } |
| 408 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 409 | # 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] | 410 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 411 | CLI_DELAY_FACTOR=$1 |
| 412 | } |
| 413 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 414 | # wait for the given seconds after the client finished in the next test |
| 415 | server_needs_more_time() { |
| 416 | SRV_DELAY_SECONDS=$1 |
| 417 | } |
| 418 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 419 | # print_name <name> |
| 420 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 421 | TESTS=$(( $TESTS + 1 )) |
| 422 | LINE="" |
| 423 | |
| 424 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 425 | LINE="$TESTS " |
| 426 | fi |
| 427 | |
| 428 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 429 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 430 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 431 | for i in `seq 1 $LEN`; do printf '.'; done |
| 432 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 433 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 434 | } |
| 435 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 436 | # record_outcome <outcome> [<failure-reason>] |
| 437 | # The test name must be in $NAME. |
| 438 | record_outcome() { |
| 439 | echo "$1" |
| 440 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 441 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 442 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 443 | "ssl-opt" "$NAME" \ |
| 444 | "$1" "${2-}" \ |
| 445 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 446 | fi |
| 447 | } |
| 448 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 449 | # fail <message> |
| 450 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 451 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 452 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 453 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 454 | mv $SRV_OUT o-srv-${TESTS}.log |
| 455 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 456 | if [ -n "$PXY_CMD" ]; then |
| 457 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 458 | fi |
| 459 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 460 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 461 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 462 | echo " ! server output:" |
| 463 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 464 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 465 | echo " ! client output:" |
| 466 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 467 | if [ -n "$PXY_CMD" ]; then |
| 468 | echo " ! ========================================================" |
| 469 | echo " ! proxy output:" |
| 470 | cat o-pxy-${TESTS}.log |
| 471 | fi |
| 472 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 473 | fi |
| 474 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 475 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 476 | } |
| 477 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 478 | # is_polar <cmd_line> |
| 479 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 480 | case "$1" in |
| 481 | *ssl_client2*) true;; |
| 482 | *ssl_server2*) true;; |
| 483 | *) false;; |
| 484 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 485 | } |
| 486 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 487 | # openssl s_server doesn't have -www with DTLS |
| 488 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 489 | case "$SRV_CMD" in |
| 490 | *s_server*-dtls*) |
| 491 | NEEDS_INPUT=1 |
| 492 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 493 | *) NEEDS_INPUT=0;; |
| 494 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 495 | } |
| 496 | |
| 497 | # provide input to commands that need it |
| 498 | provide_input() { |
| 499 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 500 | return |
| 501 | fi |
| 502 | |
| 503 | while true; do |
| 504 | echo "HTTP/1.0 200 OK" |
| 505 | sleep 1 |
| 506 | done |
| 507 | } |
| 508 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 509 | # has_mem_err <log_file_name> |
| 510 | has_mem_err() { |
| 511 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 512 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 513 | then |
| 514 | return 1 # false: does not have errors |
| 515 | else |
| 516 | return 0 # true: has errors |
| 517 | fi |
| 518 | } |
| 519 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 520 | # 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] | 521 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 522 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 523 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 524 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 525 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 526 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 527 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 528 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 529 | # Make a tight loop, server normally takes less than 1s to start. |
| 530 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 531 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 532 | echo "$3 START TIMEOUT" |
| 533 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 534 | break |
| 535 | fi |
| 536 | # Linux and *BSD support decimal arguments to sleep. On other |
| 537 | # OSes this may be a tight loop. |
| 538 | sleep 0.1 2>/dev/null || true |
| 539 | done |
| 540 | } |
| 541 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 542 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 543 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 544 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 545 | } |
| 546 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 547 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 548 | # Wait for server process $2 to be listening on port $1. |
| 549 | wait_server_start() { |
| 550 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 551 | } |
| 552 | |
| 553 | # Wait for proxy process $2 to be listening on port $1. |
| 554 | wait_proxy_start() { |
| 555 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 556 | } |
| 557 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 558 | # 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] | 559 | # 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] | 560 | # acceptable bounds |
| 561 | check_server_hello_time() { |
| 562 | # 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] | 563 | 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] | 564 | # Get the Unix timestamp for now |
| 565 | CUR_TIME=$(date +'%s') |
| 566 | THRESHOLD_IN_SECS=300 |
| 567 | |
| 568 | # Check if the ServerHello time was printed |
| 569 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 570 | return 1 |
| 571 | fi |
| 572 | |
| 573 | # Check the time in ServerHello is within acceptable bounds |
| 574 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 575 | # The time in ServerHello is at least 5 minutes before now |
| 576 | return 1 |
| 577 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 578 | # 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] | 579 | return 1 |
| 580 | else |
| 581 | return 0 |
| 582 | fi |
| 583 | } |
| 584 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 585 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 586 | handshake_memory_get() { |
| 587 | OUTPUT_VARIABLE="$1" |
| 588 | OUTPUT_FILE="$2" |
| 589 | |
| 590 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 591 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 592 | |
| 593 | # Check if memory usage was read |
| 594 | if [ -z "$MEM_USAGE" ]; then |
| 595 | echo "Error: Can not read the value of handshake memory usage" |
| 596 | return 1 |
| 597 | else |
| 598 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 599 | return 0 |
| 600 | fi |
| 601 | } |
| 602 | |
| 603 | # Get handshake memory usage from server or client output and check if this value |
| 604 | # is not higher than the maximum given by the first argument |
| 605 | handshake_memory_check() { |
| 606 | MAX_MEMORY="$1" |
| 607 | OUTPUT_FILE="$2" |
| 608 | |
| 609 | # Get memory usage |
| 610 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 611 | return 1 |
| 612 | fi |
| 613 | |
| 614 | # Check if memory usage is below max value |
| 615 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 616 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 617 | "but should be below $MAX_MEMORY bytes" |
| 618 | return 1 |
| 619 | else |
| 620 | return 0 |
| 621 | fi |
| 622 | } |
| 623 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 624 | # wait for client to terminate and set CLI_EXIT |
| 625 | # must be called right after starting the client |
| 626 | wait_client_done() { |
| 627 | CLI_PID=$! |
| 628 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 629 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 630 | CLI_DELAY_FACTOR=1 |
| 631 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 632 | ( 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] | 633 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 634 | |
| 635 | wait $CLI_PID |
| 636 | CLI_EXIT=$? |
| 637 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 638 | kill $DOG_PID >/dev/null 2>&1 |
| 639 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 640 | |
| 641 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 642 | |
| 643 | sleep $SRV_DELAY_SECONDS |
| 644 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 645 | } |
| 646 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 647 | # check if the given command uses dtls and sets global variable DTLS |
| 648 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 649 | case "$1" in |
| 650 | *dtls=1*|-dtls|-u) DTLS=1;; |
| 651 | *) DTLS=0;; |
| 652 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 653 | } |
| 654 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 655 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 656 | is_gnutls() { |
| 657 | case "$1" in |
| 658 | *gnutls-cli*) |
| 659 | CMD_IS_GNUTLS=1 |
| 660 | ;; |
| 661 | *gnutls-serv*) |
| 662 | CMD_IS_GNUTLS=1 |
| 663 | ;; |
| 664 | *) |
| 665 | CMD_IS_GNUTLS=0 |
| 666 | ;; |
| 667 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 668 | } |
| 669 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 670 | # Compare file content |
| 671 | # Usage: find_in_both pattern file1 file2 |
| 672 | # extract from file1 the first line matching the pattern |
| 673 | # check in file2 that the same line can be found |
| 674 | find_in_both() { |
| 675 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 676 | if [ -z "$srv_pattern" ]; then |
| 677 | return 1; |
| 678 | fi |
| 679 | |
| 680 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 681 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 682 | else |
| 683 | return 1; |
| 684 | fi |
| 685 | } |
| 686 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 687 | # 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] | 688 | # Options: -s pattern pattern that must be present in server output |
| 689 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 690 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 691 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 692 | # -S pattern pattern that must be absent in server output |
| 693 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 694 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 695 | # -F call shell function on server output |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 696 | # -g call shell function on server and client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 697 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 698 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 699 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 700 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 701 | if is_excluded "$NAME"; then |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 702 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 703 | # 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] | 704 | return |
| 705 | fi |
| 706 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 707 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 708 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 709 | # Do we only run numbered tests? |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 710 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 711 | case ",$RUN_TEST_NUMBER," in |
| 712 | *",$TESTS,"*) :;; |
| 713 | *) SKIP_NEXT="YES";; |
| 714 | esac |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 715 | fi |
| 716 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 717 | # does this test use a proxy? |
| 718 | if [ "X$1" = "X-p" ]; then |
| 719 | PXY_CMD="$2" |
| 720 | shift 2 |
| 721 | else |
| 722 | PXY_CMD="" |
| 723 | fi |
| 724 | |
| 725 | # get commands and client output |
| 726 | SRV_CMD="$1" |
| 727 | CLI_CMD="$2" |
| 728 | CLI_EXPECT="$3" |
| 729 | shift 3 |
| 730 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 731 | # Check if test uses files |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 732 | case "$SRV_CMD $CLI_CMD" in |
| 733 | *data_files/*) |
| 734 | requires_config_enabled MBEDTLS_FS_IO;; |
| 735 | esac |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 736 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 737 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 738 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 739 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 740 | |
| 741 | # should we skip? |
| 742 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 743 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 744 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 745 | SKIPS=$(( $SKIPS + 1 )) |
| 746 | return |
| 747 | fi |
| 748 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 749 | # update DTLS variable |
| 750 | detect_dtls "$SRV_CMD" |
| 751 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 752 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 753 | # 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] | 754 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 755 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 756 | case " $SRV_CMD " in |
| 757 | *' server_addr=::1 '*) |
| 758 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 759 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 760 | fi |
| 761 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 762 | # update CMD_IS_GNUTLS variable |
| 763 | is_gnutls "$SRV_CMD" |
| 764 | |
| 765 | # if the server uses gnutls but doesn't set priority, explicitly |
| 766 | # set the default priority |
| 767 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 768 | case "$SRV_CMD" in |
| 769 | *--priority*) :;; |
| 770 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 771 | esac |
| 772 | fi |
| 773 | |
| 774 | # update CMD_IS_GNUTLS variable |
| 775 | is_gnutls "$CLI_CMD" |
| 776 | |
| 777 | # if the client uses gnutls but doesn't set priority, explicitly |
| 778 | # set the default priority |
| 779 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 780 | case "$CLI_CMD" in |
| 781 | *--priority*) :;; |
| 782 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 783 | esac |
| 784 | fi |
| 785 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 786 | # fix client port |
| 787 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 788 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 789 | else |
| 790 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 791 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 792 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 793 | # prepend valgrind to our commands if active |
| 794 | if [ "$MEMCHECK" -gt 0 ]; then |
| 795 | if is_polar "$SRV_CMD"; then |
| 796 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 797 | fi |
| 798 | if is_polar "$CLI_CMD"; then |
| 799 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 800 | fi |
| 801 | fi |
| 802 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 803 | TIMES_LEFT=2 |
| 804 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 805 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 806 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 807 | # run the commands |
| 808 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 809 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 810 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 811 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 812 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 813 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 814 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 815 | check_osrv_dtls |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 816 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 817 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 818 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 819 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 820 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 821 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 822 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 823 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 824 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 825 | sleep 0.05 |
| 826 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 827 | # terminate the server (and the proxy) |
| 828 | kill $SRV_PID |
| 829 | wait $SRV_PID |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 830 | SRV_RET=$? |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 831 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 832 | if [ -n "$PXY_CMD" ]; then |
| 833 | kill $PXY_PID >/dev/null 2>&1 |
| 834 | wait $PXY_PID |
| 835 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 836 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 837 | # retry only on timeouts |
| 838 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 839 | printf "RETRY " |
| 840 | else |
| 841 | TIMES_LEFT=0 |
| 842 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 843 | done |
| 844 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 845 | # 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] | 846 | # (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] | 847 | # expected client exit to incorrectly succeed in case of catastrophic |
| 848 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 849 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 850 | 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] | 851 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 852 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 853 | return |
| 854 | fi |
| 855 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 856 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 857 | 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] | 858 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 859 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 860 | return |
| 861 | fi |
| 862 | fi |
| 863 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 864 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 865 | # exit with status 0 when interrupted by a signal, and we don't really |
| 866 | # care anyway), in case e.g. the server reports a memory leak. |
| 867 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 868 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 869 | return |
| 870 | fi |
| 871 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 872 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 873 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 874 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 875 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 876 | 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] | 877 | return |
| 878 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 879 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 880 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 881 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 882 | # 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] | 883 | while [ $# -gt 0 ] |
| 884 | do |
| 885 | case $1 in |
| 886 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 887 | 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] | 888 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 889 | return |
| 890 | fi |
| 891 | ;; |
| 892 | |
| 893 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 894 | 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] | 895 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 896 | return |
| 897 | fi |
| 898 | ;; |
| 899 | |
| 900 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 901 | 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] | 902 | 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] | 903 | return |
| 904 | fi |
| 905 | ;; |
| 906 | |
| 907 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 908 | 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] | 909 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 910 | return |
| 911 | fi |
| 912 | ;; |
| 913 | |
| 914 | # The filtering in the following two options (-u and -U) do the following |
| 915 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 916 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 917 | # - keep one of each non-unique line |
| 918 | # - count how many lines remain |
| 919 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 920 | # if there were no duplicates. |
| 921 | "-U") |
| 922 | 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 |
| 923 | fail "lines following pattern '$2' must be unique in Server output" |
| 924 | return |
| 925 | fi |
| 926 | ;; |
| 927 | |
| 928 | "-u") |
| 929 | 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 |
| 930 | 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] | 931 | return |
| 932 | fi |
| 933 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 934 | "-F") |
| 935 | if ! $2 "$SRV_OUT"; then |
| 936 | fail "function call to '$2' failed on Server output" |
| 937 | return |
| 938 | fi |
| 939 | ;; |
| 940 | "-f") |
| 941 | if ! $2 "$CLI_OUT"; then |
| 942 | fail "function call to '$2' failed on Client output" |
| 943 | return |
| 944 | fi |
| 945 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 946 | "-g") |
| 947 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 948 | fail "function call to '$2' failed on Server and Client output" |
| 949 | return |
| 950 | fi |
| 951 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 952 | |
| 953 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 954 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 955 | exit 1 |
| 956 | esac |
| 957 | shift 2 |
| 958 | done |
| 959 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 960 | # check valgrind's results |
| 961 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 962 | 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] | 963 | fail "Server has memory errors" |
| 964 | return |
| 965 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 966 | 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] | 967 | fail "Client has memory errors" |
| 968 | return |
| 969 | fi |
| 970 | fi |
| 971 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 972 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 973 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 974 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 975 | mv $SRV_OUT o-srv-${TESTS}.log |
| 976 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 977 | if [ -n "$PXY_CMD" ]; then |
| 978 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 979 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 980 | fi |
| 981 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 982 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 983 | } |
| 984 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 985 | run_test_psa() { |
| 986 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 987 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 988 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 989 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 990 | 0 \ |
| 991 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 992 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 993 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 994 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 995 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 996 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 997 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 998 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 999 | -C "Failed to setup PSA-based cipher context"\ |
| 1000 | -S "Failed to setup PSA-based cipher context"\ |
| 1001 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1002 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1003 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1004 | -S "error" \ |
| 1005 | -C "error" |
| 1006 | } |
| 1007 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1008 | run_test_psa_force_curve() { |
| 1009 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1010 | run_test "PSA - ECDH with $1" \ |
Gilles Peskine | 12b5b38 | 2021-06-02 10:00:42 +0200 | [diff] [blame] | 1011 | "$P_SRV debug_level=4 force_version=tls1_2 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1012 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1013 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1014 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1015 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1016 | -c "PSA calc verify" \ |
| 1017 | -c "calc PSA finished" \ |
| 1018 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1019 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1020 | -s "PSA calc verify" \ |
| 1021 | -s "calc PSA finished" \ |
| 1022 | -C "Failed to setup PSA-based cipher context"\ |
| 1023 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1024 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1025 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1026 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1027 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1028 | -C "error" |
| 1029 | } |
| 1030 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1031 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1032 | # a maximum fragment length. |
| 1033 | # first argument ($1) is MFL for SSL client |
| 1034 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1035 | run_test_memory_after_hanshake_with_mfl() |
| 1036 | { |
| 1037 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1038 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1039 | |
| 1040 | # Leave some margin for robustness |
| 1041 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1042 | |
| 1043 | run_test "Handshake memory usage (MFL $1)" \ |
| 1044 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1045 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1046 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1047 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1048 | 0 \ |
| 1049 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1050 | } |
| 1051 | |
| 1052 | |
| 1053 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1054 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1055 | run_tests_memory_after_hanshake() |
| 1056 | { |
| 1057 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1058 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1059 | |
| 1060 | # first test with default MFU is to get reference memory usage |
| 1061 | MEMORY_USAGE_MFL_16K=0 |
| 1062 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1063 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1064 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1065 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1066 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1067 | 0 \ |
| 1068 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1069 | |
| 1070 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1071 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1072 | |
| 1073 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1074 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1075 | |
| 1076 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1077 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1078 | |
| 1079 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1080 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1081 | } |
| 1082 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1083 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1084 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1085 | rm -f context_srv.txt |
| 1086 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1087 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1088 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1089 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1090 | 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] | 1091 | exit 1 |
| 1092 | } |
| 1093 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1094 | # |
| 1095 | # MAIN |
| 1096 | # |
| 1097 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1098 | get_options "$@" |
| 1099 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1100 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1101 | # patterns rather than regular expressions, use a case statement instead |
| 1102 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1103 | # detects simple cases: plain substring, everything, nothing. |
| 1104 | # |
| 1105 | # As an exception, the character '.' is treated as an ordinary character |
| 1106 | # if it is the only special character in the string. This is because it's |
| 1107 | # rare to need "any one character", but needing a literal '.' is common |
| 1108 | # (e.g. '-f "DTLS 1.2"'). |
| 1109 | need_grep= |
| 1110 | case "$FILTER" in |
| 1111 | '^$') simple_filter=;; |
| 1112 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1113 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1114 | need_grep=1;; |
| 1115 | *) # No regexp or shell-pattern special character |
| 1116 | simple_filter="*$FILTER*";; |
| 1117 | esac |
| 1118 | case "$EXCLUDE" in |
| 1119 | '^$') simple_exclude=;; |
| 1120 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1121 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1122 | need_grep=1;; |
| 1123 | *) # No regexp or shell-pattern special character |
| 1124 | simple_exclude="*$EXCLUDE*";; |
| 1125 | esac |
| 1126 | if [ -n "$need_grep" ]; then |
| 1127 | is_excluded () { |
| 1128 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1129 | } |
| 1130 | else |
| 1131 | is_excluded () { |
| 1132 | case "$1" in |
| 1133 | $simple_exclude) true;; |
| 1134 | $simple_filter) false;; |
| 1135 | *) true;; |
| 1136 | esac |
| 1137 | } |
| 1138 | fi |
| 1139 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1140 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1141 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1142 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1143 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1144 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1145 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1146 | exit 1 |
| 1147 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1148 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1149 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1150 | exit 1 |
| 1151 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1152 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1153 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1154 | exit 1 |
| 1155 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1156 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1157 | if which valgrind >/dev/null 2>&1; then :; else |
| 1158 | echo "Memcheck not possible. Valgrind not found" |
| 1159 | exit 1 |
| 1160 | fi |
| 1161 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1162 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1163 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1164 | exit 1 |
| 1165 | fi |
| 1166 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1167 | # used by watchdog |
| 1168 | MAIN_PID="$$" |
| 1169 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1170 | # We use somewhat arbitrary delays for tests: |
| 1171 | # - how long do we wait for the server to start (when lsof not available)? |
| 1172 | # - how long do we allow for the client to finish? |
| 1173 | # (not to check performance, just to avoid waiting indefinitely) |
| 1174 | # Things are slower with valgrind, so give extra time here. |
| 1175 | # |
| 1176 | # Note: without lsof, there is a trade-off between the running time of this |
| 1177 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1178 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1179 | # 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] | 1180 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1181 | START_DELAY=6 |
| 1182 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1183 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1184 | START_DELAY=2 |
| 1185 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1186 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1187 | |
| 1188 | # some particular tests need more time: |
| 1189 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1190 | # - for the server, we sleep for a number of seconds after the client exits |
| 1191 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1192 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1193 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1194 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1195 | # 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] | 1196 | # +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] | 1197 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1198 | 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] | 1199 | P_PXY="$P_PXY server_addr=127.0.0.1 server_port=$SRV_PORT listen_addr=127.0.0.1 listen_port=$PXY_PORT ${SEED:+"seed=$SEED"}" |
Gilles Peskine | 96f5bae | 2021-04-01 14:00:11 +0200 | [diff] [blame] | 1200 | O_SRV="$O_SRV -accept $SRV_PORT" |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 1201 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1202 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1203 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1204 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1205 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1206 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1207 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1208 | fi |
| 1209 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1210 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1211 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1212 | fi |
| 1213 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1214 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1215 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1216 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1217 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1218 | # Allow SHA-1, because many of our test certificates use it |
| 1219 | P_SRV="$P_SRV allow_sha1=1" |
| 1220 | P_CLI="$P_CLI allow_sha1=1" |
| 1221 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1222 | # Also pick a unique name for intermediate files |
| 1223 | SRV_OUT="srv_out.$$" |
| 1224 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1225 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1226 | SESSION="session.$$" |
| 1227 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1228 | SKIP_NEXT="NO" |
| 1229 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1230 | trap cleanup INT TERM HUP |
| 1231 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1232 | # Basic test |
| 1233 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1234 | # Checks that: |
| 1235 | # - things work with all ciphersuites active (used with config-full in all.sh) |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1236 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1237 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1238 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1239 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1240 | "$P_CLI" \ |
| 1241 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1242 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1243 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1244 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1245 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1246 | -S "error" \ |
| 1247 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1248 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1249 | run_test "Default, DTLS" \ |
| 1250 | "$P_SRV dtls=1" \ |
| 1251 | "$P_CLI dtls=1" \ |
| 1252 | 0 \ |
| 1253 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1254 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1255 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1256 | run_test "TLS client auth: required" \ |
| 1257 | "$P_SRV auth_mode=required" \ |
| 1258 | "$P_CLI" \ |
| 1259 | 0 \ |
| 1260 | -s "Verifying peer X.509 certificate... ok" |
| 1261 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1262 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1263 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1264 | requires_config_enabled MBEDTLS_SHA256_C |
| 1265 | run_test "TLS: password protected client key" \ |
| 1266 | "$P_SRV auth_mode=required" \ |
| 1267 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1268 | 0 |
| 1269 | |
| 1270 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1271 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1272 | requires_config_enabled MBEDTLS_SHA256_C |
| 1273 | run_test "TLS: password protected server key" \ |
| 1274 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1275 | "$P_CLI" \ |
| 1276 | 0 |
| 1277 | |
| 1278 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1279 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1280 | requires_config_enabled MBEDTLS_RSA_C |
| 1281 | requires_config_enabled MBEDTLS_SHA256_C |
| 1282 | run_test "TLS: password protected server key, two certificates" \ |
| 1283 | "$P_SRV \ |
| 1284 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1285 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1286 | "$P_CLI" \ |
| 1287 | 0 |
| 1288 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1289 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1290 | run_test "CA callback on client" \ |
| 1291 | "$P_SRV debug_level=3" \ |
| 1292 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1293 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1294 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1295 | -S "error" \ |
| 1296 | -C "error" |
| 1297 | |
| 1298 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1299 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1300 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1301 | requires_config_enabled MBEDTLS_SHA256_C |
| 1302 | run_test "CA callback on server" \ |
| 1303 | "$P_SRV auth_mode=required" \ |
| 1304 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1305 | key_file=data_files/server5.key" \ |
| 1306 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1307 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1308 | -s "Verifying peer X.509 certificate... ok" \ |
| 1309 | -S "error" \ |
| 1310 | -C "error" |
| 1311 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1312 | # Test using an opaque private key for client authentication |
| 1313 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1314 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1315 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1316 | requires_config_enabled MBEDTLS_SHA256_C |
| 1317 | run_test "Opaque key for client authentication" \ |
| 1318 | "$P_SRV auth_mode=required" \ |
| 1319 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1320 | key_file=data_files/server5.key" \ |
| 1321 | 0 \ |
| 1322 | -c "key type: Opaque" \ |
| 1323 | -s "Verifying peer X.509 certificate... ok" \ |
| 1324 | -S "error" \ |
| 1325 | -C "error" |
| 1326 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1327 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1328 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1329 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1330 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1331 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1332 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1333 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1334 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1335 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1336 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1337 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1338 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1339 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1340 | run_test_psa_force_curve "secp521r1" |
| 1341 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1342 | run_test_psa_force_curve "brainpoolP512r1" |
| 1343 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1344 | run_test_psa_force_curve "secp384r1" |
| 1345 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1346 | run_test_psa_force_curve "brainpoolP384r1" |
| 1347 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1348 | run_test_psa_force_curve "secp256r1" |
| 1349 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1350 | run_test_psa_force_curve "secp256k1" |
| 1351 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1352 | run_test_psa_force_curve "brainpoolP256r1" |
| 1353 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1354 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1355 | ## SECP224K1 is buggy via the PSA API |
| 1356 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1357 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1358 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1359 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1360 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1361 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1362 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1363 | run_test_psa_force_curve "secp192r1" |
| 1364 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1365 | run_test_psa_force_curve "secp192k1" |
| 1366 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1367 | # Test current time in ServerHello |
| 1368 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1369 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1370 | "$P_SRV debug_level=3" \ |
| 1371 | "$P_CLI debug_level=3" \ |
| 1372 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1373 | -f "check_server_hello_time" \ |
| 1374 | -F "check_server_hello_time" |
| 1375 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1376 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1377 | run_test "Unique IV in GCM" \ |
| 1378 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1379 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1380 | 0 \ |
| 1381 | -u "IV used" \ |
| 1382 | -U "IV used" |
| 1383 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1384 | # Tests for certificate verification callback |
| 1385 | run_test "Configuration-specific CRT verification callback" \ |
| 1386 | "$P_SRV debug_level=3" \ |
| 1387 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1388 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1389 | -S "error" \ |
| 1390 | -c "Verify requested for " \ |
| 1391 | -c "Use configuration-specific verification callback" \ |
| 1392 | -C "Use context-specific verification callback" \ |
| 1393 | -C "error" |
| 1394 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1395 | run_test "Context-specific CRT verification callback" \ |
| 1396 | "$P_SRV debug_level=3" \ |
| 1397 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1398 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1399 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1400 | -c "Verify requested for " \ |
| 1401 | -c "Use context-specific verification callback" \ |
| 1402 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1403 | -C "error" |
| 1404 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1405 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1406 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1407 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1408 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1409 | 1 \ |
| 1410 | -c "The certificate is signed with an unacceptable hash" |
| 1411 | |
| 1412 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1413 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1414 | "$P_CLI allow_sha1=1" \ |
| 1415 | 0 |
| 1416 | |
| 1417 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1418 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1419 | "$P_CLI allow_sha1=0" \ |
| 1420 | 0 |
| 1421 | |
| 1422 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1423 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1424 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1425 | 1 \ |
| 1426 | -s "The certificate is signed with an unacceptable hash" |
| 1427 | |
| 1428 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1429 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1430 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1431 | 0 |
| 1432 | |
| 1433 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1434 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1435 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1436 | 0 |
| 1437 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1438 | # Tests for datagram packing |
| 1439 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1440 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1441 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1442 | 0 \ |
| 1443 | -c "next record in same datagram" \ |
| 1444 | -s "next record in same datagram" |
| 1445 | |
| 1446 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1447 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1448 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1449 | 0 \ |
| 1450 | -s "next record in same datagram" \ |
| 1451 | -C "next record in same datagram" |
| 1452 | |
| 1453 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1454 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1455 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1456 | 0 \ |
| 1457 | -S "next record in same datagram" \ |
| 1458 | -c "next record in same datagram" |
| 1459 | |
| 1460 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1461 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1462 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1463 | 0 \ |
| 1464 | -S "next record in same datagram" \ |
| 1465 | -C "next record in same datagram" |
| 1466 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1467 | # Tests for Context serialization |
| 1468 | |
| 1469 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1470 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1471 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1472 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1473 | 0 \ |
| 1474 | -c "Deserializing connection..." \ |
| 1475 | -S "Deserializing connection..." |
| 1476 | |
| 1477 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1478 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1479 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1480 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1481 | 0 \ |
| 1482 | -c "Deserializing connection..." \ |
| 1483 | -S "Deserializing connection..." |
| 1484 | |
| 1485 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1486 | run_test "Context serialization, client serializes, GCM" \ |
| 1487 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1488 | "$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] | 1489 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1490 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1491 | -S "Deserializing connection..." |
| 1492 | |
| 1493 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1494 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1495 | run_test "Context serialization, client serializes, with CID" \ |
| 1496 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1497 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1498 | 0 \ |
| 1499 | -c "Deserializing connection..." \ |
| 1500 | -S "Deserializing connection..." |
| 1501 | |
| 1502 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1503 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1504 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1505 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1506 | 0 \ |
| 1507 | -C "Deserializing connection..." \ |
| 1508 | -s "Deserializing connection..." |
| 1509 | |
| 1510 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1511 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1512 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1513 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1514 | 0 \ |
| 1515 | -C "Deserializing connection..." \ |
| 1516 | -s "Deserializing connection..." |
| 1517 | |
| 1518 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1519 | run_test "Context serialization, server serializes, GCM" \ |
| 1520 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1521 | "$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] | 1522 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1523 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1524 | -s "Deserializing connection..." |
| 1525 | |
| 1526 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1527 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1528 | run_test "Context serialization, server serializes, with CID" \ |
| 1529 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1530 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1531 | 0 \ |
| 1532 | -C "Deserializing connection..." \ |
| 1533 | -s "Deserializing connection..." |
| 1534 | |
| 1535 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1536 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1537 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1538 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1539 | 0 \ |
| 1540 | -c "Deserializing connection..." \ |
| 1541 | -s "Deserializing connection..." |
| 1542 | |
| 1543 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1544 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1545 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1546 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1547 | 0 \ |
| 1548 | -c "Deserializing connection..." \ |
| 1549 | -s "Deserializing connection..." |
| 1550 | |
| 1551 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1552 | run_test "Context serialization, both serialize, GCM" \ |
| 1553 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1554 | "$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] | 1555 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1556 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1557 | -s "Deserializing connection..." |
| 1558 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1559 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1560 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1561 | run_test "Context serialization, both serialize, with CID" \ |
| 1562 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1563 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1564 | 0 \ |
| 1565 | -c "Deserializing connection..." \ |
| 1566 | -s "Deserializing connection..." |
| 1567 | |
| 1568 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1569 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1570 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1571 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1572 | 0 \ |
| 1573 | -c "Deserializing connection..." \ |
| 1574 | -S "Deserializing connection..." |
| 1575 | |
| 1576 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1577 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1578 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1579 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1580 | 0 \ |
| 1581 | -c "Deserializing connection..." \ |
| 1582 | -S "Deserializing connection..." |
| 1583 | |
| 1584 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1585 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1586 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1587 | "$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] | 1588 | 0 \ |
| 1589 | -c "Deserializing connection..." \ |
| 1590 | -S "Deserializing connection..." |
| 1591 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1592 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1593 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1594 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1595 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1596 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1597 | 0 \ |
| 1598 | -c "Deserializing connection..." \ |
| 1599 | -S "Deserializing connection..." |
| 1600 | |
| 1601 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1602 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1603 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1604 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1605 | 0 \ |
| 1606 | -C "Deserializing connection..." \ |
| 1607 | -s "Deserializing connection..." |
| 1608 | |
| 1609 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1610 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1611 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1612 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1613 | 0 \ |
| 1614 | -C "Deserializing connection..." \ |
| 1615 | -s "Deserializing connection..." |
| 1616 | |
| 1617 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1618 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1619 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1620 | "$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] | 1621 | 0 \ |
| 1622 | -C "Deserializing connection..." \ |
| 1623 | -s "Deserializing connection..." |
| 1624 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1625 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1626 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1627 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1628 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1629 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1630 | 0 \ |
| 1631 | -C "Deserializing connection..." \ |
| 1632 | -s "Deserializing connection..." |
| 1633 | |
| 1634 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1635 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1636 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1637 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1638 | 0 \ |
| 1639 | -c "Deserializing connection..." \ |
| 1640 | -s "Deserializing connection..." |
| 1641 | |
| 1642 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1643 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1644 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1645 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1646 | 0 \ |
| 1647 | -c "Deserializing connection..." \ |
| 1648 | -s "Deserializing connection..." |
| 1649 | |
| 1650 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1651 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1652 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1653 | "$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] | 1654 | 0 \ |
| 1655 | -c "Deserializing connection..." \ |
| 1656 | -s "Deserializing connection..." |
| 1657 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1658 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1659 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1660 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1661 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1662 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1663 | 0 \ |
| 1664 | -c "Deserializing connection..." \ |
| 1665 | -s "Deserializing connection..." |
| 1666 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1667 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1668 | run_test "Saving the serialized context to a file" \ |
| 1669 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1670 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1671 | 0 \ |
| 1672 | -s "Save serialized context to a file... ok" \ |
| 1673 | -c "Save serialized context to a file... ok" |
| 1674 | rm -f context_srv.txt |
| 1675 | rm -f context_cli.txt |
| 1676 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1677 | # Tests for DTLS Connection ID extension |
| 1678 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1679 | # So far, the CID API isn't implemented, so we can't |
| 1680 | # grep for output witnessing its use. This needs to be |
| 1681 | # changed once the CID extension is implemented. |
| 1682 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1683 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1684 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1685 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1686 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1687 | 0 \ |
| 1688 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1689 | -s "found CID extension" \ |
| 1690 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1691 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1692 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1693 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1694 | -C "found CID extension" \ |
| 1695 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1696 | -C "Copy CIDs into SSL transform" \ |
| 1697 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1698 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1699 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1700 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1701 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1702 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1703 | 0 \ |
| 1704 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1705 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1706 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1707 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1708 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1709 | -C "found CID extension" \ |
| 1710 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1711 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1712 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1713 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1714 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1715 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1716 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1717 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1718 | 0 \ |
| 1719 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1720 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1721 | -c "client hello, adding CID extension" \ |
| 1722 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1723 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1724 | -s "server hello, adding CID extension" \ |
| 1725 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1726 | -c "Use of CID extension negotiated" \ |
| 1727 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1728 | -c "Copy CIDs into SSL transform" \ |
| 1729 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1730 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1731 | -s "Use of Connection ID has been negotiated" \ |
| 1732 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1733 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1734 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1735 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1736 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1737 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1738 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1739 | 0 \ |
| 1740 | -c "Enable use of CID extension." \ |
| 1741 | -s "Enable use of CID extension." \ |
| 1742 | -c "client hello, adding CID extension" \ |
| 1743 | -s "found CID extension" \ |
| 1744 | -s "Use of CID extension negotiated" \ |
| 1745 | -s "server hello, adding CID extension" \ |
| 1746 | -c "found CID extension" \ |
| 1747 | -c "Use of CID extension negotiated" \ |
| 1748 | -s "Copy CIDs into SSL transform" \ |
| 1749 | -c "Copy CIDs into SSL transform" \ |
| 1750 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1751 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1752 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1753 | -c "Use of Connection ID has been negotiated" \ |
| 1754 | -c "ignoring unexpected CID" \ |
| 1755 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1756 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1757 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1758 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1759 | -p "$P_PXY mtu=800" \ |
| 1760 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1761 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1762 | 0 \ |
| 1763 | -c "Enable use of CID extension." \ |
| 1764 | -s "Enable use of CID extension." \ |
| 1765 | -c "client hello, adding CID extension" \ |
| 1766 | -s "found CID extension" \ |
| 1767 | -s "Use of CID extension negotiated" \ |
| 1768 | -s "server hello, adding CID extension" \ |
| 1769 | -c "found CID extension" \ |
| 1770 | -c "Use of CID extension negotiated" \ |
| 1771 | -s "Copy CIDs into SSL transform" \ |
| 1772 | -c "Copy CIDs into SSL transform" \ |
| 1773 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1774 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1775 | -s "Use of Connection ID has been negotiated" \ |
| 1776 | -c "Use of Connection ID has been negotiated" |
| 1777 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1778 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1779 | 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] | 1780 | -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] | 1781 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1782 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1783 | 0 \ |
| 1784 | -c "Enable use of CID extension." \ |
| 1785 | -s "Enable use of CID extension." \ |
| 1786 | -c "client hello, adding CID extension" \ |
| 1787 | -s "found CID extension" \ |
| 1788 | -s "Use of CID extension negotiated" \ |
| 1789 | -s "server hello, adding CID extension" \ |
| 1790 | -c "found CID extension" \ |
| 1791 | -c "Use of CID extension negotiated" \ |
| 1792 | -s "Copy CIDs into SSL transform" \ |
| 1793 | -c "Copy CIDs into SSL transform" \ |
| 1794 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1795 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1796 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1797 | -c "Use of Connection ID has been negotiated" \ |
| 1798 | -c "ignoring unexpected CID" \ |
| 1799 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1800 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1801 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1802 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1803 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1804 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1805 | 0 \ |
| 1806 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1807 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1808 | -c "client hello, adding CID extension" \ |
| 1809 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1810 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1811 | -s "server hello, adding CID extension" \ |
| 1812 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1813 | -c "Use of CID extension negotiated" \ |
| 1814 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1815 | -c "Copy CIDs into SSL transform" \ |
| 1816 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1817 | -s "Peer CID (length 0 Bytes):" \ |
| 1818 | -s "Use of Connection ID has been negotiated" \ |
| 1819 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1820 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1821 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1822 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1823 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1824 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1825 | 0 \ |
| 1826 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1827 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1828 | -c "client hello, adding CID extension" \ |
| 1829 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1830 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1831 | -s "server hello, adding CID extension" \ |
| 1832 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1833 | -c "Use of CID extension negotiated" \ |
| 1834 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1835 | -c "Copy CIDs into SSL transform" \ |
| 1836 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1837 | -c "Peer CID (length 0 Bytes):" \ |
| 1838 | -s "Use of Connection ID has been negotiated" \ |
| 1839 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1840 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1841 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1842 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1843 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1844 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1845 | 0 \ |
| 1846 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1847 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1848 | -c "client hello, adding CID extension" \ |
| 1849 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1850 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1851 | -s "server hello, adding CID extension" \ |
| 1852 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1853 | -c "Use of CID extension negotiated" \ |
| 1854 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1855 | -c "Copy CIDs into SSL transform" \ |
| 1856 | -S "Use of Connection ID has been negotiated" \ |
| 1857 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1858 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1859 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1860 | 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] | 1861 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1862 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1863 | 0 \ |
| 1864 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1865 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1866 | -c "client hello, adding CID extension" \ |
| 1867 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1868 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1869 | -s "server hello, adding CID extension" \ |
| 1870 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1871 | -c "Use of CID extension negotiated" \ |
| 1872 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1873 | -c "Copy CIDs into SSL transform" \ |
| 1874 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1875 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1876 | -s "Use of Connection ID has been negotiated" \ |
| 1877 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1878 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1879 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1880 | 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] | 1881 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1882 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1883 | 0 \ |
| 1884 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1885 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1886 | -c "client hello, adding CID extension" \ |
| 1887 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1888 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1889 | -s "server hello, adding CID extension" \ |
| 1890 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1891 | -c "Use of CID extension negotiated" \ |
| 1892 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1893 | -c "Copy CIDs into SSL transform" \ |
| 1894 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1895 | -s "Peer CID (length 0 Bytes):" \ |
| 1896 | -s "Use of Connection ID has been negotiated" \ |
| 1897 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1898 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1899 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1900 | 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] | 1901 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1902 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1903 | 0 \ |
| 1904 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1905 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1906 | -c "client hello, adding CID extension" \ |
| 1907 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1908 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1909 | -s "server hello, adding CID extension" \ |
| 1910 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1911 | -c "Use of CID extension negotiated" \ |
| 1912 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1913 | -c "Copy CIDs into SSL transform" \ |
| 1914 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1915 | -c "Peer CID (length 0 Bytes):" \ |
| 1916 | -s "Use of Connection ID has been negotiated" \ |
| 1917 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1918 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1919 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1920 | 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] | 1921 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1922 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1923 | 0 \ |
| 1924 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1925 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1926 | -c "client hello, adding CID extension" \ |
| 1927 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1928 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1929 | -s "server hello, adding CID extension" \ |
| 1930 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1931 | -c "Use of CID extension negotiated" \ |
| 1932 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1933 | -c "Copy CIDs into SSL transform" \ |
| 1934 | -S "Use of Connection ID has been negotiated" \ |
| 1935 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1936 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1937 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1938 | 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] | 1939 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1940 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1941 | 0 \ |
| 1942 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1943 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1944 | -c "client hello, adding CID extension" \ |
| 1945 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1946 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1947 | -s "server hello, adding CID extension" \ |
| 1948 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1949 | -c "Use of CID extension negotiated" \ |
| 1950 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1951 | -c "Copy CIDs into SSL transform" \ |
| 1952 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1953 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1954 | -s "Use of Connection ID has been negotiated" \ |
| 1955 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1956 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1957 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1958 | 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] | 1959 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1960 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1961 | 0 \ |
| 1962 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1963 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1964 | -c "client hello, adding CID extension" \ |
| 1965 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1966 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1967 | -s "server hello, adding CID extension" \ |
| 1968 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1969 | -c "Use of CID extension negotiated" \ |
| 1970 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1971 | -c "Copy CIDs into SSL transform" \ |
| 1972 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1973 | -s "Peer CID (length 0 Bytes):" \ |
| 1974 | -s "Use of Connection ID has been negotiated" \ |
| 1975 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1976 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1977 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1978 | 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] | 1979 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1980 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1981 | 0 \ |
| 1982 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1983 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1984 | -c "client hello, adding CID extension" \ |
| 1985 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1986 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1987 | -s "server hello, adding CID extension" \ |
| 1988 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1989 | -c "Use of CID extension negotiated" \ |
| 1990 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1991 | -c "Copy CIDs into SSL transform" \ |
| 1992 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1993 | -c "Peer CID (length 0 Bytes):" \ |
| 1994 | -s "Use of Connection ID has been negotiated" \ |
| 1995 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1996 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1997 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1998 | 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] | 1999 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2000 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2001 | 0 \ |
| 2002 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2003 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2004 | -c "client hello, adding CID extension" \ |
| 2005 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2006 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2007 | -s "server hello, adding CID extension" \ |
| 2008 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2009 | -c "Use of CID extension negotiated" \ |
| 2010 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2011 | -c "Copy CIDs into SSL transform" \ |
| 2012 | -S "Use of Connection ID has been negotiated" \ |
| 2013 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2014 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2015 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2016 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2017 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2018 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2019 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2020 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2021 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2022 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2023 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2024 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2025 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2026 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2027 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2028 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2029 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2030 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2031 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2032 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2033 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2034 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2035 | 0 \ |
| 2036 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2037 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2038 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2039 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2040 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2041 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2042 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2043 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2044 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2045 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2046 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2047 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2048 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2049 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2050 | 0 \ |
| 2051 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2052 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2053 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2054 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2055 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2056 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2057 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2058 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2059 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2060 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2061 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2062 | 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] | 2063 | -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] | 2064 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2065 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2066 | 0 \ |
| 2067 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2068 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2069 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2070 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2071 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2072 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2073 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2074 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2075 | -c "ignoring unexpected CID" \ |
| 2076 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2077 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2078 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2079 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2080 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2081 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2082 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2083 | 0 \ |
| 2084 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2085 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2086 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2087 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2088 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2089 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2090 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2091 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2092 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2093 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2094 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2095 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2096 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2097 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2098 | 0 \ |
| 2099 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2100 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2101 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2102 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2103 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2104 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2105 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2106 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2107 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2108 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2109 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2110 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2111 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2112 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2113 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2114 | 0 \ |
| 2115 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2116 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2117 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2118 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2119 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2120 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2121 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2122 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2123 | -c "ignoring unexpected CID" \ |
| 2124 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2125 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2126 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2127 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2128 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2129 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2130 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2131 | 0 \ |
| 2132 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2133 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2134 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2135 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2136 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2137 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2138 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2139 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2140 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2141 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2142 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2143 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2144 | 0 \ |
| 2145 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2146 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2147 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2148 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2149 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2150 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2151 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2152 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2153 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2154 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2155 | -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] | 2156 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2157 | "$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" \ |
| 2158 | 0 \ |
| 2159 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2160 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2161 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2162 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2163 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2164 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2165 | -c "ignoring unexpected CID" \ |
| 2166 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2167 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2168 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2169 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2170 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2171 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2172 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2173 | 0 \ |
| 2174 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2175 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2176 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2177 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2178 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2179 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2180 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2181 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2182 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2183 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2184 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2185 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2186 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2187 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2188 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2189 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2190 | 0 \ |
| 2191 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2192 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2193 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2194 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2195 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2196 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2197 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2198 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2199 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2200 | -c "ignoring unexpected CID" \ |
| 2201 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2202 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2203 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2204 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2205 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2206 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2207 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2208 | 0 \ |
| 2209 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2210 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2211 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2212 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2213 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2214 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2215 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2216 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2217 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2218 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2219 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2220 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2221 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2222 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2223 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2224 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2225 | 0 \ |
| 2226 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2227 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2228 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2229 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2230 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2231 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2232 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2233 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2234 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2235 | -c "ignoring unexpected CID" \ |
| 2236 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2237 | |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2238 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2239 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2240 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2241 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2242 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2243 | 0 \ |
| 2244 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2245 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2246 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2247 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2248 | -s "Reallocating in_buf" \ |
| 2249 | -s "Reallocating out_buf" |
| 2250 | |
| 2251 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2252 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2253 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2254 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2255 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2256 | 0 \ |
| 2257 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2258 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2259 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2260 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2261 | -s "Reallocating in_buf" \ |
| 2262 | -s "Reallocating out_buf" |
| 2263 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2264 | # Tests for Encrypt-then-MAC extension |
| 2265 | |
| 2266 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2267 | "$P_SRV debug_level=3 \ |
| 2268 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2269 | "$P_CLI debug_level=3" \ |
| 2270 | 0 \ |
| 2271 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2272 | -s "found encrypt then mac extension" \ |
| 2273 | -s "server hello, adding encrypt then mac extension" \ |
| 2274 | -c "found encrypt_then_mac extension" \ |
| 2275 | -c "using encrypt then mac" \ |
| 2276 | -s "using encrypt then mac" |
| 2277 | |
| 2278 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2279 | "$P_SRV debug_level=3 etm=0 \ |
| 2280 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2281 | "$P_CLI debug_level=3 etm=1" \ |
| 2282 | 0 \ |
| 2283 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2284 | -s "found encrypt then mac extension" \ |
| 2285 | -S "server hello, adding encrypt then mac extension" \ |
| 2286 | -C "found encrypt_then_mac extension" \ |
| 2287 | -C "using encrypt then mac" \ |
| 2288 | -S "using encrypt then mac" |
| 2289 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2290 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2291 | "$P_SRV debug_level=3 etm=1 \ |
| 2292 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2293 | "$P_CLI debug_level=3 etm=1" \ |
| 2294 | 0 \ |
| 2295 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2296 | -s "found encrypt then mac extension" \ |
| 2297 | -S "server hello, adding encrypt then mac extension" \ |
| 2298 | -C "found encrypt_then_mac extension" \ |
| 2299 | -C "using encrypt then mac" \ |
| 2300 | -S "using encrypt then mac" |
| 2301 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2302 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2303 | "$P_SRV debug_level=3 etm=1 \ |
| 2304 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2305 | "$P_CLI debug_level=3 etm=0" \ |
| 2306 | 0 \ |
| 2307 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2308 | -S "found encrypt then mac extension" \ |
| 2309 | -S "server hello, adding encrypt then mac extension" \ |
| 2310 | -C "found encrypt_then_mac extension" \ |
| 2311 | -C "using encrypt then mac" \ |
| 2312 | -S "using encrypt then mac" |
| 2313 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2314 | # Tests for Extended Master Secret extension |
| 2315 | |
| 2316 | run_test "Extended Master Secret: default" \ |
| 2317 | "$P_SRV debug_level=3" \ |
| 2318 | "$P_CLI debug_level=3" \ |
| 2319 | 0 \ |
| 2320 | -c "client hello, adding extended_master_secret extension" \ |
| 2321 | -s "found extended master secret extension" \ |
| 2322 | -s "server hello, adding extended master secret extension" \ |
| 2323 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2324 | -c "session hash for extended master secret" \ |
| 2325 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2326 | |
| 2327 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2328 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2329 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2330 | 0 \ |
| 2331 | -c "client hello, adding extended_master_secret extension" \ |
| 2332 | -s "found extended master secret extension" \ |
| 2333 | -S "server hello, adding extended master secret extension" \ |
| 2334 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2335 | -C "session hash for extended master secret" \ |
| 2336 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2337 | |
| 2338 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2339 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2340 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2341 | 0 \ |
| 2342 | -C "client hello, adding extended_master_secret extension" \ |
| 2343 | -S "found extended master secret extension" \ |
| 2344 | -S "server hello, adding extended master secret extension" \ |
| 2345 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2346 | -C "session hash for extended master secret" \ |
| 2347 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2348 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2349 | # Test sending and receiving empty application data records |
| 2350 | |
| 2351 | run_test "Encrypt then MAC: empty application data record" \ |
| 2352 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2353 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2354 | 0 \ |
| 2355 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2356 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2357 | -c "0 bytes written in 1 fragments" |
| 2358 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2359 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2360 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2361 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2362 | 0 \ |
| 2363 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2364 | -c "0 bytes written in 1 fragments" |
| 2365 | |
| 2366 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2367 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2368 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2369 | 0 \ |
| 2370 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2371 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2372 | -c "0 bytes written in 1 fragments" |
| 2373 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2374 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2375 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2376 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2377 | 0 \ |
| 2378 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2379 | -c "0 bytes written in 1 fragments" |
| 2380 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2381 | # Tests for CBC 1/n-1 record splitting |
| 2382 | |
| 2383 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2384 | "$P_SRV" \ |
| 2385 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2386 | request_size=123 force_version=tls1_2" \ |
| 2387 | 0 \ |
| 2388 | -s "Read from client: 123 bytes read" \ |
| 2389 | -S "Read from client: 1 bytes read" \ |
| 2390 | -S "122 bytes read" |
| 2391 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2392 | # Tests for Session Tickets |
| 2393 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2394 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2395 | "$P_SRV debug_level=3 tickets=1" \ |
| 2396 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2397 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2398 | -c "client hello, adding session ticket extension" \ |
| 2399 | -s "found session ticket extension" \ |
| 2400 | -s "server hello, adding session ticket extension" \ |
| 2401 | -c "found session_ticket extension" \ |
| 2402 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2403 | -S "session successfully restored from cache" \ |
| 2404 | -s "session successfully restored from ticket" \ |
| 2405 | -s "a session has been resumed" \ |
| 2406 | -c "a session has been resumed" |
| 2407 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2408 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2409 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2410 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2411 | 0 \ |
| 2412 | -c "client hello, adding session ticket extension" \ |
| 2413 | -s "found session ticket extension" \ |
| 2414 | -s "server hello, adding session ticket extension" \ |
| 2415 | -c "found session_ticket extension" \ |
| 2416 | -c "parse new session ticket" \ |
| 2417 | -S "session successfully restored from cache" \ |
| 2418 | -s "session successfully restored from ticket" \ |
| 2419 | -s "a session has been resumed" \ |
| 2420 | -c "a session has been resumed" |
| 2421 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2422 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2423 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2424 | "$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] | 2425 | 0 \ |
| 2426 | -c "client hello, adding session ticket extension" \ |
| 2427 | -s "found session ticket extension" \ |
| 2428 | -s "server hello, adding session ticket extension" \ |
| 2429 | -c "found session_ticket extension" \ |
| 2430 | -c "parse new session ticket" \ |
| 2431 | -S "session successfully restored from cache" \ |
| 2432 | -S "session successfully restored from ticket" \ |
| 2433 | -S "a session has been resumed" \ |
| 2434 | -C "a session has been resumed" |
| 2435 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2436 | run_test "Session resume using tickets: session copy" \ |
| 2437 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2438 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2439 | 0 \ |
| 2440 | -c "client hello, adding session ticket extension" \ |
| 2441 | -s "found session ticket extension" \ |
| 2442 | -s "server hello, adding session ticket extension" \ |
| 2443 | -c "found session_ticket extension" \ |
| 2444 | -c "parse new session ticket" \ |
| 2445 | -S "session successfully restored from cache" \ |
| 2446 | -s "session successfully restored from ticket" \ |
| 2447 | -s "a session has been resumed" \ |
| 2448 | -c "a session has been resumed" |
| 2449 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2450 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2451 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2452 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2453 | 0 \ |
| 2454 | -c "client hello, adding session ticket extension" \ |
| 2455 | -c "found session_ticket extension" \ |
| 2456 | -c "parse new session ticket" \ |
| 2457 | -c "a session has been resumed" |
| 2458 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2459 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2460 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2461 | "( $O_CLI -sess_out $SESSION; \ |
| 2462 | $O_CLI -sess_in $SESSION; \ |
| 2463 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2464 | 0 \ |
| 2465 | -s "found session ticket extension" \ |
| 2466 | -s "server hello, adding session ticket extension" \ |
| 2467 | -S "session successfully restored from cache" \ |
| 2468 | -s "session successfully restored from ticket" \ |
| 2469 | -s "a session has been resumed" |
| 2470 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2471 | # Tests for Session Tickets with DTLS |
| 2472 | |
| 2473 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2474 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2475 | "$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] | 2476 | 0 \ |
| 2477 | -c "client hello, adding session ticket extension" \ |
| 2478 | -s "found session ticket extension" \ |
| 2479 | -s "server hello, adding session ticket extension" \ |
| 2480 | -c "found session_ticket extension" \ |
| 2481 | -c "parse new session ticket" \ |
| 2482 | -S "session successfully restored from cache" \ |
| 2483 | -s "session successfully restored from ticket" \ |
| 2484 | -s "a session has been resumed" \ |
| 2485 | -c "a session has been resumed" |
| 2486 | |
| 2487 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2488 | "$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] | 2489 | "$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] | 2490 | 0 \ |
| 2491 | -c "client hello, adding session ticket extension" \ |
| 2492 | -s "found session ticket extension" \ |
| 2493 | -s "server hello, adding session ticket extension" \ |
| 2494 | -c "found session_ticket extension" \ |
| 2495 | -c "parse new session ticket" \ |
| 2496 | -S "session successfully restored from cache" \ |
| 2497 | -s "session successfully restored from ticket" \ |
| 2498 | -s "a session has been resumed" \ |
| 2499 | -c "a session has been resumed" |
| 2500 | |
| 2501 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2502 | "$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] | 2503 | "$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] | 2504 | 0 \ |
| 2505 | -c "client hello, adding session ticket extension" \ |
| 2506 | -s "found session ticket extension" \ |
| 2507 | -s "server hello, adding session ticket extension" \ |
| 2508 | -c "found session_ticket extension" \ |
| 2509 | -c "parse new session ticket" \ |
| 2510 | -S "session successfully restored from cache" \ |
| 2511 | -S "session successfully restored from ticket" \ |
| 2512 | -S "a session has been resumed" \ |
| 2513 | -C "a session has been resumed" |
| 2514 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2515 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2516 | "$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] | 2517 | "$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] | 2518 | 0 \ |
| 2519 | -c "client hello, adding session ticket extension" \ |
| 2520 | -s "found session ticket extension" \ |
| 2521 | -s "server hello, adding session ticket extension" \ |
| 2522 | -c "found session_ticket extension" \ |
| 2523 | -c "parse new session ticket" \ |
| 2524 | -S "session successfully restored from cache" \ |
| 2525 | -s "session successfully restored from ticket" \ |
| 2526 | -s "a session has been resumed" \ |
| 2527 | -c "a session has been resumed" |
| 2528 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2529 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2530 | "$O_SRV -dtls" \ |
| 2531 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2532 | 0 \ |
| 2533 | -c "client hello, adding session ticket extension" \ |
| 2534 | -c "found session_ticket extension" \ |
| 2535 | -c "parse new session ticket" \ |
| 2536 | -c "a session has been resumed" |
| 2537 | |
| 2538 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2539 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2540 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2541 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2542 | rm -f $SESSION )" \ |
| 2543 | 0 \ |
| 2544 | -s "found session ticket extension" \ |
| 2545 | -s "server hello, adding session ticket extension" \ |
| 2546 | -S "session successfully restored from cache" \ |
| 2547 | -s "session successfully restored from ticket" \ |
| 2548 | -s "a session has been resumed" |
| 2549 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2550 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2551 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2552 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2553 | "$P_SRV debug_level=3 tickets=0" \ |
| 2554 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2555 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2556 | -c "client hello, adding session ticket extension" \ |
| 2557 | -s "found session ticket extension" \ |
| 2558 | -S "server hello, adding session ticket extension" \ |
| 2559 | -C "found session_ticket extension" \ |
| 2560 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2561 | -s "session successfully restored from cache" \ |
| 2562 | -S "session successfully restored from ticket" \ |
| 2563 | -s "a session has been resumed" \ |
| 2564 | -c "a session has been resumed" |
| 2565 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2566 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2567 | "$P_SRV debug_level=3 tickets=1" \ |
| 2568 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2569 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2570 | -C "client hello, adding session ticket extension" \ |
| 2571 | -S "found session ticket extension" \ |
| 2572 | -S "server hello, adding session ticket extension" \ |
| 2573 | -C "found session_ticket extension" \ |
| 2574 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2575 | -s "session successfully restored from cache" \ |
| 2576 | -S "session successfully restored from ticket" \ |
| 2577 | -s "a session has been resumed" \ |
| 2578 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2579 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2580 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2581 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2582 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2583 | 0 \ |
| 2584 | -S "session successfully restored from cache" \ |
| 2585 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2586 | -S "a session has been resumed" \ |
| 2587 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2588 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2589 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2590 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2591 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2592 | 0 \ |
| 2593 | -s "session successfully restored from cache" \ |
| 2594 | -S "session successfully restored from ticket" \ |
| 2595 | -s "a session has been resumed" \ |
| 2596 | -c "a session has been resumed" |
| 2597 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2598 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2599 | "$P_SRV debug_level=3 tickets=0" \ |
| 2600 | "$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] | 2601 | 0 \ |
| 2602 | -s "session successfully restored from cache" \ |
| 2603 | -S "session successfully restored from ticket" \ |
| 2604 | -s "a session has been resumed" \ |
| 2605 | -c "a session has been resumed" |
| 2606 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2607 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2608 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2609 | "$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] | 2610 | 0 \ |
| 2611 | -S "session successfully restored from cache" \ |
| 2612 | -S "session successfully restored from ticket" \ |
| 2613 | -S "a session has been resumed" \ |
| 2614 | -C "a session has been resumed" |
| 2615 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2616 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2617 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2618 | "$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] | 2619 | 0 \ |
| 2620 | -s "session successfully restored from cache" \ |
| 2621 | -S "session successfully restored from ticket" \ |
| 2622 | -s "a session has been resumed" \ |
| 2623 | -c "a session has been resumed" |
| 2624 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2625 | run_test "Session resume using cache: session copy" \ |
| 2626 | "$P_SRV debug_level=3 tickets=0" \ |
| 2627 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2628 | 0 \ |
| 2629 | -s "session successfully restored from cache" \ |
| 2630 | -S "session successfully restored from ticket" \ |
| 2631 | -s "a session has been resumed" \ |
| 2632 | -c "a session has been resumed" |
| 2633 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2634 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2635 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2636 | "( $O_CLI -sess_out $SESSION; \ |
| 2637 | $O_CLI -sess_in $SESSION; \ |
| 2638 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2639 | 0 \ |
| 2640 | -s "found session ticket extension" \ |
| 2641 | -S "server hello, adding session ticket extension" \ |
| 2642 | -s "session successfully restored from cache" \ |
| 2643 | -S "session successfully restored from ticket" \ |
| 2644 | -s "a session has been resumed" |
| 2645 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2646 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2647 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2648 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2649 | 0 \ |
| 2650 | -C "found session_ticket extension" \ |
| 2651 | -C "parse new session ticket" \ |
| 2652 | -c "a session has been resumed" |
| 2653 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2654 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2655 | |
| 2656 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2657 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2658 | "$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] | 2659 | 0 \ |
| 2660 | -c "client hello, adding session ticket extension" \ |
| 2661 | -s "found session ticket extension" \ |
| 2662 | -S "server hello, adding session ticket extension" \ |
| 2663 | -C "found session_ticket extension" \ |
| 2664 | -C "parse new session ticket" \ |
| 2665 | -s "session successfully restored from cache" \ |
| 2666 | -S "session successfully restored from ticket" \ |
| 2667 | -s "a session has been resumed" \ |
| 2668 | -c "a session has been resumed" |
| 2669 | |
| 2670 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2671 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2672 | "$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] | 2673 | 0 \ |
| 2674 | -C "client hello, adding session ticket extension" \ |
| 2675 | -S "found session ticket extension" \ |
| 2676 | -S "server hello, adding session ticket extension" \ |
| 2677 | -C "found session_ticket extension" \ |
| 2678 | -C "parse new session ticket" \ |
| 2679 | -s "session successfully restored from cache" \ |
| 2680 | -S "session successfully restored from ticket" \ |
| 2681 | -s "a session has been resumed" \ |
| 2682 | -c "a session has been resumed" |
| 2683 | |
| 2684 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2685 | "$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] | 2686 | "$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] | 2687 | 0 \ |
| 2688 | -S "session successfully restored from cache" \ |
| 2689 | -S "session successfully restored from ticket" \ |
| 2690 | -S "a session has been resumed" \ |
| 2691 | -C "a session has been resumed" |
| 2692 | |
| 2693 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2694 | "$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] | 2695 | "$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] | 2696 | 0 \ |
| 2697 | -s "session successfully restored from cache" \ |
| 2698 | -S "session successfully restored from ticket" \ |
| 2699 | -s "a session has been resumed" \ |
| 2700 | -c "a session has been resumed" |
| 2701 | |
| 2702 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2703 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2704 | "$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] | 2705 | 0 \ |
| 2706 | -s "session successfully restored from cache" \ |
| 2707 | -S "session successfully restored from ticket" \ |
| 2708 | -s "a session has been resumed" \ |
| 2709 | -c "a session has been resumed" |
| 2710 | |
| 2711 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2712 | "$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] | 2713 | "$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] | 2714 | 0 \ |
| 2715 | -S "session successfully restored from cache" \ |
| 2716 | -S "session successfully restored from ticket" \ |
| 2717 | -S "a session has been resumed" \ |
| 2718 | -C "a session has been resumed" |
| 2719 | |
| 2720 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2721 | "$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] | 2722 | "$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] | 2723 | 0 \ |
| 2724 | -s "session successfully restored from cache" \ |
| 2725 | -S "session successfully restored from ticket" \ |
| 2726 | -s "a session has been resumed" \ |
| 2727 | -c "a session has been resumed" |
| 2728 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2729 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2730 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2731 | "$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] | 2732 | 0 \ |
| 2733 | -s "session successfully restored from cache" \ |
| 2734 | -S "session successfully restored from ticket" \ |
| 2735 | -s "a session has been resumed" \ |
| 2736 | -c "a session has been resumed" |
| 2737 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2738 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2739 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2740 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2741 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2742 | rm -f $SESSION )" \ |
| 2743 | 0 \ |
| 2744 | -s "found session ticket extension" \ |
| 2745 | -S "server hello, adding session ticket extension" \ |
| 2746 | -s "session successfully restored from cache" \ |
| 2747 | -S "session successfully restored from ticket" \ |
| 2748 | -s "a session has been resumed" |
| 2749 | |
| 2750 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2751 | "$O_SRV -dtls" \ |
| 2752 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2753 | 0 \ |
| 2754 | -C "found session_ticket extension" \ |
| 2755 | -C "parse new session ticket" \ |
| 2756 | -c "a session has been resumed" |
| 2757 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2758 | # Tests for Max Fragment Length extension |
| 2759 | |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 2760 | if [ "$MAX_IN_LEN" -lt "4096" ]; then |
| 2761 | printf '%s defines MBEDTLS_SSL_IN_CONTENT_LEN to be less than 4096. Fragment length tests will fail.\n' "${CONFIG_H}" |
| 2762 | exit 1 |
| 2763 | fi |
| 2764 | |
| 2765 | if [ "$MAX_OUT_LEN" -lt "4096" ]; then |
| 2766 | printf '%s defines MBEDTLS_SSL_OUT_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] | 2767 | exit 1 |
| 2768 | fi |
| 2769 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2770 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 2771 | echo "Using non-default maximum content length $MAX_CONTENT_LEN" |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2772 | fi |
| 2773 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2774 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2775 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2776 | "$P_SRV debug_level=3" \ |
| 2777 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2778 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2779 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2780 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2781 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2782 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2783 | -C "client hello, adding max_fragment_length extension" \ |
| 2784 | -S "found max fragment length extension" \ |
| 2785 | -S "server hello, max_fragment_length extension" \ |
| 2786 | -C "found max_fragment_length extension" |
| 2787 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2788 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2789 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2790 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2791 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2792 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2793 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2794 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2795 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2796 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2797 | -C "client hello, adding max_fragment_length extension" \ |
| 2798 | -S "found max fragment length extension" \ |
| 2799 | -S "server hello, max_fragment_length extension" \ |
| 2800 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2801 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2802 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2803 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2804 | |
| 2805 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2806 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2807 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2808 | "$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] | 2809 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2810 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2811 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2812 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2813 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2814 | -C "client hello, adding max_fragment_length extension" \ |
| 2815 | -S "found max fragment length extension" \ |
| 2816 | -S "server hello, max_fragment_length extension" \ |
| 2817 | -C "found max_fragment_length extension" \ |
| 2818 | -c "fragment larger than.*maximum " |
| 2819 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2820 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2821 | # (session fragment length will be 16384 regardless of mbedtls |
| 2822 | # content length configuration.) |
| 2823 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2824 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2825 | run_test "Max fragment length: disabled, larger message" \ |
| 2826 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2827 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2828 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2829 | -C "Maximum incoming record payload length is 16384" \ |
| 2830 | -C "Maximum outgoing record payload length is 16384" \ |
| 2831 | -S "Maximum incoming record payload length is 16384" \ |
| 2832 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2833 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2834 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2835 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2836 | |
| 2837 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2838 | run_test "Max fragment length DTLS: disabled, larger message" \ |
| 2839 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2840 | "$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] | 2841 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2842 | -C "Maximum incoming record payload length is 16384" \ |
| 2843 | -C "Maximum outgoing record payload length is 16384" \ |
| 2844 | -S "Maximum incoming record payload length is 16384" \ |
| 2845 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2846 | -c "fragment larger than.*maximum " |
| 2847 | |
| 2848 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2849 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2850 | "$P_SRV debug_level=3" \ |
| 2851 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2852 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2853 | -c "Maximum incoming record payload length is 4096" \ |
| 2854 | -c "Maximum outgoing record payload length is 4096" \ |
| 2855 | -s "Maximum incoming record payload length is 4096" \ |
| 2856 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2857 | -c "client hello, adding max_fragment_length extension" \ |
| 2858 | -s "found max fragment length extension" \ |
| 2859 | -s "server hello, max_fragment_length extension" \ |
| 2860 | -c "found max_fragment_length extension" |
| 2861 | |
| 2862 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2863 | run_test "Max fragment length: client 512, server 1024" \ |
| 2864 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 2865 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2866 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2867 | -c "Maximum incoming record payload length is 512" \ |
| 2868 | -c "Maximum outgoing record payload length is 512" \ |
| 2869 | -s "Maximum incoming record payload length is 512" \ |
| 2870 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2871 | -c "client hello, adding max_fragment_length extension" \ |
| 2872 | -s "found max fragment length extension" \ |
| 2873 | -s "server hello, max_fragment_length extension" \ |
| 2874 | -c "found max_fragment_length extension" |
| 2875 | |
| 2876 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2877 | run_test "Max fragment length: client 512, server 2048" \ |
| 2878 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 2879 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2880 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2881 | -c "Maximum incoming record payload length is 512" \ |
| 2882 | -c "Maximum outgoing record payload length is 512" \ |
| 2883 | -s "Maximum incoming record payload length is 512" \ |
| 2884 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2885 | -c "client hello, adding max_fragment_length extension" \ |
| 2886 | -s "found max fragment length extension" \ |
| 2887 | -s "server hello, max_fragment_length extension" \ |
| 2888 | -c "found max_fragment_length extension" |
| 2889 | |
| 2890 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2891 | run_test "Max fragment length: client 512, server 4096" \ |
| 2892 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2893 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2894 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2895 | -c "Maximum incoming record payload length is 512" \ |
| 2896 | -c "Maximum outgoing record payload length is 512" \ |
| 2897 | -s "Maximum incoming record payload length is 512" \ |
| 2898 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2899 | -c "client hello, adding max_fragment_length extension" \ |
| 2900 | -s "found max fragment length extension" \ |
| 2901 | -s "server hello, max_fragment_length extension" \ |
| 2902 | -c "found max_fragment_length extension" |
| 2903 | |
| 2904 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2905 | run_test "Max fragment length: client 1024, server 512" \ |
| 2906 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 2907 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2908 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2909 | -c "Maximum incoming record payload length is 1024" \ |
| 2910 | -c "Maximum outgoing record payload length is 1024" \ |
| 2911 | -s "Maximum incoming record payload length is 1024" \ |
| 2912 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2913 | -c "client hello, adding max_fragment_length extension" \ |
| 2914 | -s "found max fragment length extension" \ |
| 2915 | -s "server hello, max_fragment_length extension" \ |
| 2916 | -c "found max_fragment_length extension" |
| 2917 | |
| 2918 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2919 | run_test "Max fragment length: client 1024, server 2048" \ |
| 2920 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 2921 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2922 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2923 | -c "Maximum incoming record payload length is 1024" \ |
| 2924 | -c "Maximum outgoing record payload length is 1024" \ |
| 2925 | -s "Maximum incoming record payload length is 1024" \ |
| 2926 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2927 | -c "client hello, adding max_fragment_length extension" \ |
| 2928 | -s "found max fragment length extension" \ |
| 2929 | -s "server hello, max_fragment_length extension" \ |
| 2930 | -c "found max_fragment_length extension" |
| 2931 | |
| 2932 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2933 | run_test "Max fragment length: client 1024, server 4096" \ |
| 2934 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2935 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2936 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2937 | -c "Maximum incoming record payload length is 1024" \ |
| 2938 | -c "Maximum outgoing record payload length is 1024" \ |
| 2939 | -s "Maximum incoming record payload length is 1024" \ |
| 2940 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2941 | -c "client hello, adding max_fragment_length extension" \ |
| 2942 | -s "found max fragment length extension" \ |
| 2943 | -s "server hello, max_fragment_length extension" \ |
| 2944 | -c "found max_fragment_length extension" |
| 2945 | |
| 2946 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2947 | run_test "Max fragment length: client 2048, server 512" \ |
| 2948 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 2949 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 2950 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2951 | -c "Maximum incoming record payload length is 2048" \ |
| 2952 | -c "Maximum outgoing record payload length is 2048" \ |
| 2953 | -s "Maximum incoming record payload length is 2048" \ |
| 2954 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2955 | -c "client hello, adding max_fragment_length extension" \ |
| 2956 | -s "found max fragment length extension" \ |
| 2957 | -s "server hello, max_fragment_length extension" \ |
| 2958 | -c "found max_fragment_length extension" |
| 2959 | |
| 2960 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2961 | run_test "Max fragment length: client 2048, server 1024" \ |
| 2962 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 2963 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 2964 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2965 | -c "Maximum incoming record payload length is 2048" \ |
| 2966 | -c "Maximum outgoing record payload length is 2048" \ |
| 2967 | -s "Maximum incoming record payload length is 2048" \ |
| 2968 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2969 | -c "client hello, adding max_fragment_length extension" \ |
| 2970 | -s "found max fragment length extension" \ |
| 2971 | -s "server hello, max_fragment_length extension" \ |
| 2972 | -c "found max_fragment_length extension" |
| 2973 | |
| 2974 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2975 | run_test "Max fragment length: client 2048, server 4096" \ |
| 2976 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2977 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 2978 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2979 | -c "Maximum incoming record payload length is 2048" \ |
| 2980 | -c "Maximum outgoing record payload length is 2048" \ |
| 2981 | -s "Maximum incoming record payload length is 2048" \ |
| 2982 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2983 | -c "client hello, adding max_fragment_length extension" \ |
| 2984 | -s "found max fragment length extension" \ |
| 2985 | -s "server hello, max_fragment_length extension" \ |
| 2986 | -c "found max_fragment_length extension" |
| 2987 | |
| 2988 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2989 | run_test "Max fragment length: client 4096, server 512" \ |
| 2990 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 2991 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 2992 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2993 | -c "Maximum incoming record payload length is 4096" \ |
| 2994 | -c "Maximum outgoing record payload length is 4096" \ |
| 2995 | -s "Maximum incoming record payload length is 4096" \ |
| 2996 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2997 | -c "client hello, adding max_fragment_length extension" \ |
| 2998 | -s "found max fragment length extension" \ |
| 2999 | -s "server hello, max_fragment_length extension" \ |
| 3000 | -c "found max_fragment_length extension" |
| 3001 | |
| 3002 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3003 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3004 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3005 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3006 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3007 | -c "Maximum incoming record payload length is 4096" \ |
| 3008 | -c "Maximum outgoing record payload length is 4096" \ |
| 3009 | -s "Maximum incoming record payload length is 4096" \ |
| 3010 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3011 | -c "client hello, adding max_fragment_length extension" \ |
| 3012 | -s "found max fragment length extension" \ |
| 3013 | -s "server hello, max_fragment_length extension" \ |
| 3014 | -c "found max_fragment_length extension" |
| 3015 | |
| 3016 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3017 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3018 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3019 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3020 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3021 | -c "Maximum incoming record payload length is 4096" \ |
| 3022 | -c "Maximum outgoing record payload length is 4096" \ |
| 3023 | -s "Maximum incoming record payload length is 4096" \ |
| 3024 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3025 | -c "client hello, adding max_fragment_length extension" \ |
| 3026 | -s "found max fragment length extension" \ |
| 3027 | -s "server hello, max_fragment_length extension" \ |
| 3028 | -c "found max_fragment_length extension" |
| 3029 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3030 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3031 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3032 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3033 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3034 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3035 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3036 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3037 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3038 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3039 | -C "client hello, adding max_fragment_length extension" \ |
| 3040 | -S "found max fragment length extension" \ |
| 3041 | -S "server hello, max_fragment_length extension" \ |
| 3042 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3043 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3044 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3045 | requires_gnutls |
| 3046 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3047 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3048 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3049 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3050 | -c "Maximum incoming record payload length is 4096" \ |
| 3051 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3052 | -c "client hello, adding max_fragment_length extension" \ |
| 3053 | -c "found max_fragment_length extension" |
| 3054 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3055 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3056 | run_test "Max fragment length: client, message just fits" \ |
| 3057 | "$P_SRV debug_level=3" \ |
| 3058 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3059 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3060 | -c "Maximum incoming record payload length is 2048" \ |
| 3061 | -c "Maximum outgoing record payload length is 2048" \ |
| 3062 | -s "Maximum incoming record payload length is 2048" \ |
| 3063 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3064 | -c "client hello, adding max_fragment_length extension" \ |
| 3065 | -s "found max fragment length extension" \ |
| 3066 | -s "server hello, max_fragment_length extension" \ |
| 3067 | -c "found max_fragment_length extension" \ |
| 3068 | -c "2048 bytes written in 1 fragments" \ |
| 3069 | -s "2048 bytes read" |
| 3070 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3071 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3072 | run_test "Max fragment length: client, larger message" \ |
| 3073 | "$P_SRV debug_level=3" \ |
| 3074 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3075 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3076 | -c "Maximum incoming record payload length is 2048" \ |
| 3077 | -c "Maximum outgoing record payload length is 2048" \ |
| 3078 | -s "Maximum incoming record payload length is 2048" \ |
| 3079 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3080 | -c "client hello, adding max_fragment_length extension" \ |
| 3081 | -s "found max fragment length extension" \ |
| 3082 | -s "server hello, max_fragment_length extension" \ |
| 3083 | -c "found max_fragment_length extension" \ |
| 3084 | -c "2345 bytes written in 2 fragments" \ |
| 3085 | -s "2048 bytes read" \ |
| 3086 | -s "297 bytes read" |
| 3087 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3088 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3089 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3090 | "$P_SRV debug_level=3 dtls=1" \ |
| 3091 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3092 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3093 | -c "Maximum incoming record payload length is 2048" \ |
| 3094 | -c "Maximum outgoing record payload length is 2048" \ |
| 3095 | -s "Maximum incoming record payload length is 2048" \ |
| 3096 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3097 | -c "client hello, adding max_fragment_length extension" \ |
| 3098 | -s "found max fragment length extension" \ |
| 3099 | -s "server hello, max_fragment_length extension" \ |
| 3100 | -c "found max_fragment_length extension" \ |
| 3101 | -c "fragment larger than.*maximum" |
| 3102 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3103 | # Tests for renegotiation |
| 3104 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3105 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3106 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3107 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3108 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3109 | 0 \ |
| 3110 | -C "client hello, adding renegotiation extension" \ |
| 3111 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3112 | -S "found renegotiation extension" \ |
| 3113 | -s "server hello, secure renegotiation extension" \ |
| 3114 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3115 | -C "=> renegotiate" \ |
| 3116 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3117 | -S "write hello request" |
| 3118 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3119 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3120 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3121 | "$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] | 3122 | "$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] | 3123 | 0 \ |
| 3124 | -c "client hello, adding renegotiation extension" \ |
| 3125 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3126 | -s "found renegotiation extension" \ |
| 3127 | -s "server hello, secure renegotiation extension" \ |
| 3128 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3129 | -c "=> renegotiate" \ |
| 3130 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3131 | -S "write hello request" |
| 3132 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3133 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3134 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3135 | "$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] | 3136 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3137 | 0 \ |
| 3138 | -c "client hello, adding renegotiation extension" \ |
| 3139 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3140 | -s "found renegotiation extension" \ |
| 3141 | -s "server hello, secure renegotiation extension" \ |
| 3142 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3143 | -c "=> renegotiate" \ |
| 3144 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3145 | -s "write hello request" |
| 3146 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3147 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3148 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3149 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3150 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3151 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3152 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3153 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3154 | 0 \ |
| 3155 | -c "client hello, adding renegotiation extension" \ |
| 3156 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3157 | -s "found renegotiation extension" \ |
| 3158 | -s "server hello, secure renegotiation extension" \ |
| 3159 | -c "found renegotiation extension" \ |
| 3160 | -c "=> renegotiate" \ |
| 3161 | -s "=> renegotiate" \ |
| 3162 | -S "write hello request" \ |
| 3163 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3164 | |
| 3165 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3166 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
| 3167 | # algorithm stronger than SHA-1 is enabled in config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3168 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3169 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3170 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3171 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3172 | 0 \ |
| 3173 | -c "client hello, adding renegotiation extension" \ |
| 3174 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3175 | -s "found renegotiation extension" \ |
| 3176 | -s "server hello, secure renegotiation extension" \ |
| 3177 | -c "found renegotiation extension" \ |
| 3178 | -c "=> renegotiate" \ |
| 3179 | -s "=> renegotiate" \ |
| 3180 | -s "write hello request" \ |
| 3181 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3182 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3183 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3184 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3185 | "$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] | 3186 | "$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] | 3187 | 0 \ |
| 3188 | -c "client hello, adding renegotiation extension" \ |
| 3189 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3190 | -s "found renegotiation extension" \ |
| 3191 | -s "server hello, secure renegotiation extension" \ |
| 3192 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3193 | -c "=> renegotiate" \ |
| 3194 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3195 | -s "write hello request" |
| 3196 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3197 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3198 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3199 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3200 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3201 | "$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" \ |
| 3202 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3203 | -c "Maximum incoming record payload length is 2048" \ |
| 3204 | -c "Maximum outgoing record payload length is 2048" \ |
| 3205 | -s "Maximum incoming record payload length is 2048" \ |
| 3206 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3207 | -c "client hello, adding max_fragment_length extension" \ |
| 3208 | -s "found max fragment length extension" \ |
| 3209 | -s "server hello, max_fragment_length extension" \ |
| 3210 | -c "found max_fragment_length extension" \ |
| 3211 | -c "client hello, adding renegotiation extension" \ |
| 3212 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3213 | -s "found renegotiation extension" \ |
| 3214 | -s "server hello, secure renegotiation extension" \ |
| 3215 | -c "found renegotiation extension" \ |
| 3216 | -c "=> renegotiate" \ |
| 3217 | -s "=> renegotiate" \ |
| 3218 | -s "write hello request" |
| 3219 | |
| 3220 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3221 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3222 | "$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] | 3223 | "$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] | 3224 | 1 \ |
| 3225 | -c "client hello, adding renegotiation extension" \ |
| 3226 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3227 | -S "found renegotiation extension" \ |
| 3228 | -s "server hello, secure renegotiation extension" \ |
| 3229 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3230 | -c "=> renegotiate" \ |
| 3231 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3232 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3233 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3234 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3235 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3236 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3237 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3238 | "$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] | 3239 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3240 | 0 \ |
| 3241 | -C "client hello, adding renegotiation extension" \ |
| 3242 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3243 | -S "found renegotiation extension" \ |
| 3244 | -s "server hello, secure renegotiation extension" \ |
| 3245 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3246 | -C "=> renegotiate" \ |
| 3247 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3248 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3249 | -S "SSL - An unexpected message was received from our peer" \ |
| 3250 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3251 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3252 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3253 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3254 | "$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] | 3255 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3256 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3257 | 0 \ |
| 3258 | -C "client hello, adding renegotiation extension" \ |
| 3259 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3260 | -S "found renegotiation extension" \ |
| 3261 | -s "server hello, secure renegotiation extension" \ |
| 3262 | -c "found renegotiation extension" \ |
| 3263 | -C "=> renegotiate" \ |
| 3264 | -S "=> renegotiate" \ |
| 3265 | -s "write hello request" \ |
| 3266 | -S "SSL - An unexpected message was received from our peer" \ |
| 3267 | -S "failed" |
| 3268 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3269 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3270 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3271 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3272 | "$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] | 3273 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3274 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3275 | 0 \ |
| 3276 | -C "client hello, adding renegotiation extension" \ |
| 3277 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3278 | -S "found renegotiation extension" \ |
| 3279 | -s "server hello, secure renegotiation extension" \ |
| 3280 | -c "found renegotiation extension" \ |
| 3281 | -C "=> renegotiate" \ |
| 3282 | -S "=> renegotiate" \ |
| 3283 | -s "write hello request" \ |
| 3284 | -S "SSL - An unexpected message was received from our peer" \ |
| 3285 | -S "failed" |
| 3286 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3287 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3288 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3289 | "$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] | 3290 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3291 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3292 | 0 \ |
| 3293 | -C "client hello, adding renegotiation extension" \ |
| 3294 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3295 | -S "found renegotiation extension" \ |
| 3296 | -s "server hello, secure renegotiation extension" \ |
| 3297 | -c "found renegotiation extension" \ |
| 3298 | -C "=> renegotiate" \ |
| 3299 | -S "=> renegotiate" \ |
| 3300 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3301 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3302 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3303 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3304 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3305 | "$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] | 3306 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3307 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3308 | 0 \ |
| 3309 | -c "client hello, adding renegotiation extension" \ |
| 3310 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3311 | -s "found renegotiation extension" \ |
| 3312 | -s "server hello, secure renegotiation extension" \ |
| 3313 | -c "found renegotiation extension" \ |
| 3314 | -c "=> renegotiate" \ |
| 3315 | -s "=> renegotiate" \ |
| 3316 | -s "write hello request" \ |
| 3317 | -S "SSL - An unexpected message was received from our peer" \ |
| 3318 | -S "failed" |
| 3319 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3320 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3321 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3322 | "$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] | 3323 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3324 | 0 \ |
| 3325 | -C "client hello, adding renegotiation extension" \ |
| 3326 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3327 | -S "found renegotiation extension" \ |
| 3328 | -s "server hello, secure renegotiation extension" \ |
| 3329 | -c "found renegotiation extension" \ |
| 3330 | -S "record counter limit reached: renegotiate" \ |
| 3331 | -C "=> renegotiate" \ |
| 3332 | -S "=> renegotiate" \ |
| 3333 | -S "write hello request" \ |
| 3334 | -S "SSL - An unexpected message was received from our peer" \ |
| 3335 | -S "failed" |
| 3336 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3337 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3338 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3339 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3340 | "$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] | 3341 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3342 | 0 \ |
| 3343 | -c "client hello, adding renegotiation extension" \ |
| 3344 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3345 | -s "found renegotiation extension" \ |
| 3346 | -s "server hello, secure renegotiation extension" \ |
| 3347 | -c "found renegotiation extension" \ |
| 3348 | -s "record counter limit reached: renegotiate" \ |
| 3349 | -c "=> renegotiate" \ |
| 3350 | -s "=> renegotiate" \ |
| 3351 | -s "write hello request" \ |
| 3352 | -S "SSL - An unexpected message was received from our peer" \ |
| 3353 | -S "failed" |
| 3354 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3355 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3356 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3357 | "$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] | 3358 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3359 | 0 \ |
| 3360 | -c "client hello, adding renegotiation extension" \ |
| 3361 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3362 | -s "found renegotiation extension" \ |
| 3363 | -s "server hello, secure renegotiation extension" \ |
| 3364 | -c "found renegotiation extension" \ |
| 3365 | -s "record counter limit reached: renegotiate" \ |
| 3366 | -c "=> renegotiate" \ |
| 3367 | -s "=> renegotiate" \ |
| 3368 | -s "write hello request" \ |
| 3369 | -S "SSL - An unexpected message was received from our peer" \ |
| 3370 | -S "failed" |
| 3371 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3372 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3373 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3374 | "$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] | 3375 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3376 | 0 \ |
| 3377 | -C "client hello, adding renegotiation extension" \ |
| 3378 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3379 | -S "found renegotiation extension" \ |
| 3380 | -s "server hello, secure renegotiation extension" \ |
| 3381 | -c "found renegotiation extension" \ |
| 3382 | -S "record counter limit reached: renegotiate" \ |
| 3383 | -C "=> renegotiate" \ |
| 3384 | -S "=> renegotiate" \ |
| 3385 | -S "write hello request" \ |
| 3386 | -S "SSL - An unexpected message was received from our peer" \ |
| 3387 | -S "failed" |
| 3388 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3390 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3391 | "$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] | 3392 | "$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] | 3393 | 0 \ |
| 3394 | -c "client hello, adding renegotiation extension" \ |
| 3395 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3396 | -s "found renegotiation extension" \ |
| 3397 | -s "server hello, secure renegotiation extension" \ |
| 3398 | -c "found renegotiation extension" \ |
| 3399 | -c "=> renegotiate" \ |
| 3400 | -s "=> renegotiate" \ |
| 3401 | -S "write hello request" |
| 3402 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3403 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3404 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3405 | "$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] | 3406 | "$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] | 3407 | 0 \ |
| 3408 | -c "client hello, adding renegotiation extension" \ |
| 3409 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3410 | -s "found renegotiation extension" \ |
| 3411 | -s "server hello, secure renegotiation extension" \ |
| 3412 | -c "found renegotiation extension" \ |
| 3413 | -c "=> renegotiate" \ |
| 3414 | -s "=> renegotiate" \ |
| 3415 | -s "write hello request" |
| 3416 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3417 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3418 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3419 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3420 | "$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] | 3421 | 0 \ |
| 3422 | -c "client hello, adding renegotiation extension" \ |
| 3423 | -c "found renegotiation extension" \ |
| 3424 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3425 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3426 | -C "error" \ |
| 3427 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3428 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3429 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3430 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3431 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3432 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3433 | "$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] | 3434 | 0 \ |
| 3435 | -c "client hello, adding renegotiation extension" \ |
| 3436 | -c "found renegotiation extension" \ |
| 3437 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3438 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3439 | -C "error" \ |
| 3440 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3441 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3442 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3443 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3444 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3445 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3446 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3447 | 1 \ |
| 3448 | -c "client hello, adding renegotiation extension" \ |
| 3449 | -C "found renegotiation extension" \ |
| 3450 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3451 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3452 | -c "error" \ |
| 3453 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3454 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3455 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3456 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3457 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3458 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3459 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3460 | allow_legacy=0" \ |
| 3461 | 1 \ |
| 3462 | -c "client hello, adding renegotiation extension" \ |
| 3463 | -C "found renegotiation extension" \ |
| 3464 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3465 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3466 | -c "error" \ |
| 3467 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3468 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3469 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3471 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3472 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3473 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3474 | allow_legacy=1" \ |
| 3475 | 0 \ |
| 3476 | -c "client hello, adding renegotiation extension" \ |
| 3477 | -C "found renegotiation extension" \ |
| 3478 | -c "=> renegotiate" \ |
| 3479 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3480 | -C "error" \ |
| 3481 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3482 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3483 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3484 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3485 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3486 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3487 | 0 \ |
| 3488 | -c "client hello, adding renegotiation extension" \ |
| 3489 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3490 | -s "found renegotiation extension" \ |
| 3491 | -s "server hello, secure renegotiation extension" \ |
| 3492 | -c "found renegotiation extension" \ |
| 3493 | -c "=> renegotiate" \ |
| 3494 | -s "=> renegotiate" \ |
| 3495 | -S "write hello request" |
| 3496 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3497 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3498 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3499 | "$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] | 3500 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3501 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3502 | 0 \ |
| 3503 | -c "client hello, adding renegotiation extension" \ |
| 3504 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3505 | -s "found renegotiation extension" \ |
| 3506 | -s "server hello, secure renegotiation extension" \ |
| 3507 | -c "found renegotiation extension" \ |
| 3508 | -c "=> renegotiate" \ |
| 3509 | -s "=> renegotiate" \ |
| 3510 | -s "write hello request" |
| 3511 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3512 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3513 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3514 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3515 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3516 | 0 \ |
| 3517 | -c "client hello, adding renegotiation extension" \ |
| 3518 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3519 | -s "found renegotiation extension" \ |
| 3520 | -s "server hello, secure renegotiation extension" \ |
| 3521 | -s "record counter limit reached: renegotiate" \ |
| 3522 | -c "=> renegotiate" \ |
| 3523 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3524 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3525 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3526 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3527 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3528 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3529 | "$G_SRV -u --mtu 4096" \ |
| 3530 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3531 | 0 \ |
| 3532 | -c "client hello, adding renegotiation extension" \ |
| 3533 | -c "found renegotiation extension" \ |
| 3534 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3535 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3536 | -C "error" \ |
| 3537 | -s "Extra-header:" |
| 3538 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3539 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3540 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3541 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3542 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3543 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3544 | "$P_CLI debug_level=3" \ |
| 3545 | 0 \ |
| 3546 | -c "found renegotiation extension" \ |
| 3547 | -C "error" \ |
| 3548 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3549 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3550 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3551 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3552 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3553 | "$P_CLI debug_level=3" \ |
| 3554 | 0 \ |
| 3555 | -C "found renegotiation extension" \ |
| 3556 | -C "error" \ |
| 3557 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3558 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3559 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3560 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3561 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3562 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3563 | 1 \ |
| 3564 | -C "found renegotiation extension" \ |
| 3565 | -c "error" \ |
| 3566 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3567 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3568 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3569 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3570 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3571 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3572 | 0 \ |
| 3573 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3574 | -s "server hello, secure renegotiation extension" |
| 3575 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3576 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3577 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3578 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3579 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3580 | 0 \ |
| 3581 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3582 | -S "server hello, secure renegotiation extension" |
| 3583 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3584 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3585 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3586 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3587 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3588 | 1 \ |
| 3589 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3590 | -S "server hello, secure renegotiation extension" |
| 3591 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3592 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3593 | |
| 3594 | requires_gnutls |
| 3595 | run_test "DER format: no trailing bytes" \ |
| 3596 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3597 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3598 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3599 | 0 \ |
| 3600 | -c "Handshake was completed" \ |
| 3601 | |
| 3602 | requires_gnutls |
| 3603 | run_test "DER format: with a trailing zero byte" \ |
| 3604 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3605 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3606 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3607 | 0 \ |
| 3608 | -c "Handshake was completed" \ |
| 3609 | |
| 3610 | requires_gnutls |
| 3611 | run_test "DER format: with a trailing random byte" \ |
| 3612 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3613 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3614 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3615 | 0 \ |
| 3616 | -c "Handshake was completed" \ |
| 3617 | |
| 3618 | requires_gnutls |
| 3619 | run_test "DER format: with 2 trailing random bytes" \ |
| 3620 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3621 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3622 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3623 | 0 \ |
| 3624 | -c "Handshake was completed" \ |
| 3625 | |
| 3626 | requires_gnutls |
| 3627 | run_test "DER format: with 4 trailing random bytes" \ |
| 3628 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3629 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3630 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3631 | 0 \ |
| 3632 | -c "Handshake was completed" \ |
| 3633 | |
| 3634 | requires_gnutls |
| 3635 | run_test "DER format: with 8 trailing random bytes" \ |
| 3636 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3637 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3638 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3639 | 0 \ |
| 3640 | -c "Handshake was completed" \ |
| 3641 | |
| 3642 | requires_gnutls |
| 3643 | run_test "DER format: with 9 trailing random bytes" \ |
| 3644 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3645 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3646 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3647 | 0 \ |
| 3648 | -c "Handshake was completed" \ |
| 3649 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3650 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3651 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3652 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3653 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3654 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3655 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3656 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3657 | 1 \ |
| 3658 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3659 | -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] | 3660 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3661 | -c "X509 - Certificate verification failed" |
| 3662 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3663 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3664 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3665 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3666 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3667 | 0 \ |
| 3668 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3669 | -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] | 3670 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3671 | -C "X509 - Certificate verification failed" |
| 3672 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3673 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3674 | "$P_SRV" \ |
| 3675 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3676 | 0 \ |
| 3677 | -c "x509_verify_cert() returned" \ |
| 3678 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3679 | -c "! Certificate verification flags"\ |
| 3680 | -C "! mbedtls_ssl_handshake returned" \ |
| 3681 | -C "X509 - Certificate verification failed" \ |
| 3682 | -C "SSL - No CA Chain is set, but required to operate" |
| 3683 | |
| 3684 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3685 | "$P_SRV" \ |
| 3686 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3687 | 1 \ |
| 3688 | -c "x509_verify_cert() returned" \ |
| 3689 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3690 | -c "! Certificate verification flags"\ |
| 3691 | -c "! mbedtls_ssl_handshake returned" \ |
| 3692 | -c "SSL - No CA Chain is set, but required to operate" |
| 3693 | |
| 3694 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3695 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3696 | # the client informs the server about the supported curves - it does, though, in the |
| 3697 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3698 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3699 | # different means to have the server ignoring the client's supported curve list. |
| 3700 | |
| 3701 | requires_config_enabled MBEDTLS_ECP_C |
| 3702 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3703 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3704 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3705 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3706 | 1 \ |
| 3707 | -c "bad certificate (EC key curve)"\ |
| 3708 | -c "! Certificate verification flags"\ |
| 3709 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3710 | |
| 3711 | requires_config_enabled MBEDTLS_ECP_C |
| 3712 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3713 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3714 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3715 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3716 | 1 \ |
| 3717 | -c "bad certificate (EC key curve)"\ |
| 3718 | -c "! Certificate verification flags"\ |
| 3719 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3720 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3721 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3722 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3723 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3724 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3725 | 0 \ |
| 3726 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3727 | -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] | 3728 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3729 | -C "X509 - Certificate verification failed" |
| 3730 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3731 | run_test "Authentication: client SHA256, server required" \ |
| 3732 | "$P_SRV auth_mode=required" \ |
| 3733 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3734 | key_file=data_files/server6.key \ |
| 3735 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3736 | 0 \ |
| 3737 | -c "Supported Signature Algorithm found: 4," \ |
| 3738 | -c "Supported Signature Algorithm found: 5," |
| 3739 | |
| 3740 | run_test "Authentication: client SHA384, server required" \ |
| 3741 | "$P_SRV auth_mode=required" \ |
| 3742 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3743 | key_file=data_files/server6.key \ |
| 3744 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3745 | 0 \ |
| 3746 | -c "Supported Signature Algorithm found: 4," \ |
| 3747 | -c "Supported Signature Algorithm found: 5," |
| 3748 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3749 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3750 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3751 | "$P_CLI debug_level=3 crt_file=none \ |
| 3752 | key_file=data_files/server5.key" \ |
| 3753 | 1 \ |
| 3754 | -S "skip write certificate request" \ |
| 3755 | -C "skip parse certificate request" \ |
| 3756 | -c "got a certificate request" \ |
| 3757 | -c "= write certificate$" \ |
| 3758 | -C "skip write certificate$" \ |
| 3759 | -S "x509_verify_cert() returned" \ |
| 3760 | -s "client has no certificate" \ |
| 3761 | -s "! mbedtls_ssl_handshake returned" \ |
| 3762 | -c "! mbedtls_ssl_handshake returned" \ |
| 3763 | -s "No client certification received from the client, but required by the authentication mode" |
| 3764 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3765 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3766 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3767 | "$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] | 3768 | key_file=data_files/server5.key" \ |
| 3769 | 1 \ |
| 3770 | -S "skip write certificate request" \ |
| 3771 | -C "skip parse certificate request" \ |
| 3772 | -c "got a certificate request" \ |
| 3773 | -C "skip write certificate" \ |
| 3774 | -C "skip write certificate verify" \ |
| 3775 | -S "skip parse certificate verify" \ |
| 3776 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3777 | -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] | 3778 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3779 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3780 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3781 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3782 | # We don't check that the client receives the alert because it might |
| 3783 | # detect that its write end of the connection is closed and abort |
| 3784 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3785 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3786 | run_test "Authentication: client cert not trusted, server required" \ |
| 3787 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3788 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3789 | key_file=data_files/server5.key" \ |
| 3790 | 1 \ |
| 3791 | -S "skip write certificate request" \ |
| 3792 | -C "skip parse certificate request" \ |
| 3793 | -c "got a certificate request" \ |
| 3794 | -C "skip write certificate" \ |
| 3795 | -C "skip write certificate verify" \ |
| 3796 | -S "skip parse certificate verify" \ |
| 3797 | -s "x509_verify_cert() returned" \ |
| 3798 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3799 | -s "! mbedtls_ssl_handshake returned" \ |
| 3800 | -c "! mbedtls_ssl_handshake returned" \ |
| 3801 | -s "X509 - Certificate verification failed" |
| 3802 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3803 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3804 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3805 | "$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] | 3806 | key_file=data_files/server5.key" \ |
| 3807 | 0 \ |
| 3808 | -S "skip write certificate request" \ |
| 3809 | -C "skip parse certificate request" \ |
| 3810 | -c "got a certificate request" \ |
| 3811 | -C "skip write certificate" \ |
| 3812 | -C "skip write certificate verify" \ |
| 3813 | -S "skip parse certificate verify" \ |
| 3814 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3815 | -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] | 3816 | -S "! mbedtls_ssl_handshake returned" \ |
| 3817 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3818 | -S "X509 - Certificate verification failed" |
| 3819 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3820 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3821 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3822 | "$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] | 3823 | key_file=data_files/server5.key" \ |
| 3824 | 0 \ |
| 3825 | -s "skip write certificate request" \ |
| 3826 | -C "skip parse certificate request" \ |
| 3827 | -c "got no certificate request" \ |
| 3828 | -c "skip write certificate" \ |
| 3829 | -c "skip write certificate verify" \ |
| 3830 | -s "skip parse certificate verify" \ |
| 3831 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3832 | -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] | 3833 | -S "! mbedtls_ssl_handshake returned" \ |
| 3834 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3835 | -S "X509 - Certificate verification failed" |
| 3836 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3837 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3838 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3839 | "$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] | 3840 | 0 \ |
| 3841 | -S "skip write certificate request" \ |
| 3842 | -C "skip parse certificate request" \ |
| 3843 | -c "got a certificate request" \ |
| 3844 | -C "skip write certificate$" \ |
| 3845 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3846 | -c "skip write certificate verify" \ |
| 3847 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3848 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3849 | -S "! mbedtls_ssl_handshake returned" \ |
| 3850 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3851 | -S "X509 - Certificate verification failed" |
| 3852 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3853 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3854 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3855 | "$O_CLI" \ |
| 3856 | 0 \ |
| 3857 | -S "skip write certificate request" \ |
| 3858 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3859 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3860 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3861 | -S "X509 - Certificate verification failed" |
| 3862 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3863 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3864 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3865 | "$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] | 3866 | 0 \ |
| 3867 | -C "skip parse certificate request" \ |
| 3868 | -c "got a certificate request" \ |
| 3869 | -C "skip write certificate$" \ |
| 3870 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3871 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3872 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3873 | run_test "Authentication: client no cert, openssl server required" \ |
| 3874 | "$O_SRV -Verify 10" \ |
| 3875 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3876 | 1 \ |
| 3877 | -C "skip parse certificate request" \ |
| 3878 | -c "got a certificate request" \ |
| 3879 | -C "skip write certificate$" \ |
| 3880 | -c "skip write certificate verify" \ |
| 3881 | -c "! mbedtls_ssl_handshake returned" |
| 3882 | |
Manuel Pégourié-Gonnard | 9107b5f | 2017-07-06 12:16:25 +0200 | [diff] [blame] | 3883 | # The "max_int chain" tests assume that MAX_INTERMEDIATE_CA is set to its |
| 3884 | # default value (8) |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3885 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3886 | MAX_IM_CA='8' |
Gilles Peskine | 5d46f6a | 2019-07-27 23:52:53 +0200 | [diff] [blame] | 3887 | 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] | 3888 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3889 | 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] | 3890 | cat <<EOF |
| 3891 | ${CONFIG_H} contains a value for the configuration of |
| 3892 | MBEDTLS_X509_MAX_INTERMEDIATE_CA that is different from the script's |
| 3893 | test value of ${MAX_IM_CA}. |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3894 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 3895 | The tests assume this value and if it changes, the tests in this |
| 3896 | script should also be adjusted. |
| 3897 | EOF |
Simon Butcher | 06b7863 | 2017-07-28 01:00:17 +0100 | [diff] [blame] | 3898 | exit 1 |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3899 | fi |
| 3900 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3901 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3902 | run_test "Authentication: server max_int chain, client default" \ |
| 3903 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3904 | key_file=data_files/dir-maxpath/09.key" \ |
| 3905 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3906 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3907 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3908 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3909 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3910 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3911 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3912 | key_file=data_files/dir-maxpath/10.key" \ |
| 3913 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3914 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3915 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3916 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3917 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3918 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 3919 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3920 | key_file=data_files/dir-maxpath/10.key" \ |
| 3921 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3922 | auth_mode=optional" \ |
| 3923 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3924 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3925 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3926 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3927 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 3928 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3929 | key_file=data_files/dir-maxpath/10.key" \ |
| 3930 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3931 | auth_mode=none" \ |
| 3932 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3933 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3934 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3935 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3936 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 3937 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 3938 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3939 | key_file=data_files/dir-maxpath/10.key" \ |
| 3940 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3941 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3942 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3943 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3944 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 3945 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3946 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3947 | key_file=data_files/dir-maxpath/10.key" \ |
| 3948 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3949 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3950 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3951 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3952 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 3953 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3954 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3955 | key_file=data_files/dir-maxpath/10.key" \ |
| 3956 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3957 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3958 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3959 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3960 | run_test "Authentication: client max_int chain, server required" \ |
| 3961 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3962 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3963 | key_file=data_files/dir-maxpath/09.key" \ |
| 3964 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3965 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3966 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3967 | # Tests for CA list in CertificateRequest messages |
| 3968 | |
| 3969 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3970 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3971 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3972 | key_file=data_files/server6.key" \ |
| 3973 | 0 \ |
| 3974 | -s "requested DN" |
| 3975 | |
| 3976 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 3977 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3978 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3979 | key_file=data_files/server6.key" \ |
| 3980 | 0 \ |
| 3981 | -S "requested DN" |
| 3982 | |
| 3983 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 3984 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 3985 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3986 | key_file=data_files/server5.key" \ |
| 3987 | 1 \ |
| 3988 | -S "requested DN" \ |
| 3989 | -s "x509_verify_cert() returned" \ |
| 3990 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3991 | -s "! mbedtls_ssl_handshake returned" \ |
| 3992 | -c "! mbedtls_ssl_handshake returned" \ |
| 3993 | -s "X509 - Certificate verification failed" |
| 3994 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3995 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 3996 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 3997 | |
| 3998 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 3999 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4000 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4001 | key_file=data_files/server5.key" \ |
| 4002 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4003 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4004 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4005 | -c "x509_verify_cert() returned" \ |
| 4006 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4007 | -c "! mbedtls_ssl_handshake returned" \ |
| 4008 | -c "X509 - Certificate verification failed" |
| 4009 | |
| 4010 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4011 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4012 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4013 | key_file=data_files/server5.key" \ |
| 4014 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4015 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4016 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4017 | -c "x509_verify_cert() returned" \ |
| 4018 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4019 | -C "! mbedtls_ssl_handshake returned" \ |
| 4020 | -C "X509 - Certificate verification failed" |
| 4021 | |
| 4022 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4023 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4024 | # the client informs the server about the supported curves - it does, though, in the |
| 4025 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4026 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4027 | # different means to have the server ignoring the client's supported curve list. |
| 4028 | |
| 4029 | requires_config_enabled MBEDTLS_ECP_C |
| 4030 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4031 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4032 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4033 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4034 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4035 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4036 | -c "use CA callback for X.509 CRT verification" \ |
| 4037 | -c "bad certificate (EC key curve)" \ |
| 4038 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4039 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4040 | |
| 4041 | requires_config_enabled MBEDTLS_ECP_C |
| 4042 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4043 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4044 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4045 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4046 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4047 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4048 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4049 | -c "bad certificate (EC key curve)"\ |
| 4050 | -c "! Certificate verification flags"\ |
| 4051 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4052 | |
| 4053 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4054 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4055 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4056 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4057 | key_file=data_files/server6.key \ |
| 4058 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4059 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4060 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4061 | -c "Supported Signature Algorithm found: 4," \ |
| 4062 | -c "Supported Signature Algorithm found: 5," |
| 4063 | |
| 4064 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4065 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4066 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4067 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4068 | key_file=data_files/server6.key \ |
| 4069 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4070 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4071 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4072 | -c "Supported Signature Algorithm found: 4," \ |
| 4073 | -c "Supported Signature Algorithm found: 5," |
| 4074 | |
| 4075 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4076 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4077 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4078 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4079 | key_file=data_files/server5.key" \ |
| 4080 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4081 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4082 | -S "skip write certificate request" \ |
| 4083 | -C "skip parse certificate request" \ |
| 4084 | -c "got a certificate request" \ |
| 4085 | -C "skip write certificate" \ |
| 4086 | -C "skip write certificate verify" \ |
| 4087 | -S "skip parse certificate verify" \ |
| 4088 | -s "x509_verify_cert() returned" \ |
| 4089 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4090 | -s "! mbedtls_ssl_handshake returned" \ |
| 4091 | -s "send alert level=2 message=48" \ |
| 4092 | -c "! mbedtls_ssl_handshake returned" \ |
| 4093 | -s "X509 - Certificate verification failed" |
| 4094 | # We don't check that the client receives the alert because it might |
| 4095 | # detect that its write end of the connection is closed and abort |
| 4096 | # before reading the alert message. |
| 4097 | |
| 4098 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4099 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4100 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4101 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4102 | key_file=data_files/server5.key" \ |
| 4103 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4104 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4105 | -S "skip write certificate request" \ |
| 4106 | -C "skip parse certificate request" \ |
| 4107 | -c "got a certificate request" \ |
| 4108 | -C "skip write certificate" \ |
| 4109 | -C "skip write certificate verify" \ |
| 4110 | -S "skip parse certificate verify" \ |
| 4111 | -s "x509_verify_cert() returned" \ |
| 4112 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4113 | -s "! mbedtls_ssl_handshake returned" \ |
| 4114 | -c "! mbedtls_ssl_handshake returned" \ |
| 4115 | -s "X509 - Certificate verification failed" |
| 4116 | |
| 4117 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4118 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4119 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4120 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4121 | key_file=data_files/server5.key" \ |
| 4122 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4123 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4124 | -S "skip write certificate request" \ |
| 4125 | -C "skip parse certificate request" \ |
| 4126 | -c "got a certificate request" \ |
| 4127 | -C "skip write certificate" \ |
| 4128 | -C "skip write certificate verify" \ |
| 4129 | -S "skip parse certificate verify" \ |
| 4130 | -s "x509_verify_cert() returned" \ |
| 4131 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4132 | -S "! mbedtls_ssl_handshake returned" \ |
| 4133 | -C "! mbedtls_ssl_handshake returned" \ |
| 4134 | -S "X509 - Certificate verification failed" |
| 4135 | |
| 4136 | requires_full_size_output_buffer |
| 4137 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4138 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4139 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4140 | key_file=data_files/dir-maxpath/09.key" \ |
| 4141 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4142 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4143 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4144 | -C "X509 - A fatal error occurred" |
| 4145 | |
| 4146 | requires_full_size_output_buffer |
| 4147 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4148 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4149 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4150 | key_file=data_files/dir-maxpath/10.key" \ |
| 4151 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4152 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4153 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4154 | -c "X509 - A fatal error occurred" |
| 4155 | |
| 4156 | requires_full_size_output_buffer |
| 4157 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4158 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4159 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4160 | key_file=data_files/dir-maxpath/10.key" \ |
| 4161 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4162 | debug_level=3 auth_mode=optional" \ |
| 4163 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4164 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4165 | -c "X509 - A fatal error occurred" |
| 4166 | |
| 4167 | requires_full_size_output_buffer |
| 4168 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4169 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4170 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4171 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4172 | key_file=data_files/dir-maxpath/10.key" \ |
| 4173 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4174 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4175 | -s "X509 - A fatal error occurred" |
| 4176 | |
| 4177 | requires_full_size_output_buffer |
| 4178 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4179 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4180 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4181 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4182 | key_file=data_files/dir-maxpath/10.key" \ |
| 4183 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4184 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4185 | -s "X509 - A fatal error occurred" |
| 4186 | |
| 4187 | requires_full_size_output_buffer |
| 4188 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4189 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4190 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4191 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4192 | key_file=data_files/dir-maxpath/09.key" \ |
| 4193 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4194 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4195 | -S "X509 - A fatal error occurred" |
| 4196 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4197 | # Tests for certificate selection based on SHA verson |
| 4198 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4199 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4200 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4201 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4202 | key_file=data_files/server5.key \ |
| 4203 | crt_file2=data_files/server5-sha1.crt \ |
| 4204 | key_file2=data_files/server5.key" \ |
| 4205 | "$P_CLI force_version=tls1_2" \ |
| 4206 | 0 \ |
| 4207 | -c "signed using.*ECDSA with SHA256" \ |
| 4208 | -C "signed using.*ECDSA with SHA1" |
| 4209 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4210 | # tests for SNI |
| 4211 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4212 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4213 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4214 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4215 | 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] | 4216 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4217 | 0 \ |
| 4218 | -S "parse ServerName extension" \ |
| 4219 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4220 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4221 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4222 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4223 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4224 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4225 | 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] | 4226 | 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] | 4227 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4228 | 0 \ |
| 4229 | -s "parse ServerName extension" \ |
| 4230 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4231 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4232 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4233 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4234 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4235 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4236 | 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] | 4237 | 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] | 4238 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4239 | 0 \ |
| 4240 | -s "parse ServerName extension" \ |
| 4241 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4242 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4243 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4244 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4245 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4246 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4247 | 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] | 4248 | 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] | 4249 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4250 | 1 \ |
| 4251 | -s "parse ServerName extension" \ |
| 4252 | -s "ssl_sni_wrapper() returned" \ |
| 4253 | -s "mbedtls_ssl_handshake returned" \ |
| 4254 | -c "mbedtls_ssl_handshake returned" \ |
| 4255 | -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] | 4256 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4257 | run_test "SNI: client auth no override: optional" \ |
| 4258 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4259 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4260 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4261 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4262 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4263 | -S "skip write certificate request" \ |
| 4264 | -C "skip parse certificate request" \ |
| 4265 | -c "got a certificate request" \ |
| 4266 | -C "skip write certificate" \ |
| 4267 | -C "skip write certificate verify" \ |
| 4268 | -S "skip parse certificate verify" |
| 4269 | |
| 4270 | run_test "SNI: client auth override: none -> optional" \ |
| 4271 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4272 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4273 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4274 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4275 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4276 | -S "skip write certificate request" \ |
| 4277 | -C "skip parse certificate request" \ |
| 4278 | -c "got a certificate request" \ |
| 4279 | -C "skip write certificate" \ |
| 4280 | -C "skip write certificate verify" \ |
| 4281 | -S "skip parse certificate verify" |
| 4282 | |
| 4283 | run_test "SNI: client auth override: optional -> none" \ |
| 4284 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4285 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4286 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4287 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4288 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4289 | -s "skip write certificate request" \ |
| 4290 | -C "skip parse certificate request" \ |
| 4291 | -c "got no certificate request" \ |
| 4292 | -c "skip write certificate" \ |
| 4293 | -c "skip write certificate verify" \ |
| 4294 | -s "skip parse certificate verify" |
| 4295 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4296 | run_test "SNI: CA no override" \ |
| 4297 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4298 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4299 | ca_file=data_files/test-ca.crt \ |
| 4300 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4301 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4302 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4303 | 1 \ |
| 4304 | -S "skip write certificate request" \ |
| 4305 | -C "skip parse certificate request" \ |
| 4306 | -c "got a certificate request" \ |
| 4307 | -C "skip write certificate" \ |
| 4308 | -C "skip write certificate verify" \ |
| 4309 | -S "skip parse certificate verify" \ |
| 4310 | -s "x509_verify_cert() returned" \ |
| 4311 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4312 | -S "The certificate has been revoked (is on a CRL)" |
| 4313 | |
| 4314 | run_test "SNI: CA override" \ |
| 4315 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4316 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4317 | ca_file=data_files/test-ca.crt \ |
| 4318 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4319 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4320 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4321 | 0 \ |
| 4322 | -S "skip write certificate request" \ |
| 4323 | -C "skip parse certificate request" \ |
| 4324 | -c "got a certificate request" \ |
| 4325 | -C "skip write certificate" \ |
| 4326 | -C "skip write certificate verify" \ |
| 4327 | -S "skip parse certificate verify" \ |
| 4328 | -S "x509_verify_cert() returned" \ |
| 4329 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4330 | -S "The certificate has been revoked (is on a CRL)" |
| 4331 | |
| 4332 | run_test "SNI: CA override with CRL" \ |
| 4333 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4334 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4335 | ca_file=data_files/test-ca.crt \ |
| 4336 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4337 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4338 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4339 | 1 \ |
| 4340 | -S "skip write certificate request" \ |
| 4341 | -C "skip parse certificate request" \ |
| 4342 | -c "got a certificate request" \ |
| 4343 | -C "skip write certificate" \ |
| 4344 | -C "skip write certificate verify" \ |
| 4345 | -S "skip parse certificate verify" \ |
| 4346 | -s "x509_verify_cert() returned" \ |
| 4347 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4348 | -s "The certificate has been revoked (is on a CRL)" |
| 4349 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4350 | # Tests for SNI and DTLS |
| 4351 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4352 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4353 | run_test "SNI: DTLS, no SNI callback" \ |
| 4354 | "$P_SRV debug_level=3 dtls=1 \ |
| 4355 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4356 | "$P_CLI server_name=localhost dtls=1" \ |
| 4357 | 0 \ |
| 4358 | -S "parse ServerName extension" \ |
| 4359 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4360 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4361 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4362 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4363 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4364 | "$P_SRV debug_level=3 dtls=1 \ |
| 4365 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4366 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4367 | "$P_CLI server_name=localhost dtls=1" \ |
| 4368 | 0 \ |
| 4369 | -s "parse ServerName extension" \ |
| 4370 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4371 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4372 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4373 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4374 | run_test "SNI: DTLS, matching cert 2" \ |
| 4375 | "$P_SRV debug_level=3 dtls=1 \ |
| 4376 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4377 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4378 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4379 | 0 \ |
| 4380 | -s "parse ServerName extension" \ |
| 4381 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4382 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4383 | |
| 4384 | run_test "SNI: DTLS, no matching cert" \ |
| 4385 | "$P_SRV debug_level=3 dtls=1 \ |
| 4386 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4387 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4388 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4389 | 1 \ |
| 4390 | -s "parse ServerName extension" \ |
| 4391 | -s "ssl_sni_wrapper() returned" \ |
| 4392 | -s "mbedtls_ssl_handshake returned" \ |
| 4393 | -c "mbedtls_ssl_handshake returned" \ |
| 4394 | -c "SSL - A fatal alert message was received from our peer" |
| 4395 | |
| 4396 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4397 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4398 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4399 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4400 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4401 | 0 \ |
| 4402 | -S "skip write certificate request" \ |
| 4403 | -C "skip parse certificate request" \ |
| 4404 | -c "got a certificate request" \ |
| 4405 | -C "skip write certificate" \ |
| 4406 | -C "skip write certificate verify" \ |
| 4407 | -S "skip parse certificate verify" |
| 4408 | |
| 4409 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4410 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4411 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4412 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4413 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4414 | 0 \ |
| 4415 | -S "skip write certificate request" \ |
| 4416 | -C "skip parse certificate request" \ |
| 4417 | -c "got a certificate request" \ |
| 4418 | -C "skip write certificate" \ |
| 4419 | -C "skip write certificate verify" \ |
| 4420 | -S "skip parse certificate verify" |
| 4421 | |
| 4422 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4423 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4424 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4425 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4426 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4427 | 0 \ |
| 4428 | -s "skip write certificate request" \ |
| 4429 | -C "skip parse certificate request" \ |
| 4430 | -c "got no certificate request" \ |
| 4431 | -c "skip write certificate" \ |
| 4432 | -c "skip write certificate verify" \ |
| 4433 | -s "skip parse certificate verify" |
| 4434 | |
| 4435 | run_test "SNI: DTLS, CA no override" \ |
| 4436 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4437 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4438 | ca_file=data_files/test-ca.crt \ |
| 4439 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4440 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4441 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4442 | 1 \ |
| 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 "The certificate has been revoked (is on a CRL)" |
| 4452 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4453 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4454 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4455 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4456 | ca_file=data_files/test-ca.crt \ |
| 4457 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4458 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4459 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4460 | 0 \ |
| 4461 | -S "skip write certificate request" \ |
| 4462 | -C "skip parse certificate request" \ |
| 4463 | -c "got a certificate request" \ |
| 4464 | -C "skip write certificate" \ |
| 4465 | -C "skip write certificate verify" \ |
| 4466 | -S "skip parse certificate verify" \ |
| 4467 | -S "x509_verify_cert() returned" \ |
| 4468 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4469 | -S "The certificate has been revoked (is on a CRL)" |
| 4470 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4471 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4472 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4473 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4474 | ca_file=data_files/test-ca.crt \ |
| 4475 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4476 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4477 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4478 | 1 \ |
| 4479 | -S "skip write certificate request" \ |
| 4480 | -C "skip parse certificate request" \ |
| 4481 | -c "got a certificate request" \ |
| 4482 | -C "skip write certificate" \ |
| 4483 | -C "skip write certificate verify" \ |
| 4484 | -S "skip parse certificate verify" \ |
| 4485 | -s "x509_verify_cert() returned" \ |
| 4486 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4487 | -s "The certificate has been revoked (is on a CRL)" |
| 4488 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4489 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4490 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4491 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4492 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4493 | "$P_CLI nbio=2 tickets=0" \ |
| 4494 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4495 | -S "mbedtls_ssl_handshake returned" \ |
| 4496 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4497 | -c "Read from server: .* bytes read" |
| 4498 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4499 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4500 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4501 | "$P_CLI nbio=2 tickets=0" \ |
| 4502 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4503 | -S "mbedtls_ssl_handshake returned" \ |
| 4504 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4505 | -c "Read from server: .* bytes read" |
| 4506 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4507 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4508 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4509 | "$P_CLI nbio=2 tickets=1" \ |
| 4510 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4511 | -S "mbedtls_ssl_handshake returned" \ |
| 4512 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4513 | -c "Read from server: .* bytes read" |
| 4514 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4515 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4516 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4517 | "$P_CLI nbio=2 tickets=1" \ |
| 4518 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4519 | -S "mbedtls_ssl_handshake returned" \ |
| 4520 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4521 | -c "Read from server: .* bytes read" |
| 4522 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4523 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4524 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4525 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4526 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4527 | -S "mbedtls_ssl_handshake returned" \ |
| 4528 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4529 | -c "Read from server: .* bytes read" |
| 4530 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4531 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4532 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4533 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4534 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4535 | -S "mbedtls_ssl_handshake returned" \ |
| 4536 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4537 | -c "Read from server: .* bytes read" |
| 4538 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4539 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4540 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4541 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4542 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4543 | -S "mbedtls_ssl_handshake returned" \ |
| 4544 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4545 | -c "Read from server: .* bytes read" |
| 4546 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4547 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4548 | |
| 4549 | run_test "Event-driven I/O: basic handshake" \ |
| 4550 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4551 | "$P_CLI event=1 tickets=0" \ |
| 4552 | 0 \ |
| 4553 | -S "mbedtls_ssl_handshake returned" \ |
| 4554 | -C "mbedtls_ssl_handshake returned" \ |
| 4555 | -c "Read from server: .* bytes read" |
| 4556 | |
| 4557 | run_test "Event-driven I/O: client auth" \ |
| 4558 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4559 | "$P_CLI event=1 tickets=0" \ |
| 4560 | 0 \ |
| 4561 | -S "mbedtls_ssl_handshake returned" \ |
| 4562 | -C "mbedtls_ssl_handshake returned" \ |
| 4563 | -c "Read from server: .* bytes read" |
| 4564 | |
| 4565 | run_test "Event-driven I/O: ticket" \ |
| 4566 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4567 | "$P_CLI event=1 tickets=1" \ |
| 4568 | 0 \ |
| 4569 | -S "mbedtls_ssl_handshake returned" \ |
| 4570 | -C "mbedtls_ssl_handshake returned" \ |
| 4571 | -c "Read from server: .* bytes read" |
| 4572 | |
| 4573 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4574 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4575 | "$P_CLI event=1 tickets=1" \ |
| 4576 | 0 \ |
| 4577 | -S "mbedtls_ssl_handshake returned" \ |
| 4578 | -C "mbedtls_ssl_handshake returned" \ |
| 4579 | -c "Read from server: .* bytes read" |
| 4580 | |
| 4581 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4582 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4583 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4584 | 0 \ |
| 4585 | -S "mbedtls_ssl_handshake returned" \ |
| 4586 | -C "mbedtls_ssl_handshake returned" \ |
| 4587 | -c "Read from server: .* bytes read" |
| 4588 | |
| 4589 | run_test "Event-driven I/O: ticket + resume" \ |
| 4590 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4591 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4592 | 0 \ |
| 4593 | -S "mbedtls_ssl_handshake returned" \ |
| 4594 | -C "mbedtls_ssl_handshake returned" \ |
| 4595 | -c "Read from server: .* bytes read" |
| 4596 | |
| 4597 | run_test "Event-driven I/O: session-id resume" \ |
| 4598 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4599 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4600 | 0 \ |
| 4601 | -S "mbedtls_ssl_handshake returned" \ |
| 4602 | -C "mbedtls_ssl_handshake returned" \ |
| 4603 | -c "Read from server: .* bytes read" |
| 4604 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4605 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4606 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4607 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4608 | 0 \ |
| 4609 | -c "Read from server: .* bytes read" |
| 4610 | |
| 4611 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4612 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4613 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4614 | 0 \ |
| 4615 | -c "Read from server: .* bytes read" |
| 4616 | |
| 4617 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4618 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4619 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4620 | 0 \ |
| 4621 | -c "Read from server: .* bytes read" |
| 4622 | |
| 4623 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4624 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4625 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4626 | 0 \ |
| 4627 | -c "Read from server: .* bytes read" |
| 4628 | |
| 4629 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4630 | "$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] | 4631 | "$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] | 4632 | 0 \ |
| 4633 | -c "Read from server: .* bytes read" |
| 4634 | |
| 4635 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4636 | "$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] | 4637 | "$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] | 4638 | 0 \ |
| 4639 | -c "Read from server: .* bytes read" |
| 4640 | |
| 4641 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4642 | "$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] | 4643 | "$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] | 4644 | 0 \ |
| 4645 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4646 | |
| 4647 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4648 | # During session resumption, the client will send its ApplicationData record |
| 4649 | # within the same datagram as the Finished messages. In this situation, the |
| 4650 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4651 | # because the ApplicationData request has already been queued internally. |
| 4652 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4653 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4654 | "$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] | 4655 | "$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] | 4656 | 0 \ |
| 4657 | -c "Read from server: .* bytes read" |
| 4658 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4659 | # Tests for version negotiation |
| 4660 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4661 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4662 | "$P_SRV" \ |
| 4663 | "$P_CLI" \ |
| 4664 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4665 | -S "mbedtls_ssl_handshake returned" \ |
| 4666 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4667 | -s "Protocol is TLSv1.2" \ |
| 4668 | -c "Protocol is TLSv1.2" |
| 4669 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4670 | # Tests for ALPN extension |
| 4671 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4672 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4673 | "$P_SRV debug_level=3" \ |
| 4674 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4675 | 0 \ |
| 4676 | -C "client hello, adding alpn extension" \ |
| 4677 | -S "found alpn extension" \ |
| 4678 | -C "got an alert message, type: \\[2:120]" \ |
| 4679 | -S "server hello, adding alpn extension" \ |
| 4680 | -C "found alpn extension " \ |
| 4681 | -C "Application Layer Protocol is" \ |
| 4682 | -S "Application Layer Protocol is" |
| 4683 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4684 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4685 | "$P_SRV debug_level=3" \ |
| 4686 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4687 | 0 \ |
| 4688 | -c "client hello, adding alpn extension" \ |
| 4689 | -s "found alpn extension" \ |
| 4690 | -C "got an alert message, type: \\[2:120]" \ |
| 4691 | -S "server hello, adding alpn extension" \ |
| 4692 | -C "found alpn extension " \ |
| 4693 | -c "Application Layer Protocol is (none)" \ |
| 4694 | -S "Application Layer Protocol is" |
| 4695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4696 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4697 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4698 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4699 | 0 \ |
| 4700 | -C "client hello, adding alpn extension" \ |
| 4701 | -S "found alpn extension" \ |
| 4702 | -C "got an alert message, type: \\[2:120]" \ |
| 4703 | -S "server hello, adding alpn extension" \ |
| 4704 | -C "found alpn extension " \ |
| 4705 | -C "Application Layer Protocol is" \ |
| 4706 | -s "Application Layer Protocol is (none)" |
| 4707 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4708 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4709 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4710 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4711 | 0 \ |
| 4712 | -c "client hello, adding alpn extension" \ |
| 4713 | -s "found alpn extension" \ |
| 4714 | -C "got an alert message, type: \\[2:120]" \ |
| 4715 | -s "server hello, adding alpn extension" \ |
| 4716 | -c "found alpn extension" \ |
| 4717 | -c "Application Layer Protocol is abc" \ |
| 4718 | -s "Application Layer Protocol is abc" |
| 4719 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4720 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4721 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4722 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4723 | 0 \ |
| 4724 | -c "client hello, adding alpn extension" \ |
| 4725 | -s "found alpn extension" \ |
| 4726 | -C "got an alert message, type: \\[2:120]" \ |
| 4727 | -s "server hello, adding alpn extension" \ |
| 4728 | -c "found alpn extension" \ |
| 4729 | -c "Application Layer Protocol is abc" \ |
| 4730 | -s "Application Layer Protocol is abc" |
| 4731 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4732 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4733 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4734 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4735 | 0 \ |
| 4736 | -c "client hello, adding alpn extension" \ |
| 4737 | -s "found alpn extension" \ |
| 4738 | -C "got an alert message, type: \\[2:120]" \ |
| 4739 | -s "server hello, adding alpn extension" \ |
| 4740 | -c "found alpn extension" \ |
| 4741 | -c "Application Layer Protocol is 1234" \ |
| 4742 | -s "Application Layer Protocol is 1234" |
| 4743 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4744 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4745 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4746 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4747 | 1 \ |
| 4748 | -c "client hello, adding alpn extension" \ |
| 4749 | -s "found alpn extension" \ |
| 4750 | -c "got an alert message, type: \\[2:120]" \ |
| 4751 | -S "server hello, adding alpn extension" \ |
| 4752 | -C "found alpn extension" \ |
| 4753 | -C "Application Layer Protocol is 1234" \ |
| 4754 | -S "Application Layer Protocol is 1234" |
| 4755 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4756 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4757 | # Tests for keyUsage in leaf certificates, part 1: |
| 4758 | # server-side certificate/suite selection |
| 4759 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4760 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4761 | "$P_SRV key_file=data_files/server2.key \ |
| 4762 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4763 | "$P_CLI" \ |
| 4764 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4765 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4766 | |
| 4767 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4768 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4769 | "$P_SRV key_file=data_files/server2.key \ |
| 4770 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4771 | "$P_CLI" \ |
| 4772 | 0 \ |
| 4773 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4774 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4775 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4776 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4777 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4778 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4779 | 1 \ |
| 4780 | -C "Ciphersuite is " |
| 4781 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4782 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4783 | "$P_SRV key_file=data_files/server5.key \ |
| 4784 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4785 | "$P_CLI" \ |
| 4786 | 0 \ |
| 4787 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4788 | |
| 4789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4790 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4791 | "$P_SRV key_file=data_files/server5.key \ |
| 4792 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4793 | "$P_CLI" \ |
| 4794 | 0 \ |
| 4795 | -c "Ciphersuite is TLS-ECDH-" |
| 4796 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4797 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4798 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4799 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4800 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4801 | 1 \ |
| 4802 | -C "Ciphersuite is " |
| 4803 | |
| 4804 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4805 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4806 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4807 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4808 | "$O_SRV -key data_files/server2.key \ |
| 4809 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4810 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4811 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4812 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4813 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4814 | -C "Processing of the Certificate handshake message failed" \ |
| 4815 | -c "Ciphersuite is TLS-" |
| 4816 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4817 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4818 | "$O_SRV -key data_files/server2.key \ |
| 4819 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4820 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4821 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4822 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4823 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4824 | -C "Processing of the Certificate handshake message failed" \ |
| 4825 | -c "Ciphersuite is TLS-" |
| 4826 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4827 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4828 | "$O_SRV -key data_files/server2.key \ |
| 4829 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4830 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4831 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4832 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4833 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4834 | -C "Processing of the Certificate handshake message failed" \ |
| 4835 | -c "Ciphersuite is TLS-" |
| 4836 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4837 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4838 | "$O_SRV -key data_files/server2.key \ |
| 4839 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4840 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4841 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4842 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4843 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4844 | -c "Processing of the Certificate handshake message failed" \ |
| 4845 | -C "Ciphersuite is TLS-" |
| 4846 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4847 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4848 | "$O_SRV -key data_files/server2.key \ |
| 4849 | -cert data_files/server2.ku-ke.crt" \ |
| 4850 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4851 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4852 | 0 \ |
| 4853 | -c "bad certificate (usage extensions)" \ |
| 4854 | -C "Processing of the Certificate handshake message failed" \ |
| 4855 | -c "Ciphersuite is TLS-" \ |
| 4856 | -c "! Usage does not match the keyUsage extension" |
| 4857 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4858 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4859 | "$O_SRV -key data_files/server2.key \ |
| 4860 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4861 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4862 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4863 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4864 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4865 | -C "Processing of the Certificate handshake message failed" \ |
| 4866 | -c "Ciphersuite is TLS-" |
| 4867 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4868 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4869 | "$O_SRV -key data_files/server2.key \ |
| 4870 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4871 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4872 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4873 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4874 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4875 | -c "Processing of the Certificate handshake message failed" \ |
| 4876 | -C "Ciphersuite is TLS-" |
| 4877 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4878 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4879 | "$O_SRV -key data_files/server2.key \ |
| 4880 | -cert data_files/server2.ku-ds.crt" \ |
| 4881 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4882 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4883 | 0 \ |
| 4884 | -c "bad certificate (usage extensions)" \ |
| 4885 | -C "Processing of the Certificate handshake message failed" \ |
| 4886 | -c "Ciphersuite is TLS-" \ |
| 4887 | -c "! Usage does not match the keyUsage extension" |
| 4888 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4889 | # Tests for keyUsage in leaf certificates, part 3: |
| 4890 | # server-side checking of client cert |
| 4891 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4892 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4893 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4894 | "$O_CLI -key data_files/server2.key \ |
| 4895 | -cert data_files/server2.ku-ds.crt" \ |
| 4896 | 0 \ |
| 4897 | -S "bad certificate (usage extensions)" \ |
| 4898 | -S "Processing of the Certificate handshake message failed" |
| 4899 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4900 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4901 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4902 | "$O_CLI -key data_files/server2.key \ |
| 4903 | -cert data_files/server2.ku-ke.crt" \ |
| 4904 | 0 \ |
| 4905 | -s "bad certificate (usage extensions)" \ |
| 4906 | -S "Processing of the Certificate handshake message failed" |
| 4907 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4908 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4909 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4910 | "$O_CLI -key data_files/server2.key \ |
| 4911 | -cert data_files/server2.ku-ke.crt" \ |
| 4912 | 1 \ |
| 4913 | -s "bad certificate (usage extensions)" \ |
| 4914 | -s "Processing of the Certificate handshake message failed" |
| 4915 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4916 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4917 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4918 | "$O_CLI -key data_files/server5.key \ |
| 4919 | -cert data_files/server5.ku-ds.crt" \ |
| 4920 | 0 \ |
| 4921 | -S "bad certificate (usage extensions)" \ |
| 4922 | -S "Processing of the Certificate handshake message failed" |
| 4923 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4924 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4925 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4926 | "$O_CLI -key data_files/server5.key \ |
| 4927 | -cert data_files/server5.ku-ka.crt" \ |
| 4928 | 0 \ |
| 4929 | -s "bad certificate (usage extensions)" \ |
| 4930 | -S "Processing of the Certificate handshake message failed" |
| 4931 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4932 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 4933 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4934 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4935 | "$P_SRV key_file=data_files/server5.key \ |
| 4936 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4937 | "$P_CLI" \ |
| 4938 | 0 |
| 4939 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4940 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4941 | "$P_SRV key_file=data_files/server5.key \ |
| 4942 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4943 | "$P_CLI" \ |
| 4944 | 0 |
| 4945 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4946 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4947 | "$P_SRV key_file=data_files/server5.key \ |
| 4948 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 4949 | "$P_CLI" \ |
| 4950 | 0 |
| 4951 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4952 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4953 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4954 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4955 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4956 | 1 |
| 4957 | |
| 4958 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 4959 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4960 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4961 | "$O_SRV -key data_files/server5.key \ |
| 4962 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4963 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4964 | 0 \ |
| 4965 | -C "bad certificate (usage extensions)" \ |
| 4966 | -C "Processing of the Certificate handshake message failed" \ |
| 4967 | -c "Ciphersuite is TLS-" |
| 4968 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4969 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4970 | "$O_SRV -key data_files/server5.key \ |
| 4971 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4972 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4973 | 0 \ |
| 4974 | -C "bad certificate (usage extensions)" \ |
| 4975 | -C "Processing of the Certificate handshake message failed" \ |
| 4976 | -c "Ciphersuite is TLS-" |
| 4977 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4978 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4979 | "$O_SRV -key data_files/server5.key \ |
| 4980 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4981 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4982 | 0 \ |
| 4983 | -C "bad certificate (usage extensions)" \ |
| 4984 | -C "Processing of the Certificate handshake message failed" \ |
| 4985 | -c "Ciphersuite is TLS-" |
| 4986 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4987 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4988 | "$O_SRV -key data_files/server5.key \ |
| 4989 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4990 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4991 | 1 \ |
| 4992 | -c "bad certificate (usage extensions)" \ |
| 4993 | -c "Processing of the Certificate handshake message failed" \ |
| 4994 | -C "Ciphersuite is TLS-" |
| 4995 | |
| 4996 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 4997 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4998 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4999 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5000 | "$O_CLI -key data_files/server5.key \ |
| 5001 | -cert data_files/server5.eku-cli.crt" \ |
| 5002 | 0 \ |
| 5003 | -S "bad certificate (usage extensions)" \ |
| 5004 | -S "Processing of the Certificate handshake message failed" |
| 5005 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5006 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5007 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5008 | "$O_CLI -key data_files/server5.key \ |
| 5009 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5010 | 0 \ |
| 5011 | -S "bad certificate (usage extensions)" \ |
| 5012 | -S "Processing of the Certificate handshake message failed" |
| 5013 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5014 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5015 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5016 | "$O_CLI -key data_files/server5.key \ |
| 5017 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5018 | 0 \ |
| 5019 | -S "bad certificate (usage extensions)" \ |
| 5020 | -S "Processing of the Certificate handshake message failed" |
| 5021 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5022 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5023 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5024 | "$O_CLI -key data_files/server5.key \ |
| 5025 | -cert data_files/server5.eku-cs.crt" \ |
| 5026 | 0 \ |
| 5027 | -s "bad certificate (usage extensions)" \ |
| 5028 | -S "Processing of the Certificate handshake message failed" |
| 5029 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5030 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5031 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5032 | "$O_CLI -key data_files/server5.key \ |
| 5033 | -cert data_files/server5.eku-cs.crt" \ |
| 5034 | 1 \ |
| 5035 | -s "bad certificate (usage extensions)" \ |
| 5036 | -s "Processing of the Certificate handshake message failed" |
| 5037 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5038 | # Tests for DHM parameters loading |
| 5039 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5040 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5041 | "$P_SRV" \ |
| 5042 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5043 | debug_level=3" \ |
| 5044 | 0 \ |
| 5045 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5046 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5047 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5048 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5049 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5050 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5051 | debug_level=3" \ |
| 5052 | 0 \ |
| 5053 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5054 | -c "value of 'DHM: G ' (2 bits)" |
| 5055 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5056 | # Tests for DHM client-side size checking |
| 5057 | |
| 5058 | run_test "DHM size: server default, client default, OK" \ |
| 5059 | "$P_SRV" \ |
| 5060 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5061 | debug_level=1" \ |
| 5062 | 0 \ |
| 5063 | -C "DHM prime too short:" |
| 5064 | |
| 5065 | run_test "DHM size: server default, client 2048, OK" \ |
| 5066 | "$P_SRV" \ |
| 5067 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5068 | debug_level=1 dhmlen=2048" \ |
| 5069 | 0 \ |
| 5070 | -C "DHM prime too short:" |
| 5071 | |
| 5072 | run_test "DHM size: server 1024, client default, OK" \ |
| 5073 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5074 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5075 | debug_level=1" \ |
| 5076 | 0 \ |
| 5077 | -C "DHM prime too short:" |
| 5078 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5079 | run_test "DHM size: server 999, client 999, OK" \ |
| 5080 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5081 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5082 | debug_level=1 dhmlen=999" \ |
| 5083 | 0 \ |
| 5084 | -C "DHM prime too short:" |
| 5085 | |
| 5086 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5087 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5088 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5089 | debug_level=1 dhmlen=1000" \ |
| 5090 | 0 \ |
| 5091 | -C "DHM prime too short:" |
| 5092 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5093 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5094 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5095 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5096 | debug_level=1" \ |
| 5097 | 1 \ |
| 5098 | -c "DHM prime too short:" |
| 5099 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5100 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5101 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5102 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5103 | debug_level=1 dhmlen=1001" \ |
| 5104 | 1 \ |
| 5105 | -c "DHM prime too short:" |
| 5106 | |
| 5107 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5108 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5109 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5110 | debug_level=1 dhmlen=1000" \ |
| 5111 | 1 \ |
| 5112 | -c "DHM prime too short:" |
| 5113 | |
| 5114 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5115 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5116 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5117 | debug_level=1 dhmlen=999" \ |
| 5118 | 1 \ |
| 5119 | -c "DHM prime too short:" |
| 5120 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5121 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5122 | "$P_SRV" \ |
| 5123 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5124 | debug_level=1 dhmlen=2049" \ |
| 5125 | 1 \ |
| 5126 | -c "DHM prime too short:" |
| 5127 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5128 | # Tests for PSK callback |
| 5129 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5130 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5131 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5132 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5133 | psk_identity=foo psk=abc123" \ |
| 5134 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5135 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5136 | -S "SSL - Unknown identity received" \ |
| 5137 | -S "SSL - Verification of the message MAC failed" |
| 5138 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5139 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5140 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5141 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5142 | "$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] | 5143 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5144 | 0 \ |
| 5145 | -c "skip PMS generation for opaque PSK"\ |
| 5146 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5147 | -C "session hash for extended master secret"\ |
| 5148 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5149 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5150 | -S "SSL - Unknown identity received" \ |
| 5151 | -S "SSL - Verification of the message MAC failed" |
| 5152 | |
| 5153 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5154 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5155 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5156 | "$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] | 5157 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5158 | 0 \ |
| 5159 | -c "skip PMS generation for opaque PSK"\ |
| 5160 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5161 | -C "session hash for extended master secret"\ |
| 5162 | -S "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5163 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5164 | -S "SSL - Unknown identity received" \ |
| 5165 | -S "SSL - Verification of the message MAC failed" |
| 5166 | |
| 5167 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5168 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5169 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5170 | "$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] | 5171 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5172 | 0 \ |
| 5173 | -c "skip PMS generation for opaque PSK"\ |
| 5174 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5175 | -c "session hash for extended master secret"\ |
| 5176 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5177 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5178 | -S "SSL - Unknown identity received" \ |
| 5179 | -S "SSL - Verification of the message MAC failed" |
| 5180 | |
| 5181 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5182 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5183 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5184 | "$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] | 5185 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5186 | 0 \ |
| 5187 | -c "skip PMS generation for opaque PSK"\ |
| 5188 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5189 | -c "session hash for extended master secret"\ |
| 5190 | -s "session hash for extended master secret"\ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5191 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5192 | -S "SSL - Unknown identity received" \ |
| 5193 | -S "SSL - Verification of the message MAC failed" |
| 5194 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5195 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5196 | 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] | 5197 | "$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] | 5198 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5199 | psk_identity=foo psk=abc123" \ |
| 5200 | 0 \ |
| 5201 | -C "skip PMS generation for opaque PSK"\ |
| 5202 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5203 | -C "session hash for extended master secret"\ |
| 5204 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5205 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5206 | -S "SSL - Unknown identity received" \ |
| 5207 | -S "SSL - Verification of the message MAC failed" |
| 5208 | |
| 5209 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5210 | 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] | 5211 | "$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] | 5212 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5213 | psk_identity=foo psk=abc123" \ |
| 5214 | 0 \ |
| 5215 | -C "skip PMS generation for opaque PSK"\ |
| 5216 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5217 | -C "session hash for extended master secret"\ |
| 5218 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5219 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5220 | -S "SSL - Unknown identity received" \ |
| 5221 | -S "SSL - Verification of the message MAC failed" |
| 5222 | |
| 5223 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5224 | 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] | 5225 | "$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] | 5226 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5227 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5228 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5229 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5230 | -c "session hash for extended master secret"\ |
| 5231 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5232 | -C "skip PMS generation for opaque PSK"\ |
| 5233 | -s "skip PMS generation for opaque PSK"\ |
| 5234 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5235 | -S "SSL - Unknown identity received" \ |
| 5236 | -S "SSL - Verification of the message MAC failed" |
| 5237 | |
| 5238 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5239 | 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] | 5240 | "$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] | 5241 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5242 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5243 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5244 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5245 | -c "session hash for extended master secret"\ |
| 5246 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5247 | -C "skip PMS generation for opaque PSK"\ |
| 5248 | -s "skip PMS generation for opaque PSK"\ |
| 5249 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5250 | -S "SSL - Unknown identity received" \ |
| 5251 | -S "SSL - Verification of the message MAC failed" |
| 5252 | |
| 5253 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5254 | 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] | 5255 | "$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] | 5256 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5257 | psk_identity=def psk=beef" \ |
| 5258 | 0 \ |
| 5259 | -C "skip PMS generation for opaque PSK"\ |
| 5260 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5261 | -C "session hash for extended master secret"\ |
| 5262 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5263 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5264 | -S "SSL - Unknown identity received" \ |
| 5265 | -S "SSL - Verification of the message MAC failed" |
| 5266 | |
| 5267 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5268 | 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] | 5269 | "$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] | 5270 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5271 | psk_identity=def psk=beef" \ |
| 5272 | 0 \ |
| 5273 | -C "skip PMS generation for opaque PSK"\ |
| 5274 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5275 | -C "session hash for extended master secret"\ |
| 5276 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5277 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5278 | -S "SSL - Unknown identity received" \ |
| 5279 | -S "SSL - Verification of the message MAC failed" |
| 5280 | |
| 5281 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5282 | 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] | 5283 | "$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] | 5284 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5285 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5286 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5287 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5288 | -c "session hash for extended master secret"\ |
| 5289 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5290 | -C "skip PMS generation for opaque PSK"\ |
| 5291 | -s "skip PMS generation for opaque PSK"\ |
| 5292 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5293 | -S "SSL - Unknown identity received" \ |
| 5294 | -S "SSL - Verification of the message MAC failed" |
| 5295 | |
| 5296 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5297 | 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] | 5298 | "$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] | 5299 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5300 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5301 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5302 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5303 | -c "session hash for extended master secret"\ |
| 5304 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5305 | -C "skip PMS generation for opaque PSK"\ |
| 5306 | -s "skip PMS generation for opaque PSK"\ |
| 5307 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5308 | -S "SSL - Unknown identity received" \ |
| 5309 | -S "SSL - Verification of the message MAC failed" |
| 5310 | |
| 5311 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5312 | 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] | 5313 | "$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] | 5314 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5315 | psk_identity=def psk=beef" \ |
| 5316 | 0 \ |
| 5317 | -C "skip PMS generation for opaque PSK"\ |
| 5318 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5319 | -C "session hash for extended master secret"\ |
| 5320 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5321 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5322 | -S "SSL - Unknown identity received" \ |
| 5323 | -S "SSL - Verification of the message MAC failed" |
| 5324 | |
| 5325 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5326 | 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] | 5327 | "$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] | 5328 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5329 | psk_identity=def psk=beef" \ |
| 5330 | 0 \ |
| 5331 | -C "skip PMS generation for opaque PSK"\ |
| 5332 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5333 | -C "session hash for extended master secret"\ |
| 5334 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5335 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5336 | -S "SSL - Unknown identity received" \ |
| 5337 | -S "SSL - Verification of the message MAC failed" |
| 5338 | |
| 5339 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5340 | 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] | 5341 | "$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] | 5342 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5343 | psk_identity=def psk=beef" \ |
| 5344 | 0 \ |
| 5345 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5346 | -C "session hash for extended master secret"\ |
| 5347 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5348 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5349 | -S "SSL - Unknown identity received" \ |
| 5350 | -S "SSL - Verification of the message MAC failed" |
| 5351 | |
| 5352 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5353 | 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] | 5354 | "$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] | 5355 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5356 | psk_identity=def psk=beef" \ |
| 5357 | 0 \ |
| 5358 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5359 | -C "session hash for extended master secret"\ |
| 5360 | -S "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5361 | -S "SSL - None of the common ciphersuites is usable" \ |
| 5362 | -S "SSL - Unknown identity received" \ |
| 5363 | -S "SSL - Verification of the message MAC failed" |
| 5364 | |
| 5365 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5366 | 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] | 5367 | "$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] | 5368 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5369 | psk_identity=def psk=beef" \ |
| 5370 | 1 \ |
| 5371 | -s "SSL - Verification of the message MAC failed" |
| 5372 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5373 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5374 | "$P_SRV" \ |
| 5375 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5376 | psk_identity=foo psk=abc123" \ |
| 5377 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5378 | -s "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5379 | -S "SSL - Unknown identity received" \ |
| 5380 | -S "SSL - Verification of the message MAC failed" |
| 5381 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5382 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5383 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5384 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5385 | psk_identity=foo psk=abc123" \ |
| 5386 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5387 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5388 | -s "SSL - Unknown identity received" \ |
| 5389 | -S "SSL - Verification of the message MAC failed" |
| 5390 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5391 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5392 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5393 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5394 | psk_identity=abc psk=dead" \ |
| 5395 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5396 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5397 | -S "SSL - Unknown identity received" \ |
| 5398 | -S "SSL - Verification of the message MAC failed" |
| 5399 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5400 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5401 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5402 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5403 | psk_identity=def psk=beef" \ |
| 5404 | 0 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5405 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5406 | -S "SSL - Unknown identity received" \ |
| 5407 | -S "SSL - Verification of the message MAC failed" |
| 5408 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5409 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5410 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5411 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5412 | psk_identity=ghi psk=beef" \ |
| 5413 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5414 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5415 | -s "SSL - Unknown identity received" \ |
| 5416 | -S "SSL - Verification of the message MAC failed" |
| 5417 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5418 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5419 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5420 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5421 | psk_identity=abc psk=beef" \ |
| 5422 | 1 \ |
Manuel Pégourié-Gonnard | f01768c | 2015-01-08 17:06:16 +0100 | [diff] [blame] | 5423 | -S "SSL - None of the common ciphersuites is usable" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5424 | -S "SSL - Unknown identity received" \ |
| 5425 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5426 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5427 | # Tests for EC J-PAKE |
| 5428 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5429 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5430 | run_test "ECJPAKE: client not configured" \ |
| 5431 | "$P_SRV debug_level=3" \ |
| 5432 | "$P_CLI debug_level=3" \ |
| 5433 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5434 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5435 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5436 | -S "found ecjpake kkpp extension" \ |
| 5437 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5438 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5439 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5440 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5441 | -S "None of the common ciphersuites is usable" |
| 5442 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5443 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5444 | run_test "ECJPAKE: server not configured" \ |
| 5445 | "$P_SRV debug_level=3" \ |
| 5446 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5447 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5448 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5449 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5450 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5451 | -s "found ecjpake kkpp extension" \ |
| 5452 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5453 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5454 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5455 | -C "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5456 | -s "None of the common ciphersuites is usable" |
| 5457 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5458 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5459 | run_test "ECJPAKE: working, TLS" \ |
| 5460 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5461 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5462 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5463 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5464 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5465 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5466 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5467 | -s "found ecjpake kkpp extension" \ |
| 5468 | -S "skip ecjpake kkpp extension" \ |
| 5469 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5470 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5471 | -c "found ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5472 | -S "None of the common ciphersuites is usable" \ |
| 5473 | -S "SSL - Verification of the message MAC failed" |
| 5474 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5475 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5476 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5477 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5478 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5479 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5480 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5481 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5482 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5483 | -s "SSL - Verification of the message MAC failed" |
| 5484 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5485 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5486 | run_test "ECJPAKE: working, DTLS" \ |
| 5487 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5488 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5489 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5490 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5491 | -c "re-using cached ecjpake parameters" \ |
| 5492 | -S "SSL - Verification of the message MAC failed" |
| 5493 | |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5494 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5495 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5496 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5497 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5498 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5499 | 0 \ |
| 5500 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5501 | -S "SSL - Verification of the message MAC failed" |
| 5502 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5503 | server_needs_more_time 1 |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5504 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5505 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5506 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5507 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5508 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5509 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5510 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5511 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5512 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5513 | # for tests with configs/config-thread.h |
Manuel Pégourié-Gonnard | 12ca6f5 | 2015-10-20 15:24:51 +0200 | [diff] [blame] | 5514 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5515 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5516 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5517 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5518 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5519 | 0 |
| 5520 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5521 | # Test for ClientHello without extensions |
| 5522 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5523 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5524 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5525 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5526 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5527 | 0 \ |
| 5528 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5529 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5530 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5531 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5532 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5533 | "$P_SRV" \ |
| 5534 | "$P_CLI request_size=100" \ |
| 5535 | 0 \ |
| 5536 | -s "Read from client: 100 bytes read$" |
| 5537 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5538 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5539 | "$P_SRV" \ |
| 5540 | "$P_CLI request_size=500" \ |
| 5541 | 0 \ |
| 5542 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5543 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5544 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5545 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5546 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5547 | "$P_SRV" \ |
| 5548 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5549 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5550 | 0 \ |
| 5551 | -s "Read from client: 1 bytes read" |
| 5552 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5553 | 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] | 5554 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5555 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5556 | 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] | 5557 | 0 \ |
| 5558 | -s "Read from client: 1 bytes read" |
| 5559 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5560 | 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] | 5561 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5562 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5563 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5564 | 0 \ |
| 5565 | -s "Read from client: 1 bytes read" |
| 5566 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5567 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5568 | "$P_SRV" \ |
| 5569 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5570 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5571 | 0 \ |
| 5572 | -s "Read from client: 1 bytes read" |
| 5573 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5574 | 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] | 5575 | "$P_SRV" \ |
| 5576 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5577 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5578 | 0 \ |
| 5579 | -s "Read from client: 1 bytes read" |
| 5580 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5581 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5582 | |
| 5583 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5584 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5585 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5586 | "$P_CLI dtls=1 request_size=1 \ |
| 5587 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5588 | 0 \ |
| 5589 | -s "Read from client: 1 bytes read" |
| 5590 | |
| 5591 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5592 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5593 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5594 | "$P_CLI dtls=1 request_size=1 \ |
| 5595 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5596 | 0 \ |
| 5597 | -s "Read from client: 1 bytes read" |
| 5598 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5599 | # Tests for small server packets |
| 5600 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5601 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5602 | "$P_SRV response_size=1" \ |
| 5603 | "$P_CLI force_version=tls1_2 \ |
| 5604 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5605 | 0 \ |
| 5606 | -c "Read from server: 1 bytes read" |
| 5607 | |
| 5608 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5609 | "$P_SRV response_size=1" \ |
| 5610 | "$P_CLI force_version=tls1_2 \ |
| 5611 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5612 | 0 \ |
| 5613 | -c "Read from server: 1 bytes read" |
| 5614 | |
| 5615 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5616 | "$P_SRV response_size=1" \ |
| 5617 | "$P_CLI force_version=tls1_2 \ |
| 5618 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5619 | 0 \ |
| 5620 | -c "Read from server: 1 bytes read" |
| 5621 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5622 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5623 | "$P_SRV response_size=1" \ |
| 5624 | "$P_CLI force_version=tls1_2 \ |
| 5625 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5626 | 0 \ |
| 5627 | -c "Read from server: 1 bytes read" |
| 5628 | |
| 5629 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5630 | "$P_SRV response_size=1" \ |
| 5631 | "$P_CLI force_version=tls1_2 \ |
| 5632 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5633 | 0 \ |
| 5634 | -c "Read from server: 1 bytes read" |
| 5635 | |
| 5636 | # Tests for small server packets in DTLS |
| 5637 | |
| 5638 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5639 | run_test "Small server packet DTLS 1.2" \ |
| 5640 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5641 | "$P_CLI dtls=1 \ |
| 5642 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5643 | 0 \ |
| 5644 | -c "Read from server: 1 bytes read" |
| 5645 | |
| 5646 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5647 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5648 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5649 | "$P_CLI dtls=1 \ |
| 5650 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5651 | 0 \ |
| 5652 | -c "Read from server: 1 bytes read" |
| 5653 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5654 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5655 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5656 | # How many fragments do we expect to write $1 bytes? |
| 5657 | fragments_for_write() { |
| 5658 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5659 | } |
| 5660 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5661 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5662 | "$P_SRV" \ |
| 5663 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5664 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5665 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5666 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5667 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5668 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5669 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5670 | "$P_SRV" \ |
| 5671 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5672 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5673 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5674 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5675 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5676 | 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] | 5677 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5678 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5679 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5680 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5681 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5682 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5683 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5684 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5685 | "$P_SRV" \ |
| 5686 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5687 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5688 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5689 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5690 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5691 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5692 | 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] | 5693 | "$P_SRV" \ |
| 5694 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5695 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5696 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5697 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5698 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5699 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5700 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5701 | "$P_SRV response_size=16384" \ |
| 5702 | "$P_CLI force_version=tls1_2 \ |
| 5703 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5704 | 0 \ |
| 5705 | -c "Read from server: 16384 bytes read" |
| 5706 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5707 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5708 | "$P_SRV response_size=16384" \ |
| 5709 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5710 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5711 | 0 \ |
| 5712 | -s "16384 bytes written in 1 fragments" \ |
| 5713 | -c "Read from server: 16384 bytes read" |
| 5714 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5715 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5716 | "$P_SRV response_size=16384" \ |
| 5717 | "$P_CLI force_version=tls1_2 \ |
| 5718 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5719 | 0 \ |
| 5720 | -c "Read from server: 16384 bytes read" |
| 5721 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5722 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5723 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5724 | "$P_CLI force_version=tls1_2 \ |
| 5725 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5726 | 0 \ |
| 5727 | -s "16384 bytes written in 1 fragments" \ |
| 5728 | -c "Read from server: 16384 bytes read" |
| 5729 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5730 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5731 | "$P_SRV response_size=16384" \ |
| 5732 | "$P_CLI force_version=tls1_2 \ |
| 5733 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5734 | 0 \ |
| 5735 | -c "Read from server: 16384 bytes read" |
| 5736 | |
| 5737 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5738 | "$P_SRV response_size=16384" \ |
| 5739 | "$P_CLI force_version=tls1_2 \ |
| 5740 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5741 | 0 \ |
| 5742 | -c "Read from server: 16384 bytes read" |
| 5743 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5744 | # Tests for restartable ECC |
| 5745 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5746 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 5747 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5748 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5749 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5750 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5751 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5752 | "$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] | 5753 | 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] | 5754 | debug_level=1" \ |
| 5755 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5756 | -C "x509_verify_cert.*4b00" \ |
| 5757 | -C "mbedtls_pk_verify.*4b00" \ |
| 5758 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5759 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5760 | |
| 5761 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5762 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5763 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5764 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5765 | "$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] | 5766 | 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] | 5767 | debug_level=1 ec_max_ops=0" \ |
| 5768 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5769 | -C "x509_verify_cert.*4b00" \ |
| 5770 | -C "mbedtls_pk_verify.*4b00" \ |
| 5771 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5772 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5773 | |
| 5774 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5775 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5776 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5777 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5778 | "$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] | 5779 | 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] | 5780 | debug_level=1 ec_max_ops=65535" \ |
| 5781 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5782 | -C "x509_verify_cert.*4b00" \ |
| 5783 | -C "mbedtls_pk_verify.*4b00" \ |
| 5784 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5785 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5786 | |
| 5787 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5788 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5789 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5790 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5791 | "$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] | 5792 | 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] | 5793 | debug_level=1 ec_max_ops=1000" \ |
| 5794 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5795 | -c "x509_verify_cert.*4b00" \ |
| 5796 | -c "mbedtls_pk_verify.*4b00" \ |
| 5797 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5798 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5799 | |
| 5800 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5801 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5802 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5803 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5804 | crt_file=data_files/server5-badsign.crt \ |
| 5805 | key_file=data_files/server5.key" \ |
| 5806 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5807 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5808 | debug_level=1 ec_max_ops=1000" \ |
| 5809 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5810 | -c "x509_verify_cert.*4b00" \ |
| 5811 | -C "mbedtls_pk_verify.*4b00" \ |
| 5812 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5813 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5814 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5815 | -c "! mbedtls_ssl_handshake returned" \ |
| 5816 | -c "X509 - Certificate verification failed" |
| 5817 | |
| 5818 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5819 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5820 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5821 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5822 | crt_file=data_files/server5-badsign.crt \ |
| 5823 | key_file=data_files/server5.key" \ |
| 5824 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5825 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5826 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5827 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5828 | -c "x509_verify_cert.*4b00" \ |
| 5829 | -c "mbedtls_pk_verify.*4b00" \ |
| 5830 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5831 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5832 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5833 | -C "! mbedtls_ssl_handshake returned" \ |
| 5834 | -C "X509 - Certificate verification failed" |
| 5835 | |
| 5836 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5837 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5838 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5839 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5840 | crt_file=data_files/server5-badsign.crt \ |
| 5841 | key_file=data_files/server5.key" \ |
| 5842 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5843 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5844 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 5845 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5846 | -C "x509_verify_cert.*4b00" \ |
| 5847 | -c "mbedtls_pk_verify.*4b00" \ |
| 5848 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5849 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5850 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5851 | -C "! mbedtls_ssl_handshake returned" \ |
| 5852 | -C "X509 - Certificate verification failed" |
| 5853 | |
| 5854 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5855 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5856 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5857 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5858 | "$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] | 5859 | 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] | 5860 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 5861 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5862 | -c "x509_verify_cert.*4b00" \ |
| 5863 | -c "mbedtls_pk_verify.*4b00" \ |
| 5864 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5865 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5866 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5867 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5868 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5869 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5870 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5871 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5872 | debug_level=1 ec_max_ops=1000" \ |
| 5873 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5874 | -c "x509_verify_cert.*4b00" \ |
| 5875 | -c "mbedtls_pk_verify.*4b00" \ |
| 5876 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5877 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5878 | |
| 5879 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5880 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5881 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5882 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5883 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 5884 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 5885 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5886 | -C "x509_verify_cert.*4b00" \ |
| 5887 | -C "mbedtls_pk_verify.*4b00" \ |
| 5888 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5889 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5890 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5891 | # Tests of asynchronous private key support in SSL |
| 5892 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5893 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5894 | run_test "SSL async private: sign, delay=0" \ |
| 5895 | "$P_SRV \ |
| 5896 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5897 | "$P_CLI" \ |
| 5898 | 0 \ |
| 5899 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5900 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5901 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5902 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5903 | run_test "SSL async private: sign, delay=1" \ |
| 5904 | "$P_SRV \ |
| 5905 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5906 | "$P_CLI" \ |
| 5907 | 0 \ |
| 5908 | -s "Async sign callback: using key slot " \ |
| 5909 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5910 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5911 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 5912 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5913 | run_test "SSL async private: sign, delay=2" \ |
| 5914 | "$P_SRV \ |
| 5915 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 5916 | "$P_CLI" \ |
| 5917 | 0 \ |
| 5918 | -s "Async sign callback: using key slot " \ |
| 5919 | -U "Async sign callback: using key slot " \ |
| 5920 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 5921 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5922 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5923 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5924 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5925 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 5926 | run_test "SSL async private: sign, SNI" \ |
| 5927 | "$P_SRV debug_level=3 \ |
| 5928 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 5929 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5930 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5931 | "$P_CLI server_name=polarssl.example" \ |
| 5932 | 0 \ |
| 5933 | -s "Async sign callback: using key slot " \ |
| 5934 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5935 | -s "parse ServerName extension" \ |
| 5936 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5937 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5938 | |
| 5939 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5940 | run_test "SSL async private: decrypt, delay=0" \ |
| 5941 | "$P_SRV \ |
| 5942 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5943 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5944 | 0 \ |
| 5945 | -s "Async decrypt callback: using key slot " \ |
| 5946 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5947 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5948 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5949 | run_test "SSL async private: decrypt, delay=1" \ |
| 5950 | "$P_SRV \ |
| 5951 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5952 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5953 | 0 \ |
| 5954 | -s "Async decrypt callback: using key slot " \ |
| 5955 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5956 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5957 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5958 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5959 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 5960 | "$P_SRV psk=abc123 \ |
| 5961 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5962 | "$P_CLI psk=abc123 \ |
| 5963 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5964 | 0 \ |
| 5965 | -s "Async decrypt callback: using key slot " \ |
| 5966 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5967 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5968 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5969 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 5970 | "$P_SRV psk=abc123 \ |
| 5971 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5972 | "$P_CLI psk=abc123 \ |
| 5973 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5974 | 0 \ |
| 5975 | -s "Async decrypt callback: using key slot " \ |
| 5976 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5977 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5978 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5979 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5980 | run_test "SSL async private: sign callback not present" \ |
| 5981 | "$P_SRV \ |
| 5982 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5983 | "$P_CLI; [ \$? -eq 1 ] && |
| 5984 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5985 | 0 \ |
| 5986 | -S "Async sign callback" \ |
| 5987 | -s "! mbedtls_ssl_handshake returned" \ |
| 5988 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 5989 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 5990 | -s "Successful connection" |
| 5991 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5992 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5993 | run_test "SSL async private: decrypt callback not present" \ |
| 5994 | "$P_SRV debug_level=1 \ |
| 5995 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 5996 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 5997 | [ \$? -eq 1 ] && $P_CLI" \ |
| 5998 | 0 \ |
| 5999 | -S "Async decrypt callback" \ |
| 6000 | -s "! mbedtls_ssl_handshake returned" \ |
| 6001 | -s "got no RSA private key" \ |
| 6002 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6003 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6004 | |
| 6005 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6006 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6007 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6008 | "$P_SRV \ |
| 6009 | async_operations=s async_private_delay1=1 \ |
| 6010 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6011 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6012 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6013 | 0 \ |
| 6014 | -s "Async sign callback: using key slot 0," \ |
| 6015 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6016 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6017 | |
| 6018 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6019 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6020 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6021 | "$P_SRV \ |
| 6022 | async_operations=s async_private_delay2=1 \ |
| 6023 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6024 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6025 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6026 | 0 \ |
| 6027 | -s "Async sign callback: using key slot 0," \ |
| 6028 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6029 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6030 | |
| 6031 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6032 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6033 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6034 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6035 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6036 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6037 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6038 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6039 | 0 \ |
| 6040 | -s "Async sign callback: using key slot 1," \ |
| 6041 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6042 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6043 | |
| 6044 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6045 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6046 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6047 | "$P_SRV \ |
| 6048 | async_operations=s async_private_delay1=1 \ |
| 6049 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6050 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6051 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6052 | 0 \ |
| 6053 | -s "Async sign callback: no key matches this certificate." |
| 6054 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6055 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6056 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6057 | "$P_SRV \ |
| 6058 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6059 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6060 | "$P_CLI" \ |
| 6061 | 1 \ |
| 6062 | -s "Async sign callback: injected error" \ |
| 6063 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6064 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6065 | -s "! mbedtls_ssl_handshake returned" |
| 6066 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6067 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6068 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6069 | "$P_SRV \ |
| 6070 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6071 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6072 | "$P_CLI" \ |
| 6073 | 1 \ |
| 6074 | -s "Async sign callback: using key slot " \ |
| 6075 | -S "Async resume" \ |
| 6076 | -s "Async cancel" |
| 6077 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6078 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6079 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6080 | "$P_SRV \ |
| 6081 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6082 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6083 | "$P_CLI" \ |
| 6084 | 1 \ |
| 6085 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6086 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6087 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6088 | -s "! mbedtls_ssl_handshake returned" |
| 6089 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6090 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6091 | run_test "SSL async private: decrypt, error in start" \ |
| 6092 | "$P_SRV \ |
| 6093 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6094 | async_private_error=1" \ |
| 6095 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6096 | 1 \ |
| 6097 | -s "Async decrypt callback: injected error" \ |
| 6098 | -S "Async resume" \ |
| 6099 | -S "Async cancel" \ |
| 6100 | -s "! mbedtls_ssl_handshake returned" |
| 6101 | |
| 6102 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6103 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6104 | "$P_SRV \ |
| 6105 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6106 | async_private_error=2" \ |
| 6107 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6108 | 1 \ |
| 6109 | -s "Async decrypt callback: using key slot " \ |
| 6110 | -S "Async resume" \ |
| 6111 | -s "Async cancel" |
| 6112 | |
| 6113 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6114 | run_test "SSL async private: decrypt, error in resume" \ |
| 6115 | "$P_SRV \ |
| 6116 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6117 | async_private_error=3" \ |
| 6118 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6119 | 1 \ |
| 6120 | -s "Async decrypt callback: using key slot " \ |
| 6121 | -s "Async resume callback: decrypt done but injected error" \ |
| 6122 | -S "Async cancel" \ |
| 6123 | -s "! mbedtls_ssl_handshake returned" |
| 6124 | |
| 6125 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6126 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6127 | "$P_SRV \ |
| 6128 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6129 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6130 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6131 | 0 \ |
| 6132 | -s "Async cancel" \ |
| 6133 | -s "! mbedtls_ssl_handshake returned" \ |
| 6134 | -s "Async resume" \ |
| 6135 | -s "Successful connection" |
| 6136 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6137 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6138 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6139 | "$P_SRV \ |
| 6140 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6141 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6142 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6143 | 0 \ |
| 6144 | -s "! mbedtls_ssl_handshake returned" \ |
| 6145 | -s "Async resume" \ |
| 6146 | -s "Successful connection" |
| 6147 | |
| 6148 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6149 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6150 | 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] | 6151 | "$P_SRV \ |
| 6152 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6153 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6154 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6155 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6156 | [ \$? -eq 1 ] && |
| 6157 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6158 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6159 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6160 | -S "Async resume" \ |
| 6161 | -s "Async cancel" \ |
| 6162 | -s "! mbedtls_ssl_handshake returned" \ |
| 6163 | -s "Async sign callback: no key matches this certificate." \ |
| 6164 | -s "Successful connection" |
| 6165 | |
| 6166 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6167 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6168 | 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] | 6169 | "$P_SRV \ |
| 6170 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6171 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6172 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6173 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6174 | [ \$? -eq 1 ] && |
| 6175 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6176 | 0 \ |
| 6177 | -s "Async resume" \ |
| 6178 | -s "! mbedtls_ssl_handshake returned" \ |
| 6179 | -s "Async sign callback: no key matches this certificate." \ |
| 6180 | -s "Successful connection" |
| 6181 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6182 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6183 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6184 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6185 | "$P_SRV \ |
| 6186 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6187 | exchanges=2 renegotiation=1" \ |
| 6188 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6189 | 0 \ |
| 6190 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6191 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6192 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6193 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6194 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6195 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6196 | "$P_SRV \ |
| 6197 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6198 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6199 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6200 | 0 \ |
| 6201 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6202 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6203 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6204 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6205 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6206 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6207 | "$P_SRV \ |
| 6208 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6209 | exchanges=2 renegotiation=1" \ |
| 6210 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6211 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6212 | 0 \ |
| 6213 | -s "Async decrypt callback: using key slot " \ |
| 6214 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6215 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6216 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6217 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6218 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6219 | "$P_SRV \ |
| 6220 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6221 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6222 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6223 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6224 | 0 \ |
| 6225 | -s "Async decrypt callback: using key slot " \ |
| 6226 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6227 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6228 | # Tests for ECC extensions (rfc 4492) |
| 6229 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6230 | requires_config_enabled MBEDTLS_AES_C |
| 6231 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6232 | requires_config_enabled MBEDTLS_SHA256_C |
| 6233 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6234 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6235 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6236 | "$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] | 6237 | 0 \ |
| 6238 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6239 | -C "client hello, adding supported_point_formats extension" \ |
| 6240 | -S "found supported elliptic curves extension" \ |
| 6241 | -S "found supported point formats extension" |
| 6242 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6243 | requires_config_enabled MBEDTLS_AES_C |
| 6244 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6245 | requires_config_enabled MBEDTLS_SHA256_C |
| 6246 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6247 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6248 | "$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] | 6249 | "$P_CLI debug_level=3" \ |
| 6250 | 0 \ |
| 6251 | -C "found supported_point_formats extension" \ |
| 6252 | -S "server hello, supported_point_formats extension" |
| 6253 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6254 | requires_config_enabled MBEDTLS_AES_C |
| 6255 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6256 | requires_config_enabled MBEDTLS_SHA256_C |
| 6257 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6258 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6259 | "$P_SRV debug_level=3" \ |
| 6260 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6261 | 0 \ |
| 6262 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6263 | -c "client hello, adding supported_point_formats extension" \ |
| 6264 | -s "found supported elliptic curves extension" \ |
| 6265 | -s "found supported point formats extension" |
| 6266 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6267 | requires_config_enabled MBEDTLS_AES_C |
| 6268 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6269 | requires_config_enabled MBEDTLS_SHA256_C |
| 6270 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6271 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6272 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6273 | "$P_CLI debug_level=3" \ |
| 6274 | 0 \ |
| 6275 | -c "found supported_point_formats extension" \ |
| 6276 | -s "server hello, supported_point_formats extension" |
| 6277 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6278 | # Tests for DTLS HelloVerifyRequest |
| 6279 | |
| 6280 | run_test "DTLS cookie: enabled" \ |
| 6281 | "$P_SRV dtls=1 debug_level=2" \ |
| 6282 | "$P_CLI dtls=1 debug_level=2" \ |
| 6283 | 0 \ |
| 6284 | -s "cookie verification failed" \ |
| 6285 | -s "cookie verification passed" \ |
| 6286 | -S "cookie verification skipped" \ |
| 6287 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6288 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6289 | -S "SSL - The requested feature is not available" |
| 6290 | |
| 6291 | run_test "DTLS cookie: disabled" \ |
| 6292 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6293 | "$P_CLI dtls=1 debug_level=2" \ |
| 6294 | 0 \ |
| 6295 | -S "cookie verification failed" \ |
| 6296 | -S "cookie verification passed" \ |
| 6297 | -s "cookie verification skipped" \ |
| 6298 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6299 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6300 | -S "SSL - The requested feature is not available" |
| 6301 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6302 | run_test "DTLS cookie: default (failing)" \ |
| 6303 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6304 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6305 | 1 \ |
| 6306 | -s "cookie verification failed" \ |
| 6307 | -S "cookie verification passed" \ |
| 6308 | -S "cookie verification skipped" \ |
| 6309 | -C "received hello verify request" \ |
| 6310 | -S "hello verification requested" \ |
| 6311 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6312 | |
| 6313 | requires_ipv6 |
| 6314 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6315 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6316 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6317 | 0 \ |
| 6318 | -s "cookie verification failed" \ |
| 6319 | -s "cookie verification passed" \ |
| 6320 | -S "cookie verification skipped" \ |
| 6321 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6322 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6323 | -S "SSL - The requested feature is not available" |
| 6324 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6325 | run_test "DTLS cookie: enabled, nbio" \ |
| 6326 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6327 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6328 | 0 \ |
| 6329 | -s "cookie verification failed" \ |
| 6330 | -s "cookie verification passed" \ |
| 6331 | -S "cookie verification skipped" \ |
| 6332 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6333 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6334 | -S "SSL - The requested feature is not available" |
| 6335 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6336 | # Tests for client reconnecting from the same port with DTLS |
| 6337 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6338 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6339 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6340 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6341 | "$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] | 6342 | 0 \ |
| 6343 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6344 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6345 | -S "Client initiated reconnection from same port" |
| 6346 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6347 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6348 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6349 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6350 | "$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] | 6351 | 0 \ |
| 6352 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6353 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6354 | -s "Client initiated reconnection from same port" |
| 6355 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6356 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6357 | 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] | 6358 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6359 | "$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] | 6360 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6361 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6362 | -s "Client initiated reconnection from same port" |
| 6363 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6364 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6365 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6366 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6367 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6368 | 0 \ |
| 6369 | -S "The operation timed out" \ |
| 6370 | -s "Client initiated reconnection from same port" |
| 6371 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6372 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6373 | "$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] | 6374 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6375 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6376 | -s "The operation timed out" \ |
| 6377 | -S "Client initiated reconnection from same port" |
| 6378 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6379 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6380 | -p "$P_PXY inject_clihlo=1" \ |
| 6381 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6382 | "$P_CLI dtls=1 exchanges=2" \ |
| 6383 | 0 \ |
| 6384 | -s "possible client reconnect from the same port" \ |
| 6385 | -S "Client initiated reconnection from same port" |
| 6386 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6387 | # Tests for various cases of client authentication with DTLS |
| 6388 | # (focused on handshake flows and message parsing) |
| 6389 | |
| 6390 | run_test "DTLS client auth: required" \ |
| 6391 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6392 | "$P_CLI dtls=1" \ |
| 6393 | 0 \ |
| 6394 | -s "Verifying peer X.509 certificate... ok" |
| 6395 | |
| 6396 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6397 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6398 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6399 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6400 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6401 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6402 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6403 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6404 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6405 | 0 \ |
| 6406 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6407 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6408 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6409 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6410 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6411 | "$P_CLI dtls=1 psk=abc124" \ |
| 6412 | 1 \ |
| 6413 | -s "SSL - Verification of the message MAC failed" \ |
| 6414 | -c "SSL - A fatal alert message was received from our peer" |
| 6415 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6416 | # Tests for receiving fragmented handshake messages with DTLS |
| 6417 | |
| 6418 | requires_gnutls |
| 6419 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6420 | "$G_SRV -u --mtu 2048 -a" \ |
| 6421 | "$P_CLI dtls=1 debug_level=2" \ |
| 6422 | 0 \ |
| 6423 | -C "found fragmented DTLS handshake message" \ |
| 6424 | -C "error" |
| 6425 | |
| 6426 | requires_gnutls |
| 6427 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6428 | "$G_SRV -u --mtu 512" \ |
| 6429 | "$P_CLI dtls=1 debug_level=2" \ |
| 6430 | 0 \ |
| 6431 | -c "found fragmented DTLS handshake message" \ |
| 6432 | -C "error" |
| 6433 | |
| 6434 | requires_gnutls |
| 6435 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6436 | "$G_SRV -u --mtu 128" \ |
| 6437 | "$P_CLI dtls=1 debug_level=2" \ |
| 6438 | 0 \ |
| 6439 | -c "found fragmented DTLS handshake message" \ |
| 6440 | -C "error" |
| 6441 | |
| 6442 | requires_gnutls |
| 6443 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6444 | "$G_SRV -u --mtu 128" \ |
| 6445 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6446 | 0 \ |
| 6447 | -c "found fragmented DTLS handshake message" \ |
| 6448 | -C "error" |
| 6449 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6450 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6451 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6452 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6453 | "$G_SRV -u --mtu 256" \ |
| 6454 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6455 | 0 \ |
| 6456 | -c "found fragmented DTLS handshake message" \ |
| 6457 | -c "client hello, adding renegotiation extension" \ |
| 6458 | -c "found renegotiation extension" \ |
| 6459 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6460 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6461 | -C "error" \ |
| 6462 | -s "Extra-header:" |
| 6463 | |
| 6464 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6465 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6466 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6467 | "$G_SRV -u --mtu 256" \ |
| 6468 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6469 | 0 \ |
| 6470 | -c "found fragmented DTLS handshake message" \ |
| 6471 | -c "client hello, adding renegotiation extension" \ |
| 6472 | -c "found renegotiation extension" \ |
| 6473 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6474 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6475 | -C "error" \ |
| 6476 | -s "Extra-header:" |
| 6477 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6478 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6479 | "$O_SRV -dtls -mtu 2048" \ |
| 6480 | "$P_CLI dtls=1 debug_level=2" \ |
| 6481 | 0 \ |
| 6482 | -C "found fragmented DTLS handshake message" \ |
| 6483 | -C "error" |
| 6484 | |
| 6485 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6486 | "$O_SRV -dtls -mtu 768" \ |
| 6487 | "$P_CLI dtls=1 debug_level=2" \ |
| 6488 | 0 \ |
| 6489 | -c "found fragmented DTLS handshake message" \ |
| 6490 | -C "error" |
| 6491 | |
| 6492 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6493 | "$O_SRV -dtls -mtu 256" \ |
| 6494 | "$P_CLI dtls=1 debug_level=2" \ |
| 6495 | 0 \ |
| 6496 | -c "found fragmented DTLS handshake message" \ |
| 6497 | -C "error" |
| 6498 | |
| 6499 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6500 | "$O_SRV -dtls -mtu 256" \ |
| 6501 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6502 | 0 \ |
| 6503 | -c "found fragmented DTLS handshake message" \ |
| 6504 | -C "error" |
| 6505 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6506 | # Tests for sending fragmented handshake messages with DTLS |
| 6507 | # |
| 6508 | # Use client auth when we need the client to send large messages, |
| 6509 | # and use large cert chains on both sides too (the long chains we have all use |
| 6510 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6511 | # Sizes reached (UDP payload): |
| 6512 | # - 2037B for server certificate |
| 6513 | # - 1542B for client certificate |
| 6514 | # - 1013B for newsessionticket |
| 6515 | # - all others below 512B |
| 6516 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6517 | |
| 6518 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6519 | requires_config_enabled MBEDTLS_RSA_C |
| 6520 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6521 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6522 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6523 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6524 | crt_file=data_files/server7_int-ca.crt \ |
| 6525 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6526 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6527 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6528 | "$P_CLI dtls=1 debug_level=2 \ |
| 6529 | crt_file=data_files/server8_int-ca2.crt \ |
| 6530 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6531 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6532 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6533 | 0 \ |
| 6534 | -S "found fragmented DTLS handshake message" \ |
| 6535 | -C "found fragmented DTLS handshake message" \ |
| 6536 | -C "error" |
| 6537 | |
| 6538 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6539 | requires_config_enabled MBEDTLS_RSA_C |
| 6540 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6541 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6542 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6543 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6544 | crt_file=data_files/server7_int-ca.crt \ |
| 6545 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6546 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6547 | max_frag_len=1024" \ |
| 6548 | "$P_CLI dtls=1 debug_level=2 \ |
| 6549 | crt_file=data_files/server8_int-ca2.crt \ |
| 6550 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6551 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6552 | max_frag_len=2048" \ |
| 6553 | 0 \ |
| 6554 | -S "found fragmented DTLS handshake message" \ |
| 6555 | -c "found fragmented DTLS handshake message" \ |
| 6556 | -C "error" |
| 6557 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6558 | # With the MFL extension, the server has no way of forcing |
| 6559 | # the client to not exceed a certain MTU; hence, the following |
| 6560 | # test can't be replicated with an MTU proxy such as the one |
| 6561 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6562 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6563 | requires_config_enabled MBEDTLS_RSA_C |
| 6564 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6565 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6566 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6567 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6568 | crt_file=data_files/server7_int-ca.crt \ |
| 6569 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6570 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6571 | max_frag_len=512" \ |
| 6572 | "$P_CLI dtls=1 debug_level=2 \ |
| 6573 | crt_file=data_files/server8_int-ca2.crt \ |
| 6574 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6575 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6576 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6577 | 0 \ |
| 6578 | -S "found fragmented DTLS handshake message" \ |
| 6579 | -c "found fragmented DTLS handshake message" \ |
| 6580 | -C "error" |
| 6581 | |
| 6582 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6583 | requires_config_enabled MBEDTLS_RSA_C |
| 6584 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6585 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6586 | 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] | 6587 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6588 | crt_file=data_files/server7_int-ca.crt \ |
| 6589 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6590 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6591 | max_frag_len=2048" \ |
| 6592 | "$P_CLI dtls=1 debug_level=2 \ |
| 6593 | crt_file=data_files/server8_int-ca2.crt \ |
| 6594 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6595 | hs_timeout=2500-60000 \ |
| 6596 | max_frag_len=1024" \ |
| 6597 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6598 | -S "found fragmented DTLS handshake message" \ |
| 6599 | -c "found fragmented DTLS handshake message" \ |
| 6600 | -C "error" |
| 6601 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6602 | # While not required by the standard defining the MFL extension |
| 6603 | # (according to which it only applies to records, not to datagrams), |
| 6604 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6605 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6606 | # to the peer. |
| 6607 | # The next test checks that no datagrams significantly larger than the |
| 6608 | # negotiated MFL are sent. |
| 6609 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6610 | requires_config_enabled MBEDTLS_RSA_C |
| 6611 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6612 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6613 | 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] | 6614 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6615 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6616 | crt_file=data_files/server7_int-ca.crt \ |
| 6617 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6618 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6619 | max_frag_len=2048" \ |
| 6620 | "$P_CLI dtls=1 debug_level=2 \ |
| 6621 | crt_file=data_files/server8_int-ca2.crt \ |
| 6622 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6623 | hs_timeout=2500-60000 \ |
| 6624 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6625 | 0 \ |
| 6626 | -S "found fragmented DTLS handshake message" \ |
| 6627 | -c "found fragmented DTLS handshake message" \ |
| 6628 | -C "error" |
| 6629 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6630 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6631 | requires_config_enabled MBEDTLS_RSA_C |
| 6632 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6633 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6634 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6635 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6636 | crt_file=data_files/server7_int-ca.crt \ |
| 6637 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6638 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6639 | max_frag_len=2048" \ |
| 6640 | "$P_CLI dtls=1 debug_level=2 \ |
| 6641 | crt_file=data_files/server8_int-ca2.crt \ |
| 6642 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6643 | hs_timeout=2500-60000 \ |
| 6644 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6645 | 0 \ |
| 6646 | -s "found fragmented DTLS handshake message" \ |
| 6647 | -c "found fragmented DTLS handshake message" \ |
| 6648 | -C "error" |
| 6649 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6650 | # While not required by the standard defining the MFL extension |
| 6651 | # (according to which it only applies to records, not to datagrams), |
| 6652 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6653 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6654 | # to the peer. |
| 6655 | # The next test checks that no datagrams significantly larger than the |
| 6656 | # negotiated MFL are sent. |
| 6657 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6658 | requires_config_enabled MBEDTLS_RSA_C |
| 6659 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6660 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6661 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6662 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6663 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6664 | crt_file=data_files/server7_int-ca.crt \ |
| 6665 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6666 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6667 | max_frag_len=2048" \ |
| 6668 | "$P_CLI dtls=1 debug_level=2 \ |
| 6669 | crt_file=data_files/server8_int-ca2.crt \ |
| 6670 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6671 | hs_timeout=2500-60000 \ |
| 6672 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6673 | 0 \ |
| 6674 | -s "found fragmented DTLS handshake message" \ |
| 6675 | -c "found fragmented DTLS handshake message" \ |
| 6676 | -C "error" |
| 6677 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6678 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6679 | requires_config_enabled MBEDTLS_RSA_C |
| 6680 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6681 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6682 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6683 | crt_file=data_files/server7_int-ca.crt \ |
| 6684 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6685 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6686 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6687 | "$P_CLI dtls=1 debug_level=2 \ |
| 6688 | crt_file=data_files/server8_int-ca2.crt \ |
| 6689 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6690 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6691 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6692 | 0 \ |
| 6693 | -S "found fragmented DTLS handshake message" \ |
| 6694 | -C "found fragmented DTLS handshake message" \ |
| 6695 | -C "error" |
| 6696 | |
| 6697 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6698 | requires_config_enabled MBEDTLS_RSA_C |
| 6699 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6700 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6701 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6702 | crt_file=data_files/server7_int-ca.crt \ |
| 6703 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6704 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6705 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6706 | "$P_CLI dtls=1 debug_level=2 \ |
| 6707 | crt_file=data_files/server8_int-ca2.crt \ |
| 6708 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6709 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6710 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6711 | 0 \ |
| 6712 | -s "found fragmented DTLS handshake message" \ |
| 6713 | -C "found fragmented DTLS handshake message" \ |
| 6714 | -C "error" |
| 6715 | |
| 6716 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6717 | requires_config_enabled MBEDTLS_RSA_C |
| 6718 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6719 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6720 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6721 | crt_file=data_files/server7_int-ca.crt \ |
| 6722 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6723 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6724 | mtu=512" \ |
| 6725 | "$P_CLI dtls=1 debug_level=2 \ |
| 6726 | crt_file=data_files/server8_int-ca2.crt \ |
| 6727 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6728 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6729 | mtu=2048" \ |
| 6730 | 0 \ |
| 6731 | -S "found fragmented DTLS handshake message" \ |
| 6732 | -c "found fragmented DTLS handshake message" \ |
| 6733 | -C "error" |
| 6734 | |
| 6735 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6736 | requires_config_enabled MBEDTLS_RSA_C |
| 6737 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6738 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6739 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6740 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6741 | crt_file=data_files/server7_int-ca.crt \ |
| 6742 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6743 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6744 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6745 | "$P_CLI dtls=1 debug_level=2 \ |
| 6746 | crt_file=data_files/server8_int-ca2.crt \ |
| 6747 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6748 | hs_timeout=2500-60000 \ |
| 6749 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6750 | 0 \ |
| 6751 | -s "found fragmented DTLS handshake message" \ |
| 6752 | -c "found fragmented DTLS handshake message" \ |
| 6753 | -C "error" |
| 6754 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6755 | # 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] | 6756 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6757 | requires_config_enabled MBEDTLS_RSA_C |
| 6758 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6759 | requires_config_enabled MBEDTLS_SHA256_C |
| 6760 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6761 | requires_config_enabled MBEDTLS_AES_C |
| 6762 | requires_config_enabled MBEDTLS_GCM_C |
| 6763 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6764 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6765 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6766 | crt_file=data_files/server7_int-ca.crt \ |
| 6767 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6768 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6769 | mtu=512" \ |
| 6770 | "$P_CLI dtls=1 debug_level=2 \ |
| 6771 | crt_file=data_files/server8_int-ca2.crt \ |
| 6772 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6773 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6774 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6775 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6776 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6777 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6778 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6779 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6780 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6781 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6782 | # 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] | 6783 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 6784 | # retransmissions, but in some cases (like both the server and client using |
| 6785 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 6786 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 6787 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6788 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6789 | requires_config_enabled MBEDTLS_RSA_C |
| 6790 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6791 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6792 | requires_config_enabled MBEDTLS_AES_C |
| 6793 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 6794 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6795 | -p "$P_PXY mtu=508" \ |
| 6796 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6797 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6798 | key_file=data_files/server7.key \ |
| 6799 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6800 | "$P_CLI dtls=1 debug_level=2 \ |
| 6801 | crt_file=data_files/server8_int-ca2.crt \ |
| 6802 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6803 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6804 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6805 | 0 \ |
| 6806 | -s "found fragmented DTLS handshake message" \ |
| 6807 | -c "found fragmented DTLS handshake message" \ |
| 6808 | -C "error" |
| 6809 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6810 | # 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] | 6811 | only_with_valgrind |
| 6812 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6813 | requires_config_enabled MBEDTLS_RSA_C |
| 6814 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6815 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6816 | requires_config_enabled MBEDTLS_AES_C |
| 6817 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 6818 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6819 | -p "$P_PXY mtu=508" \ |
| 6820 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6821 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6822 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6823 | hs_timeout=250-10000" \ |
| 6824 | "$P_CLI dtls=1 debug_level=2 \ |
| 6825 | crt_file=data_files/server8_int-ca2.crt \ |
| 6826 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6827 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6828 | hs_timeout=250-10000" \ |
| 6829 | 0 \ |
| 6830 | -s "found fragmented DTLS handshake message" \ |
| 6831 | -c "found fragmented DTLS handshake message" \ |
| 6832 | -C "error" |
| 6833 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6834 | # 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] | 6835 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6836 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6837 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6838 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6839 | requires_config_enabled MBEDTLS_RSA_C |
| 6840 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6841 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6842 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6843 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6844 | crt_file=data_files/server7_int-ca.crt \ |
| 6845 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6846 | hs_timeout=10000-60000 \ |
| 6847 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6848 | "$P_CLI dtls=1 debug_level=2 \ |
| 6849 | crt_file=data_files/server8_int-ca2.crt \ |
| 6850 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6851 | hs_timeout=10000-60000 \ |
| 6852 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6853 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6854 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6855 | -s "found fragmented DTLS handshake message" \ |
| 6856 | -c "found fragmented DTLS handshake message" \ |
| 6857 | -C "error" |
| 6858 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6859 | # 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] | 6860 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 6861 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6862 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6863 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6864 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6865 | requires_config_enabled MBEDTLS_RSA_C |
| 6866 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6867 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6868 | requires_config_enabled MBEDTLS_AES_C |
| 6869 | requires_config_enabled MBEDTLS_GCM_C |
| 6870 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6871 | -p "$P_PXY mtu=512" \ |
| 6872 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6873 | crt_file=data_files/server7_int-ca.crt \ |
| 6874 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6875 | hs_timeout=10000-60000 \ |
| 6876 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6877 | "$P_CLI dtls=1 debug_level=2 \ |
| 6878 | crt_file=data_files/server8_int-ca2.crt \ |
| 6879 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6880 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6881 | hs_timeout=10000-60000 \ |
| 6882 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6883 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6884 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6885 | -s "found fragmented DTLS handshake message" \ |
| 6886 | -c "found fragmented DTLS handshake message" \ |
| 6887 | -C "error" |
| 6888 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6889 | not_with_valgrind # spurious autoreduction due to timeout |
| 6890 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6891 | requires_config_enabled MBEDTLS_RSA_C |
| 6892 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6893 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6894 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6895 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6896 | crt_file=data_files/server7_int-ca.crt \ |
| 6897 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6898 | hs_timeout=10000-60000 \ |
| 6899 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6900 | "$P_CLI dtls=1 debug_level=2 \ |
| 6901 | crt_file=data_files/server8_int-ca2.crt \ |
| 6902 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6903 | hs_timeout=10000-60000 \ |
| 6904 | mtu=1024 nbio=2" \ |
| 6905 | 0 \ |
| 6906 | -S "autoreduction" \ |
| 6907 | -s "found fragmented DTLS handshake message" \ |
| 6908 | -c "found fragmented DTLS handshake message" \ |
| 6909 | -C "error" |
| 6910 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6911 | # 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] | 6912 | not_with_valgrind # spurious autoreduction due to timeout |
| 6913 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6914 | requires_config_enabled MBEDTLS_RSA_C |
| 6915 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6916 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6917 | requires_config_enabled MBEDTLS_AES_C |
| 6918 | requires_config_enabled MBEDTLS_GCM_C |
| 6919 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 6920 | -p "$P_PXY mtu=512" \ |
| 6921 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6922 | crt_file=data_files/server7_int-ca.crt \ |
| 6923 | key_file=data_files/server7.key \ |
| 6924 | hs_timeout=10000-60000 \ |
| 6925 | mtu=512 nbio=2" \ |
| 6926 | "$P_CLI dtls=1 debug_level=2 \ |
| 6927 | crt_file=data_files/server8_int-ca2.crt \ |
| 6928 | key_file=data_files/server8.key \ |
| 6929 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6930 | hs_timeout=10000-60000 \ |
| 6931 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6932 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6933 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6934 | -s "found fragmented DTLS handshake message" \ |
| 6935 | -c "found fragmented DTLS handshake message" \ |
| 6936 | -C "error" |
| 6937 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6938 | # 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] | 6939 | # This ensures things still work after session_reset(). |
| 6940 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6941 | # Since we don't support reading fragmented ClientHello yet, |
| 6942 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 6943 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6944 | # An autoreduction on the client-side might happen if the server is |
| 6945 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6946 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6947 | # resumed listening, which would result in a spurious autoreduction. |
| 6948 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6949 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6950 | requires_config_enabled MBEDTLS_RSA_C |
| 6951 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6952 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6953 | requires_config_enabled MBEDTLS_AES_C |
| 6954 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6955 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 6956 | -p "$P_PXY mtu=1450" \ |
| 6957 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6958 | crt_file=data_files/server7_int-ca.crt \ |
| 6959 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6960 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6961 | mtu=1450" \ |
| 6962 | "$P_CLI dtls=1 debug_level=2 \ |
| 6963 | crt_file=data_files/server8_int-ca2.crt \ |
| 6964 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6965 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6966 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 6967 | 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] | 6968 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6969 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6970 | -s "found fragmented DTLS handshake message" \ |
| 6971 | -c "found fragmented DTLS handshake message" \ |
| 6972 | -C "error" |
| 6973 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6974 | # An autoreduction on the client-side might happen if the server is |
| 6975 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 6976 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6977 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6978 | requires_config_enabled MBEDTLS_RSA_C |
| 6979 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6980 | requires_config_enabled MBEDTLS_SHA256_C |
| 6981 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6982 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 6983 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 6984 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 6985 | -p "$P_PXY mtu=512" \ |
| 6986 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6987 | crt_file=data_files/server7_int-ca.crt \ |
| 6988 | key_file=data_files/server7.key \ |
| 6989 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6990 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6991 | mtu=512" \ |
| 6992 | "$P_CLI dtls=1 debug_level=2 \ |
| 6993 | crt_file=data_files/server8_int-ca2.crt \ |
| 6994 | key_file=data_files/server8.key \ |
| 6995 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6996 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6997 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6998 | mtu=512" \ |
| 6999 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7000 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7001 | -s "found fragmented DTLS handshake message" \ |
| 7002 | -c "found fragmented DTLS handshake message" \ |
| 7003 | -C "error" |
| 7004 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7005 | # An autoreduction on the client-side might happen if the server is |
| 7006 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7007 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7008 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7009 | requires_config_enabled MBEDTLS_RSA_C |
| 7010 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7011 | requires_config_enabled MBEDTLS_SHA256_C |
| 7012 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7013 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7014 | requires_config_enabled MBEDTLS_AES_C |
| 7015 | requires_config_enabled MBEDTLS_GCM_C |
| 7016 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7017 | -p "$P_PXY mtu=512" \ |
| 7018 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7019 | crt_file=data_files/server7_int-ca.crt \ |
| 7020 | key_file=data_files/server7.key \ |
| 7021 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7022 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7023 | mtu=512" \ |
| 7024 | "$P_CLI dtls=1 debug_level=2 \ |
| 7025 | crt_file=data_files/server8_int-ca2.crt \ |
| 7026 | key_file=data_files/server8.key \ |
| 7027 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7028 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7029 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7030 | mtu=512" \ |
| 7031 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7032 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7033 | -s "found fragmented DTLS handshake message" \ |
| 7034 | -c "found fragmented DTLS handshake message" \ |
| 7035 | -C "error" |
| 7036 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7037 | # An autoreduction on the client-side might happen if the server is |
| 7038 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7039 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7040 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7041 | requires_config_enabled MBEDTLS_RSA_C |
| 7042 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7043 | requires_config_enabled MBEDTLS_SHA256_C |
| 7044 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7045 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7046 | requires_config_enabled MBEDTLS_AES_C |
| 7047 | requires_config_enabled MBEDTLS_CCM_C |
| 7048 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7049 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7050 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7051 | crt_file=data_files/server7_int-ca.crt \ |
| 7052 | key_file=data_files/server7.key \ |
| 7053 | exchanges=2 renegotiation=1 \ |
| 7054 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7055 | hs_timeout=10000-60000 \ |
| 7056 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7057 | "$P_CLI dtls=1 debug_level=2 \ |
| 7058 | crt_file=data_files/server8_int-ca2.crt \ |
| 7059 | key_file=data_files/server8.key \ |
| 7060 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7061 | hs_timeout=10000-60000 \ |
| 7062 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7063 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7064 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7065 | -s "found fragmented DTLS handshake message" \ |
| 7066 | -c "found fragmented DTLS handshake message" \ |
| 7067 | -C "error" |
| 7068 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7069 | # An autoreduction on the client-side might happen if the server is |
| 7070 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7071 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7072 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7073 | requires_config_enabled MBEDTLS_RSA_C |
| 7074 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7075 | requires_config_enabled MBEDTLS_SHA256_C |
| 7076 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7077 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7078 | requires_config_enabled MBEDTLS_AES_C |
| 7079 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7080 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 7081 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7082 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7083 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7084 | crt_file=data_files/server7_int-ca.crt \ |
| 7085 | key_file=data_files/server7.key \ |
| 7086 | exchanges=2 renegotiation=1 \ |
| 7087 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7088 | hs_timeout=10000-60000 \ |
| 7089 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7090 | "$P_CLI dtls=1 debug_level=2 \ |
| 7091 | crt_file=data_files/server8_int-ca2.crt \ |
| 7092 | key_file=data_files/server8.key \ |
| 7093 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7094 | hs_timeout=10000-60000 \ |
| 7095 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7096 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7097 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7098 | -s "found fragmented DTLS handshake message" \ |
| 7099 | -c "found fragmented DTLS handshake message" \ |
| 7100 | -C "error" |
| 7101 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7102 | # An autoreduction on the client-side might happen if the server is |
| 7103 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7104 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7105 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7106 | requires_config_enabled MBEDTLS_RSA_C |
| 7107 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7108 | requires_config_enabled MBEDTLS_SHA256_C |
| 7109 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7110 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7111 | requires_config_enabled MBEDTLS_AES_C |
| 7112 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7113 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7114 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7115 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7116 | crt_file=data_files/server7_int-ca.crt \ |
| 7117 | key_file=data_files/server7.key \ |
| 7118 | exchanges=2 renegotiation=1 \ |
| 7119 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7120 | hs_timeout=10000-60000 \ |
| 7121 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7122 | "$P_CLI dtls=1 debug_level=2 \ |
| 7123 | crt_file=data_files/server8_int-ca2.crt \ |
| 7124 | key_file=data_files/server8.key \ |
| 7125 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7126 | hs_timeout=10000-60000 \ |
| 7127 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7128 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7129 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7130 | -s "found fragmented DTLS handshake message" \ |
| 7131 | -c "found fragmented DTLS handshake message" \ |
| 7132 | -C "error" |
| 7133 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7134 | # 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] | 7135 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7136 | requires_config_enabled MBEDTLS_RSA_C |
| 7137 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7138 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7139 | requires_config_enabled MBEDTLS_AES_C |
| 7140 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7141 | client_needs_more_time 2 |
| 7142 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7143 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7144 | "$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] | 7145 | crt_file=data_files/server7_int-ca.crt \ |
| 7146 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7147 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7148 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7149 | crt_file=data_files/server8_int-ca2.crt \ |
| 7150 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7151 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7152 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7153 | 0 \ |
| 7154 | -s "found fragmented DTLS handshake message" \ |
| 7155 | -c "found fragmented DTLS handshake message" \ |
| 7156 | -C "error" |
| 7157 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7158 | # 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] | 7159 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7160 | requires_config_enabled MBEDTLS_RSA_C |
| 7161 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7162 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7163 | requires_config_enabled MBEDTLS_AES_C |
| 7164 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7165 | client_needs_more_time 2 |
| 7166 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7167 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7168 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7169 | crt_file=data_files/server7_int-ca.crt \ |
| 7170 | key_file=data_files/server7.key \ |
| 7171 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7172 | "$P_CLI dtls=1 debug_level=2 \ |
| 7173 | crt_file=data_files/server8_int-ca2.crt \ |
| 7174 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7175 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7176 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7177 | 0 \ |
| 7178 | -s "found fragmented DTLS handshake message" \ |
| 7179 | -c "found fragmented DTLS handshake message" \ |
| 7180 | -C "error" |
| 7181 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7182 | # interop tests for DTLS fragmentating with reliable connection |
| 7183 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7184 | # here and below we just want to test that the we fragment in a way that |
| 7185 | # pleases other implementations, so we don't need the peer to fragment |
| 7186 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7187 | requires_config_enabled MBEDTLS_RSA_C |
| 7188 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7189 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7190 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7191 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7192 | "$G_SRV -u" \ |
| 7193 | "$P_CLI dtls=1 debug_level=2 \ |
| 7194 | crt_file=data_files/server8_int-ca2.crt \ |
| 7195 | key_file=data_files/server8.key \ |
| 7196 | mtu=512 force_version=dtls1_2" \ |
| 7197 | 0 \ |
| 7198 | -c "fragmenting handshake message" \ |
| 7199 | -C "error" |
| 7200 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7201 | # We use --insecure for the GnuTLS client because it expects |
| 7202 | # the hostname / IP it connects to to be the name used in the |
| 7203 | # certificate obtained from the server. Here, however, it |
| 7204 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7205 | # as the server name in the certificate. This will make the |
| 7206 | # certifiate validation fail, but passing --insecure makes |
| 7207 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7208 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7209 | requires_config_enabled MBEDTLS_RSA_C |
| 7210 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7211 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7212 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7213 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7214 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7215 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7216 | crt_file=data_files/server7_int-ca.crt \ |
| 7217 | key_file=data_files/server7.key \ |
| 7218 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7219 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7220 | 0 \ |
| 7221 | -s "fragmenting handshake message" |
| 7222 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7223 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7224 | requires_config_enabled MBEDTLS_RSA_C |
| 7225 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7226 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7227 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7228 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7229 | "$P_CLI dtls=1 debug_level=2 \ |
| 7230 | crt_file=data_files/server8_int-ca2.crt \ |
| 7231 | key_file=data_files/server8.key \ |
| 7232 | mtu=512 force_version=dtls1_2" \ |
| 7233 | 0 \ |
| 7234 | -c "fragmenting handshake message" \ |
| 7235 | -C "error" |
| 7236 | |
| 7237 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7238 | requires_config_enabled MBEDTLS_RSA_C |
| 7239 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7240 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7241 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7242 | "$P_SRV dtls=1 debug_level=2 \ |
| 7243 | crt_file=data_files/server7_int-ca.crt \ |
| 7244 | key_file=data_files/server7.key \ |
| 7245 | mtu=512 force_version=dtls1_2" \ |
| 7246 | "$O_CLI -dtls1_2" \ |
| 7247 | 0 \ |
| 7248 | -s "fragmenting handshake message" |
| 7249 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7250 | # interop tests for DTLS fragmentating with unreliable connection |
| 7251 | # |
| 7252 | # again we just want to test that the we fragment in a way that |
| 7253 | # pleases other implementations, so we don't need the peer to fragment |
| 7254 | requires_gnutls_next |
| 7255 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7256 | requires_config_enabled MBEDTLS_RSA_C |
| 7257 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7258 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7259 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7260 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7261 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7262 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7263 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7264 | crt_file=data_files/server8_int-ca2.crt \ |
| 7265 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7266 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7267 | 0 \ |
| 7268 | -c "fragmenting handshake message" \ |
| 7269 | -C "error" |
| 7270 | |
| 7271 | requires_gnutls_next |
| 7272 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7273 | requires_config_enabled MBEDTLS_RSA_C |
| 7274 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7276 | client_needs_more_time 4 |
| 7277 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7278 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7279 | "$P_SRV dtls=1 debug_level=2 \ |
| 7280 | crt_file=data_files/server7_int-ca.crt \ |
| 7281 | key_file=data_files/server7.key \ |
| 7282 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7283 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7284 | 0 \ |
| 7285 | -s "fragmenting handshake message" |
| 7286 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7287 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7288 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7289 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7290 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7291 | ## (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] | 7292 | skip_next_test |
| 7293 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7294 | requires_config_enabled MBEDTLS_RSA_C |
| 7295 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7296 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7297 | client_needs_more_time 4 |
| 7298 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7299 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7300 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7301 | "$P_CLI dtls=1 debug_level=2 \ |
| 7302 | crt_file=data_files/server8_int-ca2.crt \ |
| 7303 | key_file=data_files/server8.key \ |
| 7304 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7305 | 0 \ |
| 7306 | -c "fragmenting handshake message" \ |
| 7307 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7308 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7309 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7310 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7311 | requires_config_enabled MBEDTLS_RSA_C |
| 7312 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7313 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7314 | client_needs_more_time 4 |
| 7315 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7316 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7317 | "$P_SRV dtls=1 debug_level=2 \ |
| 7318 | crt_file=data_files/server7_int-ca.crt \ |
| 7319 | key_file=data_files/server7.key \ |
| 7320 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7321 | "$O_CLI -dtls1_2" \ |
| 7322 | 0 \ |
| 7323 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7324 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7325 | # Tests for DTLS-SRTP (RFC 5764) |
| 7326 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7327 | run_test "DTLS-SRTP all profiles supported" \ |
| 7328 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7329 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7330 | 0 \ |
| 7331 | -s "found use_srtp extension" \ |
| 7332 | -s "found srtp profile" \ |
| 7333 | -s "selected srtp profile" \ |
| 7334 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7335 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7336 | -c "client hello, adding use_srtp extension" \ |
| 7337 | -c "found use_srtp extension" \ |
| 7338 | -c "found srtp profile" \ |
| 7339 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7340 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7341 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7342 | -C "error" |
| 7343 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7344 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7345 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7346 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7347 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7348 | "$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] | 7349 | 0 \ |
| 7350 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7351 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7352 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7353 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7354 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7355 | -c "client hello, adding use_srtp extension" \ |
| 7356 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7357 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7358 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7359 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7360 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7361 | -C "error" |
| 7362 | |
| 7363 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7364 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7365 | "$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] | 7366 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7367 | 0 \ |
| 7368 | -s "found use_srtp extension" \ |
| 7369 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7370 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7371 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7372 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7373 | -c "client hello, adding use_srtp extension" \ |
| 7374 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7375 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7376 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7377 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7378 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7379 | -C "error" |
| 7380 | |
| 7381 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7382 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7383 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7384 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7385 | 0 \ |
| 7386 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7387 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7388 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7389 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7390 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7391 | -c "client hello, adding use_srtp extension" \ |
| 7392 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7393 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7394 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7395 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7396 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7397 | -C "error" |
| 7398 | |
| 7399 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7400 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7401 | "$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] | 7402 | "$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] | 7403 | 0 \ |
| 7404 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7405 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7406 | -S "selected srtp profile" \ |
| 7407 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7408 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7409 | -c "client hello, adding use_srtp extension" \ |
| 7410 | -C "found use_srtp extension" \ |
| 7411 | -C "found srtp profile" \ |
| 7412 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7413 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7414 | -C "error" |
| 7415 | |
| 7416 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7417 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7418 | "$P_SRV dtls=1 debug_level=3" \ |
| 7419 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7420 | 0 \ |
| 7421 | -s "found use_srtp extension" \ |
| 7422 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7423 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7424 | -c "client hello, adding use_srtp extension" \ |
| 7425 | -C "found use_srtp extension" \ |
| 7426 | -C "found srtp profile" \ |
| 7427 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7428 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7429 | -C "error" |
| 7430 | |
| 7431 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7432 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 7433 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7434 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7435 | 0 \ |
| 7436 | -s "found use_srtp extension" \ |
| 7437 | -s "found srtp profile" \ |
| 7438 | -s "selected srtp profile" \ |
| 7439 | -s "server hello, adding use_srtp extension" \ |
| 7440 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7441 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7442 | -c "client hello, adding use_srtp extension" \ |
| 7443 | -c "found use_srtp extension" \ |
| 7444 | -c "found srtp profile" \ |
| 7445 | -c "selected srtp profile" \ |
| 7446 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7447 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7448 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7449 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7450 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7451 | -C "error" |
| 7452 | |
| 7453 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7454 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7455 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7456 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7457 | 0 \ |
| 7458 | -s "found use_srtp extension" \ |
| 7459 | -s "found srtp profile" \ |
| 7460 | -s "selected srtp profile" \ |
| 7461 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7462 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7463 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7464 | -S "dumping 'using mki' (8 bytes)" \ |
| 7465 | -c "client hello, adding use_srtp extension" \ |
| 7466 | -c "found use_srtp extension" \ |
| 7467 | -c "found srtp profile" \ |
| 7468 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7469 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7470 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7471 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7472 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7473 | -C "dumping 'received mki' (8 bytes)" \ |
| 7474 | -C "error" |
| 7475 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7476 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7477 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7478 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7479 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7480 | 0 \ |
| 7481 | -s "found use_srtp extension" \ |
| 7482 | -s "found srtp profile" \ |
| 7483 | -s "selected srtp profile" \ |
| 7484 | -s "server hello, adding use_srtp extension" \ |
| 7485 | -s "DTLS-SRTP key material is"\ |
| 7486 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7487 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7488 | |
| 7489 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7490 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7491 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7492 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7493 | 0 \ |
| 7494 | -s "found use_srtp extension" \ |
| 7495 | -s "found srtp profile" \ |
| 7496 | -s "selected srtp profile" \ |
| 7497 | -s "server hello, adding use_srtp extension" \ |
| 7498 | -s "DTLS-SRTP key material is"\ |
| 7499 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7500 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7501 | |
| 7502 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7503 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7504 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7505 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7506 | 0 \ |
| 7507 | -s "found use_srtp extension" \ |
| 7508 | -s "found srtp profile" \ |
| 7509 | -s "selected srtp profile" \ |
| 7510 | -s "server hello, adding use_srtp extension" \ |
| 7511 | -s "DTLS-SRTP key material is"\ |
| 7512 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7513 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7514 | |
| 7515 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7516 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7517 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7518 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7519 | 0 \ |
| 7520 | -s "found use_srtp extension" \ |
| 7521 | -s "found srtp profile" \ |
| 7522 | -s "selected srtp profile" \ |
| 7523 | -s "server hello, adding use_srtp extension" \ |
| 7524 | -s "DTLS-SRTP key material is"\ |
| 7525 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7526 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7527 | |
| 7528 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7529 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7530 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7531 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7532 | 0 \ |
| 7533 | -s "found use_srtp extension" \ |
| 7534 | -s "found srtp profile" \ |
| 7535 | -s "selected srtp profile" \ |
| 7536 | -s "server hello, adding use_srtp extension" \ |
| 7537 | -s "DTLS-SRTP key material is"\ |
| 7538 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7539 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7540 | |
| 7541 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7542 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7543 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7544 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7545 | 0 \ |
| 7546 | -s "found use_srtp extension" \ |
| 7547 | -s "found srtp profile" \ |
| 7548 | -S "selected srtp profile" \ |
| 7549 | -S "server hello, adding use_srtp extension" \ |
| 7550 | -S "DTLS-SRTP key material is"\ |
| 7551 | -C "SRTP Extension negotiated, profile" |
| 7552 | |
| 7553 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7554 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7555 | "$P_SRV dtls=1 debug_level=3" \ |
| 7556 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7557 | 0 \ |
| 7558 | -s "found use_srtp extension" \ |
| 7559 | -S "server hello, adding use_srtp extension" \ |
| 7560 | -S "DTLS-SRTP key material is"\ |
| 7561 | -C "SRTP Extension negotiated, profile" |
| 7562 | |
| 7563 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7564 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7565 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7566 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7567 | 0 \ |
| 7568 | -c "client hello, adding use_srtp extension" \ |
| 7569 | -c "found use_srtp extension" \ |
| 7570 | -c "found srtp profile" \ |
| 7571 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7572 | -c "DTLS-SRTP key material is"\ |
| 7573 | -C "error" |
| 7574 | |
| 7575 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7576 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7577 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7578 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7579 | 0 \ |
| 7580 | -c "client hello, adding use_srtp extension" \ |
| 7581 | -c "found use_srtp extension" \ |
| 7582 | -c "found srtp profile" \ |
| 7583 | -c "selected srtp profile" \ |
| 7584 | -c "DTLS-SRTP key material is"\ |
| 7585 | -C "error" |
| 7586 | |
| 7587 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7588 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7589 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7590 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7591 | 0 \ |
| 7592 | -c "client hello, adding use_srtp extension" \ |
| 7593 | -c "found use_srtp extension" \ |
| 7594 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7595 | -c "selected srtp profile" \ |
| 7596 | -c "DTLS-SRTP key material is"\ |
| 7597 | -C "error" |
| 7598 | |
| 7599 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7600 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7601 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7602 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7603 | 0 \ |
| 7604 | -c "client hello, adding use_srtp extension" \ |
| 7605 | -c "found use_srtp extension" \ |
| 7606 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7607 | -c "selected srtp profile" \ |
| 7608 | -c "DTLS-SRTP key material is"\ |
| 7609 | -C "error" |
| 7610 | |
| 7611 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7612 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7613 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7614 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7615 | 0 \ |
| 7616 | -c "client hello, adding use_srtp extension" \ |
| 7617 | -c "found use_srtp extension" \ |
| 7618 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7619 | -c "selected srtp profile" \ |
| 7620 | -c "DTLS-SRTP key material is"\ |
| 7621 | -C "error" |
| 7622 | |
| 7623 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7624 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 7625 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7626 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 7627 | 0 \ |
| 7628 | -c "client hello, adding use_srtp extension" \ |
| 7629 | -C "found use_srtp extension" \ |
| 7630 | -C "found srtp profile" \ |
| 7631 | -C "selected srtp profile" \ |
| 7632 | -C "DTLS-SRTP key material is"\ |
| 7633 | -C "error" |
| 7634 | |
| 7635 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7636 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 7637 | "$O_SRV -dtls" \ |
| 7638 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7639 | 0 \ |
| 7640 | -c "client hello, adding use_srtp extension" \ |
| 7641 | -C "found use_srtp extension" \ |
| 7642 | -C "found srtp profile" \ |
| 7643 | -C "selected srtp profile" \ |
| 7644 | -C "DTLS-SRTP key material is"\ |
| 7645 | -C "error" |
| 7646 | |
| 7647 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7648 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 7649 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7650 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7651 | 0 \ |
| 7652 | -c "client hello, adding use_srtp extension" \ |
| 7653 | -c "found use_srtp extension" \ |
| 7654 | -c "found srtp profile" \ |
| 7655 | -c "selected srtp profile" \ |
| 7656 | -c "DTLS-SRTP key material is"\ |
| 7657 | -c "DTLS-SRTP no mki value negotiated"\ |
| 7658 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7659 | -C "dumping 'received mki' (8 bytes)" \ |
| 7660 | -C "error" |
| 7661 | |
| 7662 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7663 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7664 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7665 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7666 | "$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] | 7667 | 0 \ |
| 7668 | -s "found use_srtp extension" \ |
| 7669 | -s "found srtp profile" \ |
| 7670 | -s "selected srtp profile" \ |
| 7671 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7672 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7673 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 7674 | |
| 7675 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7676 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7677 | 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] | 7678 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7679 | "$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] | 7680 | 0 \ |
| 7681 | -s "found use_srtp extension" \ |
| 7682 | -s "found srtp profile" \ |
| 7683 | -s "selected srtp profile" \ |
| 7684 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7685 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7686 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 7687 | |
| 7688 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7689 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7690 | 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] | 7691 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7692 | "$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] | 7693 | 0 \ |
| 7694 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7695 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7696 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7697 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7698 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7699 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7700 | |
| 7701 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7702 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7703 | 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] | 7704 | "$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] | 7705 | "$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] | 7706 | 0 \ |
| 7707 | -s "found use_srtp extension" \ |
| 7708 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7709 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7710 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7711 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7712 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 7713 | |
| 7714 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7715 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7716 | 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] | 7717 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7718 | "$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] | 7719 | 0 \ |
| 7720 | -s "found use_srtp extension" \ |
| 7721 | -s "found srtp profile" \ |
| 7722 | -s "selected srtp profile" \ |
| 7723 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7724 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7725 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7726 | |
| 7727 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7728 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7729 | 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] | 7730 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7731 | "$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] | 7732 | 0 \ |
| 7733 | -s "found use_srtp extension" \ |
| 7734 | -s "found srtp profile" \ |
| 7735 | -S "selected srtp profile" \ |
| 7736 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7737 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7738 | -C "SRTP profile:" |
| 7739 | |
| 7740 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7741 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7742 | 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] | 7743 | "$P_SRV dtls=1 debug_level=3" \ |
| 7744 | "$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] | 7745 | 0 \ |
| 7746 | -s "found use_srtp extension" \ |
| 7747 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7748 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7749 | -C "SRTP profile:" |
| 7750 | |
| 7751 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7752 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7753 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 7754 | "$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" \ |
| 7755 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7756 | 0 \ |
| 7757 | -c "client hello, adding use_srtp extension" \ |
| 7758 | -c "found use_srtp extension" \ |
| 7759 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7760 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7761 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7762 | -C "error" |
| 7763 | |
| 7764 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7765 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7766 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 7767 | "$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" \ |
| 7768 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7769 | 0 \ |
| 7770 | -c "client hello, adding use_srtp extension" \ |
| 7771 | -c "found use_srtp extension" \ |
| 7772 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7773 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7774 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7775 | -C "error" |
| 7776 | |
| 7777 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7778 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7779 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 7780 | "$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" \ |
| 7781 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7782 | 0 \ |
| 7783 | -c "client hello, adding use_srtp extension" \ |
| 7784 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7785 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7786 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7787 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7788 | -C "error" |
| 7789 | |
| 7790 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7791 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7792 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 7793 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7794 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7795 | 0 \ |
| 7796 | -c "client hello, adding use_srtp extension" \ |
| 7797 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7798 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7799 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7800 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7801 | -C "error" |
| 7802 | |
| 7803 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7804 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7805 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 7806 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7807 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7808 | 0 \ |
| 7809 | -c "client hello, adding use_srtp extension" \ |
| 7810 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7811 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7812 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7813 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7814 | -C "error" |
| 7815 | |
| 7816 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7817 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7818 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 7819 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7820 | "$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] | 7821 | 0 \ |
| 7822 | -c "client hello, adding use_srtp extension" \ |
| 7823 | -C "found use_srtp extension" \ |
| 7824 | -C "found srtp profile" \ |
| 7825 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7826 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7827 | -C "error" |
| 7828 | |
| 7829 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7830 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7831 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 7832 | "$G_SRV -u" \ |
| 7833 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7834 | 0 \ |
| 7835 | -c "client hello, adding use_srtp extension" \ |
| 7836 | -C "found use_srtp extension" \ |
| 7837 | -C "found srtp profile" \ |
| 7838 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7839 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7840 | -C "error" |
| 7841 | |
| 7842 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7843 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7844 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 7845 | "$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" \ |
| 7846 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7847 | 0 \ |
| 7848 | -c "client hello, adding use_srtp extension" \ |
| 7849 | -c "found use_srtp extension" \ |
| 7850 | -c "found srtp profile" \ |
| 7851 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7852 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7853 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7854 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7855 | -c "dumping 'received mki' (8 bytes)" \ |
| 7856 | -C "error" |
| 7857 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7858 | # Tests for specific things with "unreliable" UDP connection |
| 7859 | |
| 7860 | not_with_valgrind # spurious resend due to timeout |
| 7861 | run_test "DTLS proxy: reference" \ |
| 7862 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7863 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 7864 | "$P_CLI dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7865 | 0 \ |
| 7866 | -C "replayed record" \ |
| 7867 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 7868 | -C "Buffer record from epoch" \ |
| 7869 | -S "Buffer record from epoch" \ |
| 7870 | -C "ssl_buffer_message" \ |
| 7871 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7872 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7873 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7874 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7875 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7876 | -c "HTTP/1.0 200 OK" |
| 7877 | |
| 7878 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7879 | run_test "DTLS proxy: duplicate every packet" \ |
| 7880 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7881 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 7882 | "$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] | 7883 | 0 \ |
| 7884 | -c "replayed record" \ |
| 7885 | -s "replayed record" \ |
| 7886 | -c "record from another epoch" \ |
| 7887 | -s "record from another epoch" \ |
| 7888 | -S "resend" \ |
| 7889 | -s "Extra-header:" \ |
| 7890 | -c "HTTP/1.0 200 OK" |
| 7891 | |
| 7892 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 7893 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7894 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 7895 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7896 | 0 \ |
| 7897 | -c "replayed record" \ |
| 7898 | -S "replayed record" \ |
| 7899 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7900 | -s "record from another epoch" \ |
| 7901 | -c "resend" \ |
| 7902 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7903 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7904 | -c "HTTP/1.0 200 OK" |
| 7905 | |
| 7906 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 7907 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7908 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7909 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7910 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7911 | -c "next record in same datagram" \ |
| 7912 | -s "next record in same datagram" |
| 7913 | |
| 7914 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 7915 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7916 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7917 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7918 | 0 \ |
| 7919 | -c "next record in same datagram" \ |
| 7920 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7921 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7922 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 7923 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7924 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 7925 | "$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] | 7926 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7927 | -c "discarding invalid record (mac)" \ |
| 7928 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7929 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7930 | -c "HTTP/1.0 200 OK" \ |
| 7931 | -S "too many records with bad MAC" \ |
| 7932 | -S "Verification of the message MAC failed" |
| 7933 | |
| 7934 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 7935 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7936 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 7937 | "$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] | 7938 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7939 | -C "discarding invalid record (mac)" \ |
| 7940 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7941 | -S "Extra-header:" \ |
| 7942 | -C "HTTP/1.0 200 OK" \ |
| 7943 | -s "too many records with bad MAC" \ |
| 7944 | -s "Verification of the message MAC failed" |
| 7945 | |
| 7946 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 7947 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7948 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 7949 | "$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] | 7950 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7951 | -c "discarding invalid record (mac)" \ |
| 7952 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7953 | -s "Extra-header:" \ |
| 7954 | -c "HTTP/1.0 200 OK" \ |
| 7955 | -S "too many records with bad MAC" \ |
| 7956 | -S "Verification of the message MAC failed" |
| 7957 | |
| 7958 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 7959 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7960 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 7961 | "$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] | 7962 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7963 | -c "discarding invalid record (mac)" \ |
| 7964 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7965 | -s "Extra-header:" \ |
| 7966 | -c "HTTP/1.0 200 OK" \ |
| 7967 | -s "too many records with bad MAC" \ |
| 7968 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7969 | |
| 7970 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 7971 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 7972 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 7973 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7974 | 0 \ |
| 7975 | -c "record from another epoch" \ |
| 7976 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7977 | -s "Extra-header:" \ |
| 7978 | -c "HTTP/1.0 200 OK" |
| 7979 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 7980 | # Tests for reordering support with DTLS |
| 7981 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7982 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 7983 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 7984 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 7985 | hs_timeout=2500-60000" \ |
| 7986 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 7987 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7988 | 0 \ |
| 7989 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7990 | -c "Next handshake message has been buffered - load"\ |
| 7991 | -S "Buffering HS message" \ |
| 7992 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7993 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7994 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 7995 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 7996 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 7997 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 7998 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 7999 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8000 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8001 | hs_timeout=2500-60000" \ |
| 8002 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8003 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8004 | 0 \ |
| 8005 | -c "Buffering HS message" \ |
| 8006 | -c "found fragmented DTLS handshake message"\ |
| 8007 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8008 | -c "Next handshake message has been buffered - load"\ |
| 8009 | -S "Buffering HS message" \ |
| 8010 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8011 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8012 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8013 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8014 | -S "Remember CCS message" |
| 8015 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8016 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8017 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8018 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8019 | # while keeping the ServerKeyExchange. |
| 8020 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8021 | 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] | 8022 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8023 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8024 | hs_timeout=2500-60000" \ |
| 8025 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8026 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8027 | 0 \ |
| 8028 | -c "Buffering HS message" \ |
| 8029 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8030 | -C "attempt to make space by freeing buffered messages" \ |
| 8031 | -S "Buffering HS message" \ |
| 8032 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8033 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8034 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8035 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8036 | -S "Remember CCS message" |
| 8037 | |
| 8038 | # The size constraints ensure that the delayed certificate message can't |
| 8039 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8040 | # when dropping it first. |
| 8041 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8042 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8043 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8044 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8045 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8046 | hs_timeout=2500-60000" \ |
| 8047 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8048 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8049 | 0 \ |
| 8050 | -c "Buffering HS message" \ |
| 8051 | -c "attempt to make space by freeing buffered future messages" \ |
| 8052 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8053 | -S "Buffering HS message" \ |
| 8054 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8055 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8056 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8057 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8058 | -S "Remember CCS message" |
| 8059 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8060 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8061 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8062 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8063 | hs_timeout=2500-60000" \ |
| 8064 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8065 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8066 | 0 \ |
| 8067 | -C "Buffering HS message" \ |
| 8068 | -C "Next handshake message has been buffered - load"\ |
| 8069 | -s "Buffering HS message" \ |
| 8070 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8071 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8072 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8073 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8074 | -S "Remember CCS message" |
| 8075 | |
| 8076 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8077 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8078 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8079 | hs_timeout=2500-60000" \ |
| 8080 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8081 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8082 | 0 \ |
| 8083 | -C "Buffering HS message" \ |
| 8084 | -C "Next handshake message has been buffered - load"\ |
| 8085 | -S "Buffering HS message" \ |
| 8086 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8087 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8088 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8089 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8090 | -S "Remember CCS message" |
| 8091 | |
| 8092 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8093 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8094 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8095 | hs_timeout=2500-60000" \ |
| 8096 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8097 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8098 | 0 \ |
| 8099 | -C "Buffering HS message" \ |
| 8100 | -C "Next handshake message has been buffered - load"\ |
| 8101 | -S "Buffering HS message" \ |
| 8102 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8103 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8104 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8105 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8106 | -s "Remember CCS message" |
| 8107 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8108 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8109 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8110 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8111 | hs_timeout=2500-60000" \ |
| 8112 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8113 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8114 | 0 \ |
| 8115 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8116 | -s "Found buffered record from current epoch - load" \ |
| 8117 | -c "Buffer record from epoch 1" \ |
| 8118 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8119 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8120 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8121 | # from the server are delayed, so that the encrypted Finished message |
| 8122 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8123 | # in afterwards, the encrypted Finished message must be freed in order |
| 8124 | # to make space for the NewSessionTicket to be reassembled. |
| 8125 | # This works only in very particular circumstances: |
| 8126 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8127 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8128 | # the encrypted Finished message. |
| 8129 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8130 | # needs to be fragmented. |
| 8131 | # - All messages sent by the server must be small enough to be either sent |
| 8132 | # without fragmentation or be reassembled within the bounds of |
| 8133 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8134 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8135 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8136 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8137 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8138 | -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] | 8139 | "$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] | 8140 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8141 | 0 \ |
| 8142 | -s "Buffer record from epoch 1" \ |
| 8143 | -s "Found buffered record from current epoch - load" \ |
| 8144 | -c "Buffer record from epoch 1" \ |
| 8145 | -C "Found buffered record from current epoch - load" \ |
| 8146 | -c "Enough space available after freeing future epoch record" |
| 8147 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8148 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8149 | |
| 8150 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8151 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8152 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8153 | "$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] | 8154 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8155 | "$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] | 8156 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8157 | 0 \ |
| 8158 | -s "Extra-header:" \ |
| 8159 | -c "HTTP/1.0 200 OK" |
| 8160 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8161 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8162 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8163 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8164 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8165 | "$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] | 8166 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8167 | 0 \ |
| 8168 | -s "Extra-header:" \ |
| 8169 | -c "HTTP/1.0 200 OK" |
| 8170 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8171 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8172 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8173 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8174 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8175 | "$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] | 8176 | 0 \ |
| 8177 | -s "Extra-header:" \ |
| 8178 | -c "HTTP/1.0 200 OK" |
| 8179 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8180 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8181 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8182 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8183 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8184 | "$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] | 8185 | 0 \ |
| 8186 | -s "Extra-header:" \ |
| 8187 | -c "HTTP/1.0 200 OK" |
| 8188 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8189 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8190 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8191 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8192 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8193 | "$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] | 8194 | 0 \ |
| 8195 | -s "Extra-header:" \ |
| 8196 | -c "HTTP/1.0 200 OK" |
| 8197 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8198 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8199 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8200 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8201 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8202 | "$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] | 8203 | 0 \ |
| 8204 | -s "Extra-header:" \ |
| 8205 | -c "HTTP/1.0 200 OK" |
| 8206 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8207 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8208 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8209 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8210 | "$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] | 8211 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8212 | "$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] | 8213 | 0 \ |
| 8214 | -s "Extra-header:" \ |
| 8215 | -c "HTTP/1.0 200 OK" |
| 8216 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8217 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8218 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8219 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8220 | "$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] | 8221 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8222 | "$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] | 8223 | 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] | 8224 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8225 | 0 \ |
| 8226 | -s "a session has been resumed" \ |
| 8227 | -c "a session has been resumed" \ |
| 8228 | -s "Extra-header:" \ |
| 8229 | -c "HTTP/1.0 200 OK" |
| 8230 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8231 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8232 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8233 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8234 | "$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] | 8235 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8236 | "$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] | 8237 | 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] | 8238 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8239 | 0 \ |
| 8240 | -s "a session has been resumed" \ |
| 8241 | -c "a session has been resumed" \ |
| 8242 | -s "Extra-header:" \ |
| 8243 | -c "HTTP/1.0 200 OK" |
| 8244 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8245 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8246 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8247 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8248 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8249 | "$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] | 8250 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8251 | "$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] | 8252 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8253 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8254 | 0 \ |
| 8255 | -c "=> renegotiate" \ |
| 8256 | -s "=> renegotiate" \ |
| 8257 | -s "Extra-header:" \ |
| 8258 | -c "HTTP/1.0 200 OK" |
| 8259 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8260 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8261 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8262 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8263 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8264 | "$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] | 8265 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8266 | "$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] | 8267 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8268 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8269 | 0 \ |
| 8270 | -c "=> renegotiate" \ |
| 8271 | -s "=> renegotiate" \ |
| 8272 | -s "Extra-header:" \ |
| 8273 | -c "HTTP/1.0 200 OK" |
| 8274 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8275 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8276 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8277 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8278 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8279 | "$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] | 8280 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8281 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8282 | "$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] | 8283 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8284 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8285 | 0 \ |
| 8286 | -c "=> renegotiate" \ |
| 8287 | -s "=> renegotiate" \ |
| 8288 | -s "Extra-header:" \ |
| 8289 | -c "HTTP/1.0 200 OK" |
| 8290 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8291 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8292 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8293 | 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] | 8294 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8295 | "$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] | 8296 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8297 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8298 | "$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] | 8299 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8300 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8301 | 0 \ |
| 8302 | -c "=> renegotiate" \ |
| 8303 | -s "=> renegotiate" \ |
| 8304 | -s "Extra-header:" \ |
| 8305 | -c "HTTP/1.0 200 OK" |
| 8306 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8307 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8308 | ## all versions installed on the CI machines), reported here: |
| 8309 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8310 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8311 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8312 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8313 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8314 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8315 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8316 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8317 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8318 | "$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] | 8319 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8320 | -c "HTTP/1.0 200 OK" |
| 8321 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8322 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8323 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8324 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8325 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8326 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8327 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8328 | "$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] | 8329 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8330 | -c "HTTP/1.0 200 OK" |
| 8331 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8332 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8333 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8334 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8335 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8336 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8337 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8338 | "$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] | 8339 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8340 | -c "HTTP/1.0 200 OK" |
| 8341 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8342 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8343 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8344 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8345 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8346 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8347 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8348 | "$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] | 8349 | 0 \ |
| 8350 | -s "Extra-header:" \ |
| 8351 | -c "Extra-header:" |
| 8352 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8353 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8354 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8355 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8356 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8357 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8358 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8359 | "$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] | 8360 | 0 \ |
| 8361 | -s "Extra-header:" \ |
| 8362 | -c "Extra-header:" |
| 8363 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8364 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8365 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8366 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8367 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8368 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8369 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8370 | "$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] | 8371 | 0 \ |
| 8372 | -s "Extra-header:" \ |
| 8373 | -c "Extra-header:" |
| 8374 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8375 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8376 | run_test "export keys functionality" \ |
| 8377 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8378 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8379 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8380 | -c "EAP-TLS key material is:"\ |
| 8381 | -s "EAP-TLS key material is:"\ |
| 8382 | -c "EAP-TLS IV is:" \ |
| 8383 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8384 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8385 | # Test heap memory usage after handshake |
| 8386 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8387 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8388 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 8389 | run_tests_memory_after_hanshake |
| 8390 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8391 | # Final report |
| 8392 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8393 | echo "------------------------------------------------------------------------" |
| 8394 | |
| 8395 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8396 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8397 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8398 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8399 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8400 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8401 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8402 | |
| 8403 | exit $FAILS |