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() { |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 54 | if git diff --quiet ../include/mbedtls/mbedtls_config.h 2>/dev/null; then |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 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 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 96 | CONFIG_H='../include/mbedtls/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 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 181 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 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 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 197 | # skip next test if the flag is not enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 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 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 205 | # skip next test if the flag is enabled in mbedtls_config.h |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 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 |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 260 | # enabled. |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 261 | maybe_requires_ciphersuite_enabled() { |
| 262 | case "$1" in |
| 263 | *\ force_ciphersuite=*) :;; |
| 264 | *) return;; # No specific required ciphersuite |
| 265 | esac |
| 266 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 267 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 268 | shift |
| 269 | |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 270 | requires_ciphersuite_enabled "$ciphersuite" |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 271 | |
| 272 | unset ciphersuite |
| 273 | } |
| 274 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 275 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 276 | requires_openssl_with_fallback_scsv() { |
| 277 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 278 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 279 | then |
| 280 | OPENSSL_HAS_FBSCSV="YES" |
| 281 | else |
| 282 | OPENSSL_HAS_FBSCSV="NO" |
| 283 | fi |
| 284 | fi |
| 285 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 286 | SKIP_NEXT="YES" |
| 287 | fi |
| 288 | } |
| 289 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 290 | # skip next test if GnuTLS isn't available |
| 291 | requires_gnutls() { |
| 292 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 293 | 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] | 294 | GNUTLS_AVAILABLE="YES" |
| 295 | else |
| 296 | GNUTLS_AVAILABLE="NO" |
| 297 | fi |
| 298 | fi |
| 299 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 300 | SKIP_NEXT="YES" |
| 301 | fi |
| 302 | } |
| 303 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 304 | # skip next test if GnuTLS-next isn't available |
| 305 | requires_gnutls_next() { |
| 306 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 307 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 308 | GNUTLS_NEXT_AVAILABLE="YES" |
| 309 | else |
| 310 | GNUTLS_NEXT_AVAILABLE="NO" |
| 311 | fi |
| 312 | fi |
| 313 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 314 | SKIP_NEXT="YES" |
| 315 | fi |
| 316 | } |
| 317 | |
| 318 | # skip next test if OpenSSL-legacy isn't available |
| 319 | requires_openssl_legacy() { |
| 320 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 321 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 322 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 323 | else |
| 324 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 325 | fi |
| 326 | fi |
| 327 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 328 | SKIP_NEXT="YES" |
| 329 | fi |
| 330 | } |
| 331 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 332 | # skip next test if IPv6 isn't available on this host |
| 333 | requires_ipv6() { |
| 334 | if [ -z "${HAS_IPV6:-}" ]; then |
| 335 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 336 | SRV_PID=$! |
| 337 | sleep 1 |
| 338 | kill $SRV_PID >/dev/null 2>&1 |
| 339 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 340 | HAS_IPV6="NO" |
| 341 | else |
| 342 | HAS_IPV6="YES" |
| 343 | fi |
| 344 | rm -r $SRV_OUT |
| 345 | fi |
| 346 | |
| 347 | if [ "$HAS_IPV6" = "NO" ]; then |
| 348 | SKIP_NEXT="YES" |
| 349 | fi |
| 350 | } |
| 351 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 352 | # skip next test if it's i686 or uname is not available |
| 353 | requires_not_i686() { |
| 354 | if [ -z "${IS_I686:-}" ]; then |
| 355 | IS_I686="YES" |
| 356 | if which "uname" >/dev/null 2>&1; then |
| 357 | if [ -z "$(uname -a | grep i686)" ]; then |
| 358 | IS_I686="NO" |
| 359 | fi |
| 360 | fi |
| 361 | fi |
| 362 | if [ "$IS_I686" = "YES" ]; then |
| 363 | SKIP_NEXT="YES" |
| 364 | fi |
| 365 | } |
| 366 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 367 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 368 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 369 | MAX_IN_LEN=$(get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN") |
| 370 | MAX_OUT_LEN=$(get_config_value_or_default "MBEDTLS_SSL_OUT_CONTENT_LEN") |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 371 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 372 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 373 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 374 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 375 | fi |
| 376 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 377 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 378 | fi |
| 379 | |
| 380 | # skip the next test if the SSL output buffer is less than 16KB |
| 381 | requires_full_size_output_buffer() { |
| 382 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 383 | SKIP_NEXT="YES" |
| 384 | fi |
| 385 | } |
| 386 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 387 | # skip the next test if valgrind is in use |
| 388 | not_with_valgrind() { |
| 389 | if [ "$MEMCHECK" -gt 0 ]; then |
| 390 | SKIP_NEXT="YES" |
| 391 | fi |
| 392 | } |
| 393 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 394 | # skip the next test if valgrind is NOT in use |
| 395 | only_with_valgrind() { |
| 396 | if [ "$MEMCHECK" -eq 0 ]; then |
| 397 | SKIP_NEXT="YES" |
| 398 | fi |
| 399 | } |
| 400 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 401 | # 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] | 402 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 403 | CLI_DELAY_FACTOR=$1 |
| 404 | } |
| 405 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 406 | # wait for the given seconds after the client finished in the next test |
| 407 | server_needs_more_time() { |
| 408 | SRV_DELAY_SECONDS=$1 |
| 409 | } |
| 410 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 411 | # print_name <name> |
| 412 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 413 | TESTS=$(( $TESTS + 1 )) |
| 414 | LINE="" |
| 415 | |
| 416 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 417 | LINE="$TESTS " |
| 418 | fi |
| 419 | |
| 420 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 421 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 422 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 423 | for i in `seq 1 $LEN`; do printf '.'; done |
| 424 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 425 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 426 | } |
| 427 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 428 | # record_outcome <outcome> [<failure-reason>] |
| 429 | # The test name must be in $NAME. |
| 430 | record_outcome() { |
| 431 | echo "$1" |
| 432 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 433 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 434 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 435 | "ssl-opt" "$NAME" \ |
| 436 | "$1" "${2-}" \ |
| 437 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 438 | fi |
| 439 | } |
| 440 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 441 | # fail <message> |
| 442 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 443 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 444 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 445 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 446 | mv $SRV_OUT o-srv-${TESTS}.log |
| 447 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 448 | if [ -n "$PXY_CMD" ]; then |
| 449 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 450 | fi |
| 451 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 452 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 453 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 454 | echo " ! server output:" |
| 455 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 456 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 457 | echo " ! client output:" |
| 458 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 459 | if [ -n "$PXY_CMD" ]; then |
| 460 | echo " ! ========================================================" |
| 461 | echo " ! proxy output:" |
| 462 | cat o-pxy-${TESTS}.log |
| 463 | fi |
| 464 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 465 | fi |
| 466 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 467 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 468 | } |
| 469 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 470 | # is_polar <cmd_line> |
| 471 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 472 | case "$1" in |
| 473 | *ssl_client2*) true;; |
| 474 | *ssl_server2*) true;; |
| 475 | *) false;; |
| 476 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 477 | } |
| 478 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 479 | # openssl s_server doesn't have -www with DTLS |
| 480 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 481 | case "$SRV_CMD" in |
| 482 | *s_server*-dtls*) |
| 483 | NEEDS_INPUT=1 |
| 484 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 485 | *) NEEDS_INPUT=0;; |
| 486 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 487 | } |
| 488 | |
| 489 | # provide input to commands that need it |
| 490 | provide_input() { |
| 491 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 492 | return |
| 493 | fi |
| 494 | |
| 495 | while true; do |
| 496 | echo "HTTP/1.0 200 OK" |
| 497 | sleep 1 |
| 498 | done |
| 499 | } |
| 500 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 501 | # has_mem_err <log_file_name> |
| 502 | has_mem_err() { |
| 503 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 504 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 505 | then |
| 506 | return 1 # false: does not have errors |
| 507 | else |
| 508 | return 0 # true: has errors |
| 509 | fi |
| 510 | } |
| 511 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 512 | # 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] | 513 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 514 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 515 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 516 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 517 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 518 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 519 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 520 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 521 | # Make a tight loop, server normally takes less than 1s to start. |
| 522 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 523 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 524 | echo "$3 START TIMEOUT" |
| 525 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 526 | break |
| 527 | fi |
| 528 | # Linux and *BSD support decimal arguments to sleep. On other |
| 529 | # OSes this may be a tight loop. |
| 530 | sleep 0.1 2>/dev/null || true |
| 531 | done |
| 532 | } |
| 533 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 534 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 535 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 536 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 537 | } |
| 538 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 539 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 540 | # Wait for server process $2 to be listening on port $1. |
| 541 | wait_server_start() { |
| 542 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 543 | } |
| 544 | |
| 545 | # Wait for proxy process $2 to be listening on port $1. |
| 546 | wait_proxy_start() { |
| 547 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 548 | } |
| 549 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 550 | # 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] | 551 | # 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] | 552 | # acceptable bounds |
| 553 | check_server_hello_time() { |
| 554 | # 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] | 555 | 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] | 556 | # Get the Unix timestamp for now |
| 557 | CUR_TIME=$(date +'%s') |
| 558 | THRESHOLD_IN_SECS=300 |
| 559 | |
| 560 | # Check if the ServerHello time was printed |
| 561 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 562 | return 1 |
| 563 | fi |
| 564 | |
| 565 | # Check the time in ServerHello is within acceptable bounds |
| 566 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 567 | # The time in ServerHello is at least 5 minutes before now |
| 568 | return 1 |
| 569 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 570 | # 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] | 571 | return 1 |
| 572 | else |
| 573 | return 0 |
| 574 | fi |
| 575 | } |
| 576 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 577 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 578 | handshake_memory_get() { |
| 579 | OUTPUT_VARIABLE="$1" |
| 580 | OUTPUT_FILE="$2" |
| 581 | |
| 582 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 583 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 584 | |
| 585 | # Check if memory usage was read |
| 586 | if [ -z "$MEM_USAGE" ]; then |
| 587 | echo "Error: Can not read the value of handshake memory usage" |
| 588 | return 1 |
| 589 | else |
| 590 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 591 | return 0 |
| 592 | fi |
| 593 | } |
| 594 | |
| 595 | # Get handshake memory usage from server or client output and check if this value |
| 596 | # is not higher than the maximum given by the first argument |
| 597 | handshake_memory_check() { |
| 598 | MAX_MEMORY="$1" |
| 599 | OUTPUT_FILE="$2" |
| 600 | |
| 601 | # Get memory usage |
| 602 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 603 | return 1 |
| 604 | fi |
| 605 | |
| 606 | # Check if memory usage is below max value |
| 607 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 608 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 609 | "but should be below $MAX_MEMORY bytes" |
| 610 | return 1 |
| 611 | else |
| 612 | return 0 |
| 613 | fi |
| 614 | } |
| 615 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 616 | # wait for client to terminate and set CLI_EXIT |
| 617 | # must be called right after starting the client |
| 618 | wait_client_done() { |
| 619 | CLI_PID=$! |
| 620 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 621 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 622 | CLI_DELAY_FACTOR=1 |
| 623 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 624 | ( 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] | 625 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 626 | |
| 627 | wait $CLI_PID |
| 628 | CLI_EXIT=$? |
| 629 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 630 | kill $DOG_PID >/dev/null 2>&1 |
| 631 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 632 | |
| 633 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 634 | |
| 635 | sleep $SRV_DELAY_SECONDS |
| 636 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 637 | } |
| 638 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 639 | # check if the given command uses dtls and sets global variable DTLS |
| 640 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 641 | case "$1" in |
| 642 | *dtls=1*|-dtls|-u) DTLS=1;; |
| 643 | *) DTLS=0;; |
| 644 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 645 | } |
| 646 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 647 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 648 | is_gnutls() { |
| 649 | case "$1" in |
| 650 | *gnutls-cli*) |
| 651 | CMD_IS_GNUTLS=1 |
| 652 | ;; |
| 653 | *gnutls-serv*) |
| 654 | CMD_IS_GNUTLS=1 |
| 655 | ;; |
| 656 | *) |
| 657 | CMD_IS_GNUTLS=0 |
| 658 | ;; |
| 659 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 660 | } |
| 661 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 662 | # Compare file content |
| 663 | # Usage: find_in_both pattern file1 file2 |
| 664 | # extract from file1 the first line matching the pattern |
| 665 | # check in file2 that the same line can be found |
| 666 | find_in_both() { |
| 667 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 668 | if [ -z "$srv_pattern" ]; then |
| 669 | return 1; |
| 670 | fi |
| 671 | |
| 672 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 673 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 674 | else |
| 675 | return 1; |
| 676 | fi |
| 677 | } |
| 678 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 679 | # 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] | 680 | # Options: -s pattern pattern that must be present in server output |
| 681 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 682 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 683 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 684 | # -S pattern pattern that must be absent in server output |
| 685 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 686 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 687 | # -F call shell function on server output |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 688 | # -g call shell function on server and client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 689 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 690 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 691 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 692 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 693 | if is_excluded "$NAME"; then |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 694 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 695 | # 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] | 696 | return |
| 697 | fi |
| 698 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 699 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 700 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 701 | # Do we only run numbered tests? |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 702 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 703 | case ",$RUN_TEST_NUMBER," in |
| 704 | *",$TESTS,"*) :;; |
| 705 | *) SKIP_NEXT="YES";; |
| 706 | esac |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 707 | fi |
| 708 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 709 | # does this test use a proxy? |
| 710 | if [ "X$1" = "X-p" ]; then |
| 711 | PXY_CMD="$2" |
| 712 | shift 2 |
| 713 | else |
| 714 | PXY_CMD="" |
| 715 | fi |
| 716 | |
| 717 | # get commands and client output |
| 718 | SRV_CMD="$1" |
| 719 | CLI_CMD="$2" |
| 720 | CLI_EXPECT="$3" |
| 721 | shift 3 |
| 722 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 723 | # Check if test uses files |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 724 | case "$SRV_CMD $CLI_CMD" in |
| 725 | *data_files/*) |
| 726 | requires_config_enabled MBEDTLS_FS_IO;; |
| 727 | esac |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 728 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 729 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 730 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 731 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 732 | |
| 733 | # should we skip? |
| 734 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 735 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 736 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 737 | SKIPS=$(( $SKIPS + 1 )) |
| 738 | return |
| 739 | fi |
| 740 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 741 | # update DTLS variable |
| 742 | detect_dtls "$SRV_CMD" |
| 743 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 744 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 745 | # 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] | 746 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 747 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 748 | case " $SRV_CMD " in |
| 749 | *' server_addr=::1 '*) |
| 750 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 751 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 752 | fi |
| 753 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 754 | # update CMD_IS_GNUTLS variable |
| 755 | is_gnutls "$SRV_CMD" |
| 756 | |
| 757 | # if the server uses gnutls but doesn't set priority, explicitly |
| 758 | # set the default priority |
| 759 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 760 | case "$SRV_CMD" in |
| 761 | *--priority*) :;; |
| 762 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 763 | esac |
| 764 | fi |
| 765 | |
| 766 | # update CMD_IS_GNUTLS variable |
| 767 | is_gnutls "$CLI_CMD" |
| 768 | |
| 769 | # if the client uses gnutls but doesn't set priority, explicitly |
| 770 | # set the default priority |
| 771 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 772 | case "$CLI_CMD" in |
| 773 | *--priority*) :;; |
| 774 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 775 | esac |
| 776 | fi |
| 777 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 778 | # fix client port |
| 779 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 780 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 781 | else |
| 782 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 783 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 784 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 785 | # prepend valgrind to our commands if active |
| 786 | if [ "$MEMCHECK" -gt 0 ]; then |
| 787 | if is_polar "$SRV_CMD"; then |
| 788 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 789 | fi |
| 790 | if is_polar "$CLI_CMD"; then |
| 791 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 792 | fi |
| 793 | fi |
| 794 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 795 | TIMES_LEFT=2 |
| 796 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 797 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 798 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 799 | # run the commands |
| 800 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 801 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 802 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 803 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 804 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 805 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 806 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 807 | check_osrv_dtls |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 808 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 809 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 810 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 811 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 812 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 813 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 814 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 815 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 816 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 817 | sleep 0.05 |
| 818 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 819 | # terminate the server (and the proxy) |
| 820 | kill $SRV_PID |
| 821 | wait $SRV_PID |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 822 | SRV_RET=$? |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 823 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 824 | if [ -n "$PXY_CMD" ]; then |
| 825 | kill $PXY_PID >/dev/null 2>&1 |
| 826 | wait $PXY_PID |
| 827 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 828 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 829 | # retry only on timeouts |
| 830 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 831 | printf "RETRY " |
| 832 | else |
| 833 | TIMES_LEFT=0 |
| 834 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 835 | done |
| 836 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 837 | # 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] | 838 | # (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] | 839 | # expected client exit to incorrectly succeed in case of catastrophic |
| 840 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 841 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 842 | 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] | 843 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 844 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 845 | return |
| 846 | fi |
| 847 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 848 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 849 | 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] | 850 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 851 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 852 | return |
| 853 | fi |
| 854 | fi |
| 855 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 856 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 857 | # exit with status 0 when interrupted by a signal, and we don't really |
| 858 | # care anyway), in case e.g. the server reports a memory leak. |
| 859 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 860 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 861 | return |
| 862 | fi |
| 863 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 864 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 865 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 866 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 867 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 868 | 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] | 869 | return |
| 870 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 871 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 872 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 873 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 874 | # 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] | 875 | while [ $# -gt 0 ] |
| 876 | do |
| 877 | case $1 in |
| 878 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 879 | 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] | 880 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 881 | return |
| 882 | fi |
| 883 | ;; |
| 884 | |
| 885 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 886 | 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] | 887 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 888 | return |
| 889 | fi |
| 890 | ;; |
| 891 | |
| 892 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 893 | 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] | 894 | 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] | 895 | return |
| 896 | fi |
| 897 | ;; |
| 898 | |
| 899 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 900 | 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] | 901 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 902 | return |
| 903 | fi |
| 904 | ;; |
| 905 | |
| 906 | # The filtering in the following two options (-u and -U) do the following |
| 907 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 908 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 909 | # - keep one of each non-unique line |
| 910 | # - count how many lines remain |
| 911 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 912 | # if there were no duplicates. |
| 913 | "-U") |
| 914 | 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 |
| 915 | fail "lines following pattern '$2' must be unique in Server output" |
| 916 | return |
| 917 | fi |
| 918 | ;; |
| 919 | |
| 920 | "-u") |
| 921 | 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 |
| 922 | 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] | 923 | return |
| 924 | fi |
| 925 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 926 | "-F") |
| 927 | if ! $2 "$SRV_OUT"; then |
| 928 | fail "function call to '$2' failed on Server output" |
| 929 | return |
| 930 | fi |
| 931 | ;; |
| 932 | "-f") |
| 933 | if ! $2 "$CLI_OUT"; then |
| 934 | fail "function call to '$2' failed on Client output" |
| 935 | return |
| 936 | fi |
| 937 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 938 | "-g") |
| 939 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 940 | fail "function call to '$2' failed on Server and Client output" |
| 941 | return |
| 942 | fi |
| 943 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 944 | |
| 945 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 946 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 947 | exit 1 |
| 948 | esac |
| 949 | shift 2 |
| 950 | done |
| 951 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 952 | # check valgrind's results |
| 953 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 954 | 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] | 955 | fail "Server has memory errors" |
| 956 | return |
| 957 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 958 | 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] | 959 | fail "Client has memory errors" |
| 960 | return |
| 961 | fi |
| 962 | fi |
| 963 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 964 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 965 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 966 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 967 | mv $SRV_OUT o-srv-${TESTS}.log |
| 968 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 969 | if [ -n "$PXY_CMD" ]; then |
| 970 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 971 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 972 | fi |
| 973 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 974 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 975 | } |
| 976 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 977 | run_test_psa() { |
| 978 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 979 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 980 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 981 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 982 | 0 \ |
| 983 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 984 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 985 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 986 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 987 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 988 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 989 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 990 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 991 | -C "Failed to setup PSA-based cipher context"\ |
| 992 | -S "Failed to setup PSA-based cipher context"\ |
| 993 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 994 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 995 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 996 | -S "error" \ |
| 997 | -C "error" |
| 998 | } |
| 999 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1000 | run_test_psa_force_curve() { |
| 1001 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1002 | run_test "PSA - ECDH with $1" \ |
Gilles Peskine | 12b5b38 | 2021-06-02 10:00:42 +0200 | [diff] [blame] | 1003 | "$P_SRV debug_level=4 force_version=tls1_2 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1004 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1005 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1006 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1007 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1008 | -c "PSA calc verify" \ |
| 1009 | -c "calc PSA finished" \ |
| 1010 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1011 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1012 | -s "PSA calc verify" \ |
| 1013 | -s "calc PSA finished" \ |
| 1014 | -C "Failed to setup PSA-based cipher context"\ |
| 1015 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1016 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1017 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1018 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1019 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1020 | -C "error" |
| 1021 | } |
| 1022 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1023 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1024 | # a maximum fragment length. |
| 1025 | # first argument ($1) is MFL for SSL client |
| 1026 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1027 | run_test_memory_after_hanshake_with_mfl() |
| 1028 | { |
| 1029 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1030 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1031 | |
| 1032 | # Leave some margin for robustness |
| 1033 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1034 | |
| 1035 | run_test "Handshake memory usage (MFL $1)" \ |
| 1036 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1037 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1038 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1039 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1040 | 0 \ |
| 1041 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1042 | } |
| 1043 | |
| 1044 | |
| 1045 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1046 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1047 | run_tests_memory_after_hanshake() |
| 1048 | { |
| 1049 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1050 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1051 | |
| 1052 | # first test with default MFU is to get reference memory usage |
| 1053 | MEMORY_USAGE_MFL_16K=0 |
| 1054 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1055 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1056 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1057 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1058 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1059 | 0 \ |
| 1060 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1061 | |
| 1062 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1063 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1064 | |
| 1065 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1066 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1067 | |
| 1068 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1069 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1070 | |
| 1071 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1072 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1073 | } |
| 1074 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1075 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1076 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1077 | rm -f context_srv.txt |
| 1078 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1079 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1080 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1081 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1082 | 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] | 1083 | exit 1 |
| 1084 | } |
| 1085 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1086 | # |
| 1087 | # MAIN |
| 1088 | # |
| 1089 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1090 | get_options "$@" |
| 1091 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1092 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1093 | # patterns rather than regular expressions, use a case statement instead |
| 1094 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1095 | # detects simple cases: plain substring, everything, nothing. |
| 1096 | # |
| 1097 | # As an exception, the character '.' is treated as an ordinary character |
| 1098 | # if it is the only special character in the string. This is because it's |
| 1099 | # rare to need "any one character", but needing a literal '.' is common |
| 1100 | # (e.g. '-f "DTLS 1.2"'). |
| 1101 | need_grep= |
| 1102 | case "$FILTER" in |
| 1103 | '^$') simple_filter=;; |
| 1104 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1105 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1106 | need_grep=1;; |
| 1107 | *) # No regexp or shell-pattern special character |
| 1108 | simple_filter="*$FILTER*";; |
| 1109 | esac |
| 1110 | case "$EXCLUDE" in |
| 1111 | '^$') simple_exclude=;; |
| 1112 | '.*') simple_exclude='*';; |
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_exclude="*$EXCLUDE*";; |
| 1117 | esac |
| 1118 | if [ -n "$need_grep" ]; then |
| 1119 | is_excluded () { |
| 1120 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1121 | } |
| 1122 | else |
| 1123 | is_excluded () { |
| 1124 | case "$1" in |
| 1125 | $simple_exclude) true;; |
| 1126 | $simple_filter) false;; |
| 1127 | *) true;; |
| 1128 | esac |
| 1129 | } |
| 1130 | fi |
| 1131 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1132 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1133 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1134 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1135 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1136 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1137 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1138 | exit 1 |
| 1139 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1140 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1141 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1142 | exit 1 |
| 1143 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1144 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1145 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1146 | exit 1 |
| 1147 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1148 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1149 | if which valgrind >/dev/null 2>&1; then :; else |
| 1150 | echo "Memcheck not possible. Valgrind not found" |
| 1151 | exit 1 |
| 1152 | fi |
| 1153 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1154 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1155 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1156 | exit 1 |
| 1157 | fi |
| 1158 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1159 | # used by watchdog |
| 1160 | MAIN_PID="$$" |
| 1161 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1162 | # We use somewhat arbitrary delays for tests: |
| 1163 | # - how long do we wait for the server to start (when lsof not available)? |
| 1164 | # - how long do we allow for the client to finish? |
| 1165 | # (not to check performance, just to avoid waiting indefinitely) |
| 1166 | # Things are slower with valgrind, so give extra time here. |
| 1167 | # |
| 1168 | # Note: without lsof, there is a trade-off between the running time of this |
| 1169 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1170 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1171 | # 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] | 1172 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1173 | START_DELAY=6 |
| 1174 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1175 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1176 | START_DELAY=2 |
| 1177 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1178 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1179 | |
| 1180 | # some particular tests need more time: |
| 1181 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1182 | # - for the server, we sleep for a number of seconds after the client exits |
| 1183 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1184 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1185 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1186 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1187 | # 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] | 1188 | # +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] | 1189 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1190 | 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] | 1191 | 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] | 1192 | O_SRV="$O_SRV -accept $SRV_PORT" |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 1193 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1194 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1195 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1196 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1197 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1198 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1199 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1200 | fi |
| 1201 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1202 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1203 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1204 | fi |
| 1205 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1206 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1207 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1208 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1209 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1210 | # Allow SHA-1, because many of our test certificates use it |
| 1211 | P_SRV="$P_SRV allow_sha1=1" |
| 1212 | P_CLI="$P_CLI allow_sha1=1" |
| 1213 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1214 | # Also pick a unique name for intermediate files |
| 1215 | SRV_OUT="srv_out.$$" |
| 1216 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1217 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1218 | SESSION="session.$$" |
| 1219 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1220 | SKIP_NEXT="NO" |
| 1221 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1222 | trap cleanup INT TERM HUP |
| 1223 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1224 | # Basic test |
| 1225 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1226 | # Checks that: |
| 1227 | # - 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] | 1228 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1229 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1230 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1231 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1232 | "$P_CLI" \ |
| 1233 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1234 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1235 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1236 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1237 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1238 | -S "error" \ |
| 1239 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1240 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1241 | run_test "Default, DTLS" \ |
| 1242 | "$P_SRV dtls=1" \ |
| 1243 | "$P_CLI dtls=1" \ |
| 1244 | 0 \ |
| 1245 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1246 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1247 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1248 | run_test "TLS client auth: required" \ |
| 1249 | "$P_SRV auth_mode=required" \ |
| 1250 | "$P_CLI" \ |
| 1251 | 0 \ |
| 1252 | -s "Verifying peer X.509 certificate... ok" |
| 1253 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1254 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1255 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1256 | requires_config_enabled MBEDTLS_SHA256_C |
| 1257 | run_test "TLS: password protected client key" \ |
| 1258 | "$P_SRV auth_mode=required" \ |
| 1259 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1260 | 0 |
| 1261 | |
| 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 server key" \ |
| 1266 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1267 | "$P_CLI" \ |
| 1268 | 0 |
| 1269 | |
| 1270 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1271 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1272 | requires_config_enabled MBEDTLS_RSA_C |
| 1273 | requires_config_enabled MBEDTLS_SHA256_C |
| 1274 | run_test "TLS: password protected server key, two certificates" \ |
| 1275 | "$P_SRV \ |
| 1276 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1277 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1278 | "$P_CLI" \ |
| 1279 | 0 |
| 1280 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1281 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1282 | run_test "CA callback on client" \ |
| 1283 | "$P_SRV debug_level=3" \ |
| 1284 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1285 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1286 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1287 | -S "error" \ |
| 1288 | -C "error" |
| 1289 | |
| 1290 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1291 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1292 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1293 | requires_config_enabled MBEDTLS_SHA256_C |
| 1294 | run_test "CA callback on server" \ |
| 1295 | "$P_SRV auth_mode=required" \ |
| 1296 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1297 | key_file=data_files/server5.key" \ |
| 1298 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1299 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1300 | -s "Verifying peer X.509 certificate... ok" \ |
| 1301 | -S "error" \ |
| 1302 | -C "error" |
| 1303 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1304 | # Test using an opaque private key for client authentication |
| 1305 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1306 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1307 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1308 | requires_config_enabled MBEDTLS_SHA256_C |
| 1309 | run_test "Opaque key for client authentication" \ |
| 1310 | "$P_SRV auth_mode=required" \ |
| 1311 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1312 | key_file=data_files/server5.key" \ |
| 1313 | 0 \ |
| 1314 | -c "key type: Opaque" \ |
| 1315 | -s "Verifying peer X.509 certificate... ok" \ |
| 1316 | -S "error" \ |
| 1317 | -C "error" |
| 1318 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1319 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1320 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1321 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1322 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1323 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1324 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1325 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1326 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1327 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1328 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1329 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1330 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1331 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1332 | run_test_psa_force_curve "secp521r1" |
| 1333 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1334 | run_test_psa_force_curve "brainpoolP512r1" |
| 1335 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1336 | run_test_psa_force_curve "secp384r1" |
| 1337 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1338 | run_test_psa_force_curve "brainpoolP384r1" |
| 1339 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1340 | run_test_psa_force_curve "secp256r1" |
| 1341 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1342 | run_test_psa_force_curve "secp256k1" |
| 1343 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1344 | run_test_psa_force_curve "brainpoolP256r1" |
| 1345 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1346 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1347 | ## SECP224K1 is buggy via the PSA API |
| 1348 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1349 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1350 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1351 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1352 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1353 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1354 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1355 | run_test_psa_force_curve "secp192r1" |
| 1356 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1357 | run_test_psa_force_curve "secp192k1" |
| 1358 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1359 | # Test current time in ServerHello |
| 1360 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1361 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1362 | "$P_SRV debug_level=3" \ |
| 1363 | "$P_CLI debug_level=3" \ |
| 1364 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1365 | -f "check_server_hello_time" \ |
| 1366 | -F "check_server_hello_time" |
| 1367 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1368 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1369 | run_test "Unique IV in GCM" \ |
| 1370 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1371 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1372 | 0 \ |
| 1373 | -u "IV used" \ |
| 1374 | -U "IV used" |
| 1375 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1376 | # Tests for certificate verification callback |
| 1377 | run_test "Configuration-specific CRT verification callback" \ |
| 1378 | "$P_SRV debug_level=3" \ |
| 1379 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1380 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1381 | -S "error" \ |
| 1382 | -c "Verify requested for " \ |
| 1383 | -c "Use configuration-specific verification callback" \ |
| 1384 | -C "Use context-specific verification callback" \ |
| 1385 | -C "error" |
| 1386 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1387 | run_test "Context-specific CRT verification callback" \ |
| 1388 | "$P_SRV debug_level=3" \ |
| 1389 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1390 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1391 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1392 | -c "Verify requested for " \ |
| 1393 | -c "Use context-specific verification callback" \ |
| 1394 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1395 | -C "error" |
| 1396 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1397 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1398 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1399 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1400 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1401 | 1 \ |
| 1402 | -c "The certificate is signed with an unacceptable hash" |
| 1403 | |
| 1404 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1405 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1406 | "$P_CLI allow_sha1=1" \ |
| 1407 | 0 |
| 1408 | |
| 1409 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1410 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1411 | "$P_CLI allow_sha1=0" \ |
| 1412 | 0 |
| 1413 | |
| 1414 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1415 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1416 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1417 | 1 \ |
| 1418 | -s "The certificate is signed with an unacceptable hash" |
| 1419 | |
| 1420 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1421 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1422 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1423 | 0 |
| 1424 | |
| 1425 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1426 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1427 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1428 | 0 |
| 1429 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1430 | # Tests for datagram packing |
| 1431 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1432 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1433 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1434 | 0 \ |
| 1435 | -c "next record in same datagram" \ |
| 1436 | -s "next record in same datagram" |
| 1437 | |
| 1438 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1439 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1440 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1441 | 0 \ |
| 1442 | -s "next record in same datagram" \ |
| 1443 | -C "next record in same datagram" |
| 1444 | |
| 1445 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1446 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1447 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1448 | 0 \ |
| 1449 | -S "next record in same datagram" \ |
| 1450 | -c "next record in same datagram" |
| 1451 | |
| 1452 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1453 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1454 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1455 | 0 \ |
| 1456 | -S "next record in same datagram" \ |
| 1457 | -C "next record in same datagram" |
| 1458 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1459 | # Tests for Context serialization |
| 1460 | |
| 1461 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1462 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1463 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1464 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1465 | 0 \ |
| 1466 | -c "Deserializing connection..." \ |
| 1467 | -S "Deserializing connection..." |
| 1468 | |
| 1469 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1470 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1471 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1472 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 1479 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1480 | "$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] | 1481 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1482 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1483 | -S "Deserializing connection..." |
| 1484 | |
| 1485 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1486 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1487 | run_test "Context serialization, client serializes, with CID" \ |
| 1488 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1489 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1490 | 0 \ |
| 1491 | -c "Deserializing connection..." \ |
| 1492 | -S "Deserializing connection..." |
| 1493 | |
| 1494 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1495 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1496 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1497 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1498 | 0 \ |
| 1499 | -C "Deserializing connection..." \ |
| 1500 | -s "Deserializing connection..." |
| 1501 | |
| 1502 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1503 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1504 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1505 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 1512 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1513 | "$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] | 1514 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1515 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1516 | -s "Deserializing connection..." |
| 1517 | |
| 1518 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1519 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1520 | run_test "Context serialization, server serializes, with CID" \ |
| 1521 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1522 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1523 | 0 \ |
| 1524 | -C "Deserializing connection..." \ |
| 1525 | -s "Deserializing connection..." |
| 1526 | |
| 1527 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1528 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1529 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1530 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1531 | 0 \ |
| 1532 | -c "Deserializing connection..." \ |
| 1533 | -s "Deserializing connection..." |
| 1534 | |
| 1535 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1536 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1537 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1538 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 1545 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1546 | "$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] | 1547 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1548 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1549 | -s "Deserializing connection..." |
| 1550 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1551 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1552 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1553 | run_test "Context serialization, both serialize, with CID" \ |
| 1554 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1555 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1556 | 0 \ |
| 1557 | -c "Deserializing connection..." \ |
| 1558 | -s "Deserializing connection..." |
| 1559 | |
| 1560 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1561 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1562 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1563 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1564 | 0 \ |
| 1565 | -c "Deserializing connection..." \ |
| 1566 | -S "Deserializing connection..." |
| 1567 | |
| 1568 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1569 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1570 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1571 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 1578 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1579 | "$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] | 1580 | 0 \ |
| 1581 | -c "Deserializing connection..." \ |
| 1582 | -S "Deserializing connection..." |
| 1583 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1584 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1585 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1586 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1587 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1588 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1589 | 0 \ |
| 1590 | -c "Deserializing connection..." \ |
| 1591 | -S "Deserializing connection..." |
| 1592 | |
| 1593 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1594 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1595 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1596 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1597 | 0 \ |
| 1598 | -C "Deserializing connection..." \ |
| 1599 | -s "Deserializing connection..." |
| 1600 | |
| 1601 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1602 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1603 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1604 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 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" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1613 | 0 \ |
| 1614 | -C "Deserializing connection..." \ |
| 1615 | -s "Deserializing connection..." |
| 1616 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1617 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1618 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1619 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1620 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1621 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1622 | 0 \ |
| 1623 | -C "Deserializing connection..." \ |
| 1624 | -s "Deserializing connection..." |
| 1625 | |
| 1626 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1627 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1628 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1629 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1630 | 0 \ |
| 1631 | -c "Deserializing connection..." \ |
| 1632 | -s "Deserializing connection..." |
| 1633 | |
| 1634 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1635 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1636 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1637 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 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, GCM" \ |
| 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" \ |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1646 | 0 \ |
| 1647 | -c "Deserializing connection..." \ |
| 1648 | -s "Deserializing connection..." |
| 1649 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1650 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1651 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1652 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1653 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1654 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1655 | 0 \ |
| 1656 | -c "Deserializing connection..." \ |
| 1657 | -s "Deserializing connection..." |
| 1658 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1659 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1660 | run_test "Saving the serialized context to a file" \ |
| 1661 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1662 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1663 | 0 \ |
| 1664 | -s "Save serialized context to a file... ok" \ |
| 1665 | -c "Save serialized context to a file... ok" |
| 1666 | rm -f context_srv.txt |
| 1667 | rm -f context_cli.txt |
| 1668 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1669 | # Tests for DTLS Connection ID extension |
| 1670 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1671 | # So far, the CID API isn't implemented, so we can't |
| 1672 | # grep for output witnessing its use. This needs to be |
| 1673 | # changed once the CID extension is implemented. |
| 1674 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1675 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1676 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1677 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1678 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1679 | 0 \ |
| 1680 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1681 | -s "found CID extension" \ |
| 1682 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1683 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1684 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1685 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1686 | -C "found CID extension" \ |
| 1687 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1688 | -C "Copy CIDs into SSL transform" \ |
| 1689 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1690 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1691 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1692 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1693 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1694 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1695 | 0 \ |
| 1696 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1697 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1698 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1699 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1700 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1701 | -C "found CID extension" \ |
| 1702 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1703 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1704 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1705 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1706 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1707 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1708 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1709 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1710 | 0 \ |
| 1711 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1712 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1713 | -c "client hello, adding CID extension" \ |
| 1714 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1715 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1716 | -s "server hello, adding CID extension" \ |
| 1717 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1718 | -c "Use of CID extension negotiated" \ |
| 1719 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1720 | -c "Copy CIDs into SSL transform" \ |
| 1721 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1722 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1723 | -s "Use of Connection ID has been negotiated" \ |
| 1724 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1725 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1726 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1727 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1728 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1729 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1730 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1731 | 0 \ |
| 1732 | -c "Enable use of CID extension." \ |
| 1733 | -s "Enable use of CID extension." \ |
| 1734 | -c "client hello, adding CID extension" \ |
| 1735 | -s "found CID extension" \ |
| 1736 | -s "Use of CID extension negotiated" \ |
| 1737 | -s "server hello, adding CID extension" \ |
| 1738 | -c "found CID extension" \ |
| 1739 | -c "Use of CID extension negotiated" \ |
| 1740 | -s "Copy CIDs into SSL transform" \ |
| 1741 | -c "Copy CIDs into SSL transform" \ |
| 1742 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1743 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1744 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1745 | -c "Use of Connection ID has been negotiated" \ |
| 1746 | -c "ignoring unexpected CID" \ |
| 1747 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1748 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1749 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1750 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1751 | -p "$P_PXY mtu=800" \ |
| 1752 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1753 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1754 | 0 \ |
| 1755 | -c "Enable use of CID extension." \ |
| 1756 | -s "Enable use of CID extension." \ |
| 1757 | -c "client hello, adding CID extension" \ |
| 1758 | -s "found CID extension" \ |
| 1759 | -s "Use of CID extension negotiated" \ |
| 1760 | -s "server hello, adding CID extension" \ |
| 1761 | -c "found CID extension" \ |
| 1762 | -c "Use of CID extension negotiated" \ |
| 1763 | -s "Copy CIDs into SSL transform" \ |
| 1764 | -c "Copy CIDs into SSL transform" \ |
| 1765 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1766 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1767 | -s "Use of Connection ID has been negotiated" \ |
| 1768 | -c "Use of Connection ID has been negotiated" |
| 1769 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1770 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1771 | 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] | 1772 | -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] | 1773 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1774 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1775 | 0 \ |
| 1776 | -c "Enable use of CID extension." \ |
| 1777 | -s "Enable use of CID extension." \ |
| 1778 | -c "client hello, adding CID extension" \ |
| 1779 | -s "found CID extension" \ |
| 1780 | -s "Use of CID extension negotiated" \ |
| 1781 | -s "server hello, adding CID extension" \ |
| 1782 | -c "found CID extension" \ |
| 1783 | -c "Use of CID extension negotiated" \ |
| 1784 | -s "Copy CIDs into SSL transform" \ |
| 1785 | -c "Copy CIDs into SSL transform" \ |
| 1786 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1787 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1788 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1789 | -c "Use of Connection ID has been negotiated" \ |
| 1790 | -c "ignoring unexpected CID" \ |
| 1791 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1792 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1793 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1794 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1795 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1796 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1797 | 0 \ |
| 1798 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1799 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1800 | -c "client hello, adding CID extension" \ |
| 1801 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1802 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1803 | -s "server hello, adding CID extension" \ |
| 1804 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1805 | -c "Use of CID extension negotiated" \ |
| 1806 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1807 | -c "Copy CIDs into SSL transform" \ |
| 1808 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1809 | -s "Peer CID (length 0 Bytes):" \ |
| 1810 | -s "Use of Connection ID has been negotiated" \ |
| 1811 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1812 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1813 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1814 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1815 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1816 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1817 | 0 \ |
| 1818 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1819 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1820 | -c "client hello, adding CID extension" \ |
| 1821 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1822 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1823 | -s "server hello, adding CID extension" \ |
| 1824 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1825 | -c "Use of CID extension negotiated" \ |
| 1826 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1827 | -c "Copy CIDs into SSL transform" \ |
| 1828 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1829 | -c "Peer CID (length 0 Bytes):" \ |
| 1830 | -s "Use of Connection ID has been negotiated" \ |
| 1831 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1832 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1833 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1834 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1835 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1836 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1837 | 0 \ |
| 1838 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1839 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1840 | -c "client hello, adding CID extension" \ |
| 1841 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1842 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1843 | -s "server hello, adding CID extension" \ |
| 1844 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1845 | -c "Use of CID extension negotiated" \ |
| 1846 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1847 | -c "Copy CIDs into SSL transform" \ |
| 1848 | -S "Use of Connection ID has been negotiated" \ |
| 1849 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1850 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1851 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1852 | 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] | 1853 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1854 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1855 | 0 \ |
| 1856 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1857 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1858 | -c "client hello, adding CID extension" \ |
| 1859 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1860 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1861 | -s "server hello, adding CID extension" \ |
| 1862 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1863 | -c "Use of CID extension negotiated" \ |
| 1864 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1865 | -c "Copy CIDs into SSL transform" \ |
| 1866 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1867 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1868 | -s "Use of Connection ID has been negotiated" \ |
| 1869 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1870 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1871 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1872 | 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] | 1873 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1874 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1875 | 0 \ |
| 1876 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1877 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1878 | -c "client hello, adding CID extension" \ |
| 1879 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1880 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1881 | -s "server hello, adding CID extension" \ |
| 1882 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1883 | -c "Use of CID extension negotiated" \ |
| 1884 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1885 | -c "Copy CIDs into SSL transform" \ |
| 1886 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1887 | -s "Peer CID (length 0 Bytes):" \ |
| 1888 | -s "Use of Connection ID has been negotiated" \ |
| 1889 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1890 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1891 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1892 | 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] | 1893 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1894 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1895 | 0 \ |
| 1896 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1897 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1898 | -c "client hello, adding CID extension" \ |
| 1899 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1900 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1901 | -s "server hello, adding CID extension" \ |
| 1902 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1903 | -c "Use of CID extension negotiated" \ |
| 1904 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1905 | -c "Copy CIDs into SSL transform" \ |
| 1906 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1907 | -c "Peer CID (length 0 Bytes):" \ |
| 1908 | -s "Use of Connection ID has been negotiated" \ |
| 1909 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1910 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1911 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1912 | 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] | 1913 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1914 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1915 | 0 \ |
| 1916 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1917 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1918 | -c "client hello, adding CID extension" \ |
| 1919 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1920 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1921 | -s "server hello, adding CID extension" \ |
| 1922 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1923 | -c "Use of CID extension negotiated" \ |
| 1924 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1925 | -c "Copy CIDs into SSL transform" \ |
| 1926 | -S "Use of Connection ID has been negotiated" \ |
| 1927 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1928 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1929 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1930 | 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] | 1931 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1932 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1933 | 0 \ |
| 1934 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1935 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1936 | -c "client hello, adding CID extension" \ |
| 1937 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1938 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1939 | -s "server hello, adding CID extension" \ |
| 1940 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1941 | -c "Use of CID extension negotiated" \ |
| 1942 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1943 | -c "Copy CIDs into SSL transform" \ |
| 1944 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1945 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1946 | -s "Use of Connection ID has been negotiated" \ |
| 1947 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1948 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1949 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1950 | 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] | 1951 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1952 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1953 | 0 \ |
| 1954 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1955 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1956 | -c "client hello, adding CID extension" \ |
| 1957 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1958 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1959 | -s "server hello, adding CID extension" \ |
| 1960 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1961 | -c "Use of CID extension negotiated" \ |
| 1962 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1963 | -c "Copy CIDs into SSL transform" \ |
| 1964 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1965 | -s "Peer CID (length 0 Bytes):" \ |
| 1966 | -s "Use of Connection ID has been negotiated" \ |
| 1967 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1968 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1969 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1970 | 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] | 1971 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1972 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1973 | 0 \ |
| 1974 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1975 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1976 | -c "client hello, adding CID extension" \ |
| 1977 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1978 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1979 | -s "server hello, adding CID extension" \ |
| 1980 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1981 | -c "Use of CID extension negotiated" \ |
| 1982 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1983 | -c "Copy CIDs into SSL transform" \ |
| 1984 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1985 | -c "Peer CID (length 0 Bytes):" \ |
| 1986 | -s "Use of Connection ID has been negotiated" \ |
| 1987 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1988 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1989 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1990 | 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] | 1991 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1992 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1993 | 0 \ |
| 1994 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1995 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1996 | -c "client hello, adding CID extension" \ |
| 1997 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1998 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1999 | -s "server hello, adding CID extension" \ |
| 2000 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2001 | -c "Use of CID extension negotiated" \ |
| 2002 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2003 | -c "Copy CIDs into SSL transform" \ |
| 2004 | -S "Use of Connection ID has been negotiated" \ |
| 2005 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2006 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2007 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2008 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2009 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2010 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2011 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2012 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2013 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2014 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2015 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2016 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2017 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2018 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2019 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2020 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2021 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2022 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2023 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2024 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2025 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2026 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2027 | 0 \ |
| 2028 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2029 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2030 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2031 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2032 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2033 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2034 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2035 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2036 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2037 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2038 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2039 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2040 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2041 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2042 | 0 \ |
| 2043 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2044 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2045 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2046 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2047 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2048 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2049 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2050 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2051 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2052 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2053 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2054 | 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] | 2055 | -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] | 2056 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2057 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2058 | 0 \ |
| 2059 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2060 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2061 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2062 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2063 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2064 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2065 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2066 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2067 | -c "ignoring unexpected CID" \ |
| 2068 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2069 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2070 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2071 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2072 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2073 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2074 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2075 | 0 \ |
| 2076 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2077 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2078 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2079 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2080 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2081 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2082 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2083 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2084 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2085 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2086 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2087 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2088 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2089 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2090 | 0 \ |
| 2091 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2092 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2093 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2094 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2095 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2096 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2097 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2098 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2099 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2100 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2101 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2102 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2103 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2104 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2105 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2106 | 0 \ |
| 2107 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2108 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2109 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2110 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2111 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2112 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2113 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2114 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2115 | -c "ignoring unexpected CID" \ |
| 2116 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2117 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2118 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2119 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2120 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2121 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2122 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2123 | 0 \ |
| 2124 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2125 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2126 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2127 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2128 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2129 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2130 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2131 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2132 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2133 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2134 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2135 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2136 | 0 \ |
| 2137 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2138 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2139 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2140 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2141 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2142 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2143 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2144 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2145 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2146 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2147 | -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] | 2148 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2149 | "$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" \ |
| 2150 | 0 \ |
| 2151 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2152 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2153 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2154 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2155 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2156 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2157 | -c "ignoring unexpected CID" \ |
| 2158 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2159 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2160 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2161 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2162 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2163 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2164 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2165 | 0 \ |
| 2166 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2167 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2168 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2169 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2170 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2171 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2172 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2173 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2174 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2175 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2176 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2177 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2178 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2179 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2180 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2181 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2182 | 0 \ |
| 2183 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2184 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2185 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2186 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2187 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2188 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2189 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2190 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2191 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2192 | -c "ignoring unexpected CID" \ |
| 2193 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2194 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2195 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2196 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2197 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2198 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2199 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2200 | 0 \ |
| 2201 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2202 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2203 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2204 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2205 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2206 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2207 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2208 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2209 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2210 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2211 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2212 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2213 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2214 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2215 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2216 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2217 | 0 \ |
| 2218 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2219 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2220 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2221 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2222 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2223 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2224 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2225 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2226 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2227 | -c "ignoring unexpected CID" \ |
| 2228 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2229 | |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2230 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2231 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2232 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2233 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2234 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2235 | 0 \ |
| 2236 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2237 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2238 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2239 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2240 | -s "Reallocating in_buf" \ |
| 2241 | -s "Reallocating out_buf" |
| 2242 | |
| 2243 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2244 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
| 2245 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2246 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2247 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2248 | 0 \ |
| 2249 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2250 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2251 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2252 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2253 | -s "Reallocating in_buf" \ |
| 2254 | -s "Reallocating out_buf" |
| 2255 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2256 | # Tests for Encrypt-then-MAC extension |
| 2257 | |
| 2258 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2259 | "$P_SRV debug_level=3 \ |
| 2260 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2261 | "$P_CLI debug_level=3" \ |
| 2262 | 0 \ |
| 2263 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2264 | -s "found encrypt then mac extension" \ |
| 2265 | -s "server hello, adding encrypt then mac extension" \ |
| 2266 | -c "found encrypt_then_mac extension" \ |
| 2267 | -c "using encrypt then mac" \ |
| 2268 | -s "using encrypt then mac" |
| 2269 | |
| 2270 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2271 | "$P_SRV debug_level=3 etm=0 \ |
| 2272 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2273 | "$P_CLI debug_level=3 etm=1" \ |
| 2274 | 0 \ |
| 2275 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2276 | -s "found encrypt then mac extension" \ |
| 2277 | -S "server hello, adding encrypt then mac extension" \ |
| 2278 | -C "found encrypt_then_mac extension" \ |
| 2279 | -C "using encrypt then mac" \ |
| 2280 | -S "using encrypt then mac" |
| 2281 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2282 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2283 | "$P_SRV debug_level=3 etm=1 \ |
| 2284 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2285 | "$P_CLI debug_level=3 etm=1" \ |
| 2286 | 0 \ |
| 2287 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2288 | -s "found encrypt then mac extension" \ |
| 2289 | -S "server hello, adding encrypt then mac extension" \ |
| 2290 | -C "found encrypt_then_mac extension" \ |
| 2291 | -C "using encrypt then mac" \ |
| 2292 | -S "using encrypt then mac" |
| 2293 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2294 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2295 | "$P_SRV debug_level=3 etm=1 \ |
| 2296 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2297 | "$P_CLI debug_level=3 etm=0" \ |
| 2298 | 0 \ |
| 2299 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2300 | -S "found encrypt then mac extension" \ |
| 2301 | -S "server hello, adding encrypt then mac extension" \ |
| 2302 | -C "found encrypt_then_mac extension" \ |
| 2303 | -C "using encrypt then mac" \ |
| 2304 | -S "using encrypt then mac" |
| 2305 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2306 | # Tests for Extended Master Secret extension |
| 2307 | |
| 2308 | run_test "Extended Master Secret: default" \ |
| 2309 | "$P_SRV debug_level=3" \ |
| 2310 | "$P_CLI debug_level=3" \ |
| 2311 | 0 \ |
| 2312 | -c "client hello, adding extended_master_secret extension" \ |
| 2313 | -s "found extended master secret extension" \ |
| 2314 | -s "server hello, adding extended master secret extension" \ |
| 2315 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2316 | -c "session hash for extended master secret" \ |
| 2317 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2318 | |
| 2319 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2320 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2321 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2322 | 0 \ |
| 2323 | -c "client hello, adding extended_master_secret extension" \ |
| 2324 | -s "found extended master secret extension" \ |
| 2325 | -S "server hello, adding extended master secret extension" \ |
| 2326 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2327 | -C "session hash for extended master secret" \ |
| 2328 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2329 | |
| 2330 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2331 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2332 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2333 | 0 \ |
| 2334 | -C "client hello, adding extended_master_secret extension" \ |
| 2335 | -S "found extended master secret extension" \ |
| 2336 | -S "server hello, adding extended master secret extension" \ |
| 2337 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2338 | -C "session hash for extended master secret" \ |
| 2339 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2340 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2341 | # Test sending and receiving empty application data records |
| 2342 | |
| 2343 | run_test "Encrypt then MAC: empty application data record" \ |
| 2344 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2345 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2346 | 0 \ |
| 2347 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2348 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2349 | -c "0 bytes written in 1 fragments" |
| 2350 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2351 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2352 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2353 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2354 | 0 \ |
| 2355 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2356 | -c "0 bytes written in 1 fragments" |
| 2357 | |
| 2358 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2359 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2360 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2361 | 0 \ |
| 2362 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2363 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2364 | -c "0 bytes written in 1 fragments" |
| 2365 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2366 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2367 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2368 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2369 | 0 \ |
| 2370 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2371 | -c "0 bytes written in 1 fragments" |
| 2372 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2373 | # Tests for CBC 1/n-1 record splitting |
| 2374 | |
| 2375 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2376 | "$P_SRV" \ |
| 2377 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2378 | request_size=123 force_version=tls1_2" \ |
| 2379 | 0 \ |
| 2380 | -s "Read from client: 123 bytes read" \ |
| 2381 | -S "Read from client: 1 bytes read" \ |
| 2382 | -S "122 bytes read" |
| 2383 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2384 | # Tests for Session Tickets |
| 2385 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2386 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2387 | "$P_SRV debug_level=3 tickets=1" \ |
| 2388 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2389 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2390 | -c "client hello, adding session ticket extension" \ |
| 2391 | -s "found session ticket extension" \ |
| 2392 | -s "server hello, adding session ticket extension" \ |
| 2393 | -c "found session_ticket extension" \ |
| 2394 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2395 | -S "session successfully restored from cache" \ |
| 2396 | -s "session successfully restored from ticket" \ |
| 2397 | -s "a session has been resumed" \ |
| 2398 | -c "a session has been resumed" |
| 2399 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2400 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2401 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2402 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2403 | 0 \ |
| 2404 | -c "client hello, adding session ticket extension" \ |
| 2405 | -s "found session ticket extension" \ |
| 2406 | -s "server hello, adding session ticket extension" \ |
| 2407 | -c "found session_ticket extension" \ |
| 2408 | -c "parse new session ticket" \ |
| 2409 | -S "session successfully restored from cache" \ |
| 2410 | -s "session successfully restored from ticket" \ |
| 2411 | -s "a session has been resumed" \ |
| 2412 | -c "a session has been resumed" |
| 2413 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2414 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2415 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2416 | "$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] | 2417 | 0 \ |
| 2418 | -c "client hello, adding session ticket extension" \ |
| 2419 | -s "found session ticket extension" \ |
| 2420 | -s "server hello, adding session ticket extension" \ |
| 2421 | -c "found session_ticket extension" \ |
| 2422 | -c "parse new session ticket" \ |
| 2423 | -S "session successfully restored from cache" \ |
| 2424 | -S "session successfully restored from ticket" \ |
| 2425 | -S "a session has been resumed" \ |
| 2426 | -C "a session has been resumed" |
| 2427 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2428 | run_test "Session resume using tickets: session copy" \ |
| 2429 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2430 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2431 | 0 \ |
| 2432 | -c "client hello, adding session ticket extension" \ |
| 2433 | -s "found session ticket extension" \ |
| 2434 | -s "server hello, adding session ticket extension" \ |
| 2435 | -c "found session_ticket extension" \ |
| 2436 | -c "parse new session ticket" \ |
| 2437 | -S "session successfully restored from cache" \ |
| 2438 | -s "session successfully restored from ticket" \ |
| 2439 | -s "a session has been resumed" \ |
| 2440 | -c "a session has been resumed" |
| 2441 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2442 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2443 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2444 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2445 | 0 \ |
| 2446 | -c "client hello, adding session ticket extension" \ |
| 2447 | -c "found session_ticket extension" \ |
| 2448 | -c "parse new session ticket" \ |
| 2449 | -c "a session has been resumed" |
| 2450 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2451 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2452 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2453 | "( $O_CLI -sess_out $SESSION; \ |
| 2454 | $O_CLI -sess_in $SESSION; \ |
| 2455 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2456 | 0 \ |
| 2457 | -s "found session ticket extension" \ |
| 2458 | -s "server hello, adding session ticket extension" \ |
| 2459 | -S "session successfully restored from cache" \ |
| 2460 | -s "session successfully restored from ticket" \ |
| 2461 | -s "a session has been resumed" |
| 2462 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2463 | # Tests for Session Tickets with DTLS |
| 2464 | |
| 2465 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2466 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2467 | "$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] | 2468 | 0 \ |
| 2469 | -c "client hello, adding session ticket extension" \ |
| 2470 | -s "found session ticket extension" \ |
| 2471 | -s "server hello, adding session ticket extension" \ |
| 2472 | -c "found session_ticket extension" \ |
| 2473 | -c "parse new session ticket" \ |
| 2474 | -S "session successfully restored from cache" \ |
| 2475 | -s "session successfully restored from ticket" \ |
| 2476 | -s "a session has been resumed" \ |
| 2477 | -c "a session has been resumed" |
| 2478 | |
| 2479 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2480 | "$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] | 2481 | "$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] | 2482 | 0 \ |
| 2483 | -c "client hello, adding session ticket extension" \ |
| 2484 | -s "found session ticket extension" \ |
| 2485 | -s "server hello, adding session ticket extension" \ |
| 2486 | -c "found session_ticket extension" \ |
| 2487 | -c "parse new session ticket" \ |
| 2488 | -S "session successfully restored from cache" \ |
| 2489 | -s "session successfully restored from ticket" \ |
| 2490 | -s "a session has been resumed" \ |
| 2491 | -c "a session has been resumed" |
| 2492 | |
| 2493 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2494 | "$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] | 2495 | "$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] | 2496 | 0 \ |
| 2497 | -c "client hello, adding session ticket extension" \ |
| 2498 | -s "found session ticket extension" \ |
| 2499 | -s "server hello, adding session ticket extension" \ |
| 2500 | -c "found session_ticket extension" \ |
| 2501 | -c "parse new session ticket" \ |
| 2502 | -S "session successfully restored from cache" \ |
| 2503 | -S "session successfully restored from ticket" \ |
| 2504 | -S "a session has been resumed" \ |
| 2505 | -C "a session has been resumed" |
| 2506 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2507 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2508 | "$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] | 2509 | "$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] | 2510 | 0 \ |
| 2511 | -c "client hello, adding session ticket extension" \ |
| 2512 | -s "found session ticket extension" \ |
| 2513 | -s "server hello, adding session ticket extension" \ |
| 2514 | -c "found session_ticket extension" \ |
| 2515 | -c "parse new session ticket" \ |
| 2516 | -S "session successfully restored from cache" \ |
| 2517 | -s "session successfully restored from ticket" \ |
| 2518 | -s "a session has been resumed" \ |
| 2519 | -c "a session has been resumed" |
| 2520 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2521 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2522 | "$O_SRV -dtls" \ |
| 2523 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2524 | 0 \ |
| 2525 | -c "client hello, adding session ticket extension" \ |
| 2526 | -c "found session_ticket extension" \ |
| 2527 | -c "parse new session ticket" \ |
| 2528 | -c "a session has been resumed" |
| 2529 | |
| 2530 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2531 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2532 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2533 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2534 | rm -f $SESSION )" \ |
| 2535 | 0 \ |
| 2536 | -s "found session ticket extension" \ |
| 2537 | -s "server hello, adding session ticket extension" \ |
| 2538 | -S "session successfully restored from cache" \ |
| 2539 | -s "session successfully restored from ticket" \ |
| 2540 | -s "a session has been resumed" |
| 2541 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2542 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2543 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2544 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2545 | "$P_SRV debug_level=3 tickets=0" \ |
| 2546 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2547 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2548 | -c "client hello, adding session ticket extension" \ |
| 2549 | -s "found session ticket extension" \ |
| 2550 | -S "server hello, adding session ticket extension" \ |
| 2551 | -C "found session_ticket extension" \ |
| 2552 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2553 | -s "session successfully restored from cache" \ |
| 2554 | -S "session successfully restored from ticket" \ |
| 2555 | -s "a session has been resumed" \ |
| 2556 | -c "a session has been resumed" |
| 2557 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2558 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2559 | "$P_SRV debug_level=3 tickets=1" \ |
| 2560 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2561 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2562 | -C "client hello, adding session ticket extension" \ |
| 2563 | -S "found session ticket extension" \ |
| 2564 | -S "server hello, adding session ticket extension" \ |
| 2565 | -C "found session_ticket extension" \ |
| 2566 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2567 | -s "session successfully restored from cache" \ |
| 2568 | -S "session successfully restored from ticket" \ |
| 2569 | -s "a session has been resumed" \ |
| 2570 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2571 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2572 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2573 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2574 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2575 | 0 \ |
| 2576 | -S "session successfully restored from cache" \ |
| 2577 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2578 | -S "a session has been resumed" \ |
| 2579 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2580 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2581 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2582 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2583 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2584 | 0 \ |
| 2585 | -s "session successfully restored from cache" \ |
| 2586 | -S "session successfully restored from ticket" \ |
| 2587 | -s "a session has been resumed" \ |
| 2588 | -c "a session has been resumed" |
| 2589 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2590 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2591 | "$P_SRV debug_level=3 tickets=0" \ |
| 2592 | "$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] | 2593 | 0 \ |
| 2594 | -s "session successfully restored from cache" \ |
| 2595 | -S "session successfully restored from ticket" \ |
| 2596 | -s "a session has been resumed" \ |
| 2597 | -c "a session has been resumed" |
| 2598 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2599 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2600 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2601 | "$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] | 2602 | 0 \ |
| 2603 | -S "session successfully restored from cache" \ |
| 2604 | -S "session successfully restored from ticket" \ |
| 2605 | -S "a session has been resumed" \ |
| 2606 | -C "a session has been resumed" |
| 2607 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2608 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2609 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2610 | "$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] | 2611 | 0 \ |
| 2612 | -s "session successfully restored from cache" \ |
| 2613 | -S "session successfully restored from ticket" \ |
| 2614 | -s "a session has been resumed" \ |
| 2615 | -c "a session has been resumed" |
| 2616 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2617 | run_test "Session resume using cache: session copy" \ |
| 2618 | "$P_SRV debug_level=3 tickets=0" \ |
| 2619 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2620 | 0 \ |
| 2621 | -s "session successfully restored from cache" \ |
| 2622 | -S "session successfully restored from ticket" \ |
| 2623 | -s "a session has been resumed" \ |
| 2624 | -c "a session has been resumed" |
| 2625 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2626 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2627 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2628 | "( $O_CLI -sess_out $SESSION; \ |
| 2629 | $O_CLI -sess_in $SESSION; \ |
| 2630 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2631 | 0 \ |
| 2632 | -s "found session ticket extension" \ |
| 2633 | -S "server hello, adding session ticket extension" \ |
| 2634 | -s "session successfully restored from cache" \ |
| 2635 | -S "session successfully restored from ticket" \ |
| 2636 | -s "a session has been resumed" |
| 2637 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2638 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2639 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2640 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2641 | 0 \ |
| 2642 | -C "found session_ticket extension" \ |
| 2643 | -C "parse new session ticket" \ |
| 2644 | -c "a session has been resumed" |
| 2645 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2646 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2647 | |
| 2648 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2649 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2650 | "$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] | 2651 | 0 \ |
| 2652 | -c "client hello, adding session ticket extension" \ |
| 2653 | -s "found session ticket extension" \ |
| 2654 | -S "server hello, adding session ticket extension" \ |
| 2655 | -C "found session_ticket extension" \ |
| 2656 | -C "parse new session ticket" \ |
| 2657 | -s "session successfully restored from cache" \ |
| 2658 | -S "session successfully restored from ticket" \ |
| 2659 | -s "a session has been resumed" \ |
| 2660 | -c "a session has been resumed" |
| 2661 | |
| 2662 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2663 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2664 | "$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] | 2665 | 0 \ |
| 2666 | -C "client hello, adding session ticket extension" \ |
| 2667 | -S "found session ticket extension" \ |
| 2668 | -S "server hello, adding session ticket extension" \ |
| 2669 | -C "found session_ticket extension" \ |
| 2670 | -C "parse new session ticket" \ |
| 2671 | -s "session successfully restored from cache" \ |
| 2672 | -S "session successfully restored from ticket" \ |
| 2673 | -s "a session has been resumed" \ |
| 2674 | -c "a session has been resumed" |
| 2675 | |
| 2676 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2677 | "$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] | 2678 | "$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] | 2679 | 0 \ |
| 2680 | -S "session successfully restored from cache" \ |
| 2681 | -S "session successfully restored from ticket" \ |
| 2682 | -S "a session has been resumed" \ |
| 2683 | -C "a session has been resumed" |
| 2684 | |
| 2685 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2686 | "$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] | 2687 | "$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] | 2688 | 0 \ |
| 2689 | -s "session successfully restored from cache" \ |
| 2690 | -S "session successfully restored from ticket" \ |
| 2691 | -s "a session has been resumed" \ |
| 2692 | -c "a session has been resumed" |
| 2693 | |
| 2694 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2695 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2696 | "$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] | 2697 | 0 \ |
| 2698 | -s "session successfully restored from cache" \ |
| 2699 | -S "session successfully restored from ticket" \ |
| 2700 | -s "a session has been resumed" \ |
| 2701 | -c "a session has been resumed" |
| 2702 | |
| 2703 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2704 | "$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] | 2705 | "$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] | 2706 | 0 \ |
| 2707 | -S "session successfully restored from cache" \ |
| 2708 | -S "session successfully restored from ticket" \ |
| 2709 | -S "a session has been resumed" \ |
| 2710 | -C "a session has been resumed" |
| 2711 | |
| 2712 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2713 | "$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] | 2714 | "$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] | 2715 | 0 \ |
| 2716 | -s "session successfully restored from cache" \ |
| 2717 | -S "session successfully restored from ticket" \ |
| 2718 | -s "a session has been resumed" \ |
| 2719 | -c "a session has been resumed" |
| 2720 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2721 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2722 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2723 | "$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] | 2724 | 0 \ |
| 2725 | -s "session successfully restored from cache" \ |
| 2726 | -S "session successfully restored from ticket" \ |
| 2727 | -s "a session has been resumed" \ |
| 2728 | -c "a session has been resumed" |
| 2729 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2730 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2731 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2732 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2733 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2734 | rm -f $SESSION )" \ |
| 2735 | 0 \ |
| 2736 | -s "found session ticket extension" \ |
| 2737 | -S "server hello, adding session ticket extension" \ |
| 2738 | -s "session successfully restored from cache" \ |
| 2739 | -S "session successfully restored from ticket" \ |
| 2740 | -s "a session has been resumed" |
| 2741 | |
| 2742 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2743 | "$O_SRV -dtls" \ |
| 2744 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2745 | 0 \ |
| 2746 | -C "found session_ticket extension" \ |
| 2747 | -C "parse new session ticket" \ |
| 2748 | -c "a session has been resumed" |
| 2749 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2750 | # Tests for Max Fragment Length extension |
| 2751 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2752 | if [ $MAX_CONTENT_LEN -ne 16384 ]; then |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2753 | echo "Using non-default maximum content length $MAX_CONTENT_LEN instead of 16384 " |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2754 | fi |
| 2755 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2756 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2757 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2758 | "$P_SRV debug_level=3" \ |
| 2759 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2760 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2761 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2762 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2763 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2764 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2765 | -C "client hello, adding max_fragment_length extension" \ |
| 2766 | -S "found max fragment length extension" \ |
| 2767 | -S "server hello, max_fragment_length extension" \ |
| 2768 | -C "found max_fragment_length extension" |
| 2769 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2770 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2771 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2772 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2773 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2774 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2775 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2776 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2777 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2778 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2779 | -C "client hello, adding max_fragment_length extension" \ |
| 2780 | -S "found max fragment length extension" \ |
| 2781 | -S "server hello, max_fragment_length extension" \ |
| 2782 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2783 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2784 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2785 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2786 | |
| 2787 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2788 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2789 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2790 | "$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] | 2791 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2792 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2793 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2794 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2795 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2796 | -C "client hello, adding max_fragment_length extension" \ |
| 2797 | -S "found max fragment length extension" \ |
| 2798 | -S "server hello, max_fragment_length extension" \ |
| 2799 | -C "found max_fragment_length extension" \ |
| 2800 | -c "fragment larger than.*maximum " |
| 2801 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2802 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2803 | # (session fragment length will be 16384 regardless of mbedtls |
| 2804 | # content length configuration.) |
| 2805 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2806 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2807 | run_test "Max fragment length: disabled, larger message" \ |
| 2808 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2809 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2810 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2811 | -C "Maximum incoming record payload length is 16384" \ |
| 2812 | -C "Maximum outgoing record payload length is 16384" \ |
| 2813 | -S "Maximum incoming record payload length is 16384" \ |
| 2814 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2815 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2816 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2817 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2818 | |
| 2819 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2820 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2821 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2822 | "$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] | 2823 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2824 | -C "Maximum incoming record payload length is 16384" \ |
| 2825 | -C "Maximum outgoing record payload length is 16384" \ |
| 2826 | -S "Maximum incoming record payload length is 16384" \ |
| 2827 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2828 | -c "fragment larger than.*maximum " |
| 2829 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2830 | # Make sure it was compiled with lengths over 4096 |
| 2831 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 4096 |
| 2832 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2833 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2834 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2835 | "$P_SRV debug_level=3" \ |
| 2836 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2837 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2838 | -c "Maximum incoming record payload length is 4096" \ |
| 2839 | -c "Maximum outgoing record payload length is 4096" \ |
| 2840 | -s "Maximum incoming record payload length is 4096" \ |
| 2841 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2842 | -c "client hello, adding max_fragment_length extension" \ |
| 2843 | -s "found max fragment length extension" \ |
| 2844 | -s "server hello, max_fragment_length extension" \ |
| 2845 | -c "found max_fragment_length extension" |
| 2846 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2847 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 1024 |
| 2848 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2849 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2850 | run_test "Max fragment length: client 512, server 1024" \ |
| 2851 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 2852 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2853 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2854 | -c "Maximum incoming record payload length is 512" \ |
| 2855 | -c "Maximum outgoing record payload length is 512" \ |
| 2856 | -s "Maximum incoming record payload length is 512" \ |
| 2857 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2858 | -c "client hello, adding max_fragment_length extension" \ |
| 2859 | -s "found max fragment length extension" \ |
| 2860 | -s "server hello, max_fragment_length extension" \ |
| 2861 | -c "found max_fragment_length extension" |
| 2862 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2863 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 2048 |
| 2864 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2865 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2866 | run_test "Max fragment length: client 512, server 2048" \ |
| 2867 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 2868 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2869 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2870 | -c "Maximum incoming record payload length is 512" \ |
| 2871 | -c "Maximum outgoing record payload length is 512" \ |
| 2872 | -s "Maximum incoming record payload length is 512" \ |
| 2873 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2874 | -c "client hello, adding max_fragment_length extension" \ |
| 2875 | -s "found max fragment length extension" \ |
| 2876 | -s "server hello, max_fragment_length extension" \ |
| 2877 | -c "found max_fragment_length extension" |
| 2878 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2879 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 4096 |
| 2880 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2881 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2882 | run_test "Max fragment length: client 512, server 4096" \ |
| 2883 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2884 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2885 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2886 | -c "Maximum incoming record payload length is 512" \ |
| 2887 | -c "Maximum outgoing record payload length is 512" \ |
| 2888 | -s "Maximum incoming record payload length is 512" \ |
| 2889 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2890 | -c "client hello, adding max_fragment_length extension" \ |
| 2891 | -s "found max fragment length extension" \ |
| 2892 | -s "server hello, max_fragment_length extension" \ |
| 2893 | -c "found max_fragment_length extension" |
| 2894 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2895 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 1024 |
| 2896 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2897 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2898 | run_test "Max fragment length: client 1024, server 512" \ |
| 2899 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 2900 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2901 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2902 | -c "Maximum incoming record payload length is 1024" \ |
| 2903 | -c "Maximum outgoing record payload length is 1024" \ |
| 2904 | -s "Maximum incoming record payload length is 1024" \ |
| 2905 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2906 | -c "client hello, adding max_fragment_length extension" \ |
| 2907 | -s "found max fragment length extension" \ |
| 2908 | -s "server hello, max_fragment_length extension" \ |
| 2909 | -c "found max_fragment_length extension" |
| 2910 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2911 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 2048 |
| 2912 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2913 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2914 | run_test "Max fragment length: client 1024, server 2048" \ |
| 2915 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 2916 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2917 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2918 | -c "Maximum incoming record payload length is 1024" \ |
| 2919 | -c "Maximum outgoing record payload length is 1024" \ |
| 2920 | -s "Maximum incoming record payload length is 1024" \ |
| 2921 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2922 | -c "client hello, adding max_fragment_length extension" \ |
| 2923 | -s "found max fragment length extension" \ |
| 2924 | -s "server hello, max_fragment_length extension" \ |
| 2925 | -c "found max_fragment_length extension" |
| 2926 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2927 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 4096 |
| 2928 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2929 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2930 | run_test "Max fragment length: client 1024, server 4096" \ |
| 2931 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2932 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2933 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2934 | -c "Maximum incoming record payload length is 1024" \ |
| 2935 | -c "Maximum outgoing record payload length is 1024" \ |
| 2936 | -s "Maximum incoming record payload length is 1024" \ |
| 2937 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2938 | -c "client hello, adding max_fragment_length extension" \ |
| 2939 | -s "found max fragment length extension" \ |
| 2940 | -s "server hello, max_fragment_length extension" \ |
| 2941 | -c "found max_fragment_length extension" |
| 2942 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2943 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 2048 |
| 2944 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2945 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2946 | run_test "Max fragment length: client 2048, server 512" \ |
| 2947 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 2948 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 2949 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2950 | -c "Maximum incoming record payload length is 2048" \ |
| 2951 | -c "Maximum outgoing record payload length is 2048" \ |
| 2952 | -s "Maximum incoming record payload length is 2048" \ |
| 2953 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2954 | -c "client hello, adding max_fragment_length extension" \ |
| 2955 | -s "found max fragment length extension" \ |
| 2956 | -s "server hello, max_fragment_length extension" \ |
| 2957 | -c "found max_fragment_length extension" |
| 2958 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2959 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 2048 |
| 2960 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2961 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2962 | run_test "Max fragment length: client 2048, server 1024" \ |
| 2963 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 2964 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 2965 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2966 | -c "Maximum incoming record payload length is 2048" \ |
| 2967 | -c "Maximum outgoing record payload length is 2048" \ |
| 2968 | -s "Maximum incoming record payload length is 2048" \ |
| 2969 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2970 | -c "client hello, adding max_fragment_length extension" \ |
| 2971 | -s "found max fragment length extension" \ |
| 2972 | -s "server hello, max_fragment_length extension" \ |
| 2973 | -c "found max_fragment_length extension" |
| 2974 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2975 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 4096 |
| 2976 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2977 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2978 | run_test "Max fragment length: client 2048, server 4096" \ |
| 2979 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2980 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 2981 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2982 | -c "Maximum incoming record payload length is 2048" \ |
| 2983 | -c "Maximum outgoing record payload length is 2048" \ |
| 2984 | -s "Maximum incoming record payload length is 2048" \ |
| 2985 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2986 | -c "client hello, adding max_fragment_length extension" \ |
| 2987 | -s "found max fragment length extension" \ |
| 2988 | -s "server hello, max_fragment_length extension" \ |
| 2989 | -c "found max_fragment_length extension" |
| 2990 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2991 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 4096 |
| 2992 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2993 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2994 | run_test "Max fragment length: client 4096, server 512" \ |
| 2995 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 2996 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 2997 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2998 | -c "Maximum incoming record payload length is 4096" \ |
| 2999 | -c "Maximum outgoing record payload length is 4096" \ |
| 3000 | -s "Maximum incoming record payload length is 4096" \ |
| 3001 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3002 | -c "client hello, adding max_fragment_length extension" \ |
| 3003 | -s "found max fragment length extension" \ |
| 3004 | -s "server hello, max_fragment_length extension" \ |
| 3005 | -c "found max_fragment_length extension" |
| 3006 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3007 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 4096 |
| 3008 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3009 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3010 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3011 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3012 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3013 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3014 | -c "Maximum incoming record payload length is 4096" \ |
| 3015 | -c "Maximum outgoing record payload length is 4096" \ |
| 3016 | -s "Maximum incoming record payload length is 4096" \ |
| 3017 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3018 | -c "client hello, adding max_fragment_length extension" \ |
| 3019 | -s "found max fragment length extension" \ |
| 3020 | -s "server hello, max_fragment_length extension" \ |
| 3021 | -c "found max_fragment_length extension" |
| 3022 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3023 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 4096 |
| 3024 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3025 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3026 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3027 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3028 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3029 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3030 | -c "Maximum incoming record payload length is 4096" \ |
| 3031 | -c "Maximum outgoing record payload length is 4096" \ |
| 3032 | -s "Maximum incoming record payload length is 4096" \ |
| 3033 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3034 | -c "client hello, adding max_fragment_length extension" \ |
| 3035 | -s "found max fragment length extension" \ |
| 3036 | -s "server hello, max_fragment_length extension" \ |
| 3037 | -c "found max_fragment_length extension" |
| 3038 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3039 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 4096 |
| 3040 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3041 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3042 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3043 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3044 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3045 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3046 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3047 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3048 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3049 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3050 | -C "client hello, adding max_fragment_length extension" \ |
| 3051 | -S "found max fragment length extension" \ |
| 3052 | -S "server hello, max_fragment_length extension" \ |
| 3053 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3054 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3055 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 4096 |
| 3056 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3057 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3058 | requires_gnutls |
| 3059 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3060 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3061 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3062 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3063 | -c "Maximum incoming record payload length is 4096" \ |
| 3064 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3065 | -c "client hello, adding max_fragment_length extension" \ |
| 3066 | -c "found max_fragment_length extension" |
| 3067 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3068 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 2048 |
| 3069 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3070 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3071 | run_test "Max fragment length: client, message just fits" \ |
| 3072 | "$P_SRV debug_level=3" \ |
| 3073 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3074 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3075 | -c "Maximum incoming record payload length is 2048" \ |
| 3076 | -c "Maximum outgoing record payload length is 2048" \ |
| 3077 | -s "Maximum incoming record payload length is 2048" \ |
| 3078 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3079 | -c "client hello, adding max_fragment_length extension" \ |
| 3080 | -s "found max fragment length extension" \ |
| 3081 | -s "server hello, max_fragment_length extension" \ |
| 3082 | -c "found max_fragment_length extension" \ |
| 3083 | -c "2048 bytes written in 1 fragments" \ |
| 3084 | -s "2048 bytes read" |
| 3085 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3086 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 2048 |
| 3087 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 2048 |
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 | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3089 | run_test "Max fragment length: client, larger message" \ |
| 3090 | "$P_SRV debug_level=3" \ |
| 3091 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3092 | 0 \ |
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 "2345 bytes written in 2 fragments" \ |
| 3102 | -s "2048 bytes read" \ |
| 3103 | -s "297 bytes read" |
| 3104 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3105 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" 2048 |
| 3106 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3107 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3108 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3109 | "$P_SRV debug_level=3 dtls=1" \ |
| 3110 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3111 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3112 | -c "Maximum incoming record payload length is 2048" \ |
| 3113 | -c "Maximum outgoing record payload length is 2048" \ |
| 3114 | -s "Maximum incoming record payload length is 2048" \ |
| 3115 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3116 | -c "client hello, adding max_fragment_length extension" \ |
| 3117 | -s "found max fragment length extension" \ |
| 3118 | -s "server hello, max_fragment_length extension" \ |
| 3119 | -c "found max_fragment_length extension" \ |
| 3120 | -c "fragment larger than.*maximum" |
| 3121 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3122 | # Tests for renegotiation |
| 3123 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3124 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3125 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3126 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3127 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3128 | 0 \ |
| 3129 | -C "client hello, adding renegotiation extension" \ |
| 3130 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3131 | -S "found renegotiation extension" \ |
| 3132 | -s "server hello, secure renegotiation extension" \ |
| 3133 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3134 | -C "=> renegotiate" \ |
| 3135 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3136 | -S "write hello request" |
| 3137 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3138 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3139 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3140 | "$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] | 3141 | "$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] | 3142 | 0 \ |
| 3143 | -c "client hello, adding renegotiation extension" \ |
| 3144 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3145 | -s "found renegotiation extension" \ |
| 3146 | -s "server hello, secure renegotiation extension" \ |
| 3147 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3148 | -c "=> renegotiate" \ |
| 3149 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3150 | -S "write hello request" |
| 3151 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3152 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3153 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3154 | "$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] | 3155 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3156 | 0 \ |
| 3157 | -c "client hello, adding renegotiation extension" \ |
| 3158 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3159 | -s "found renegotiation extension" \ |
| 3160 | -s "server hello, secure renegotiation extension" \ |
| 3161 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3162 | -c "=> renegotiate" \ |
| 3163 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3164 | -s "write hello request" |
| 3165 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3166 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3167 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 3168 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3169 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3170 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3171 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3172 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3173 | 0 \ |
| 3174 | -c "client hello, adding renegotiation extension" \ |
| 3175 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3176 | -s "found renegotiation extension" \ |
| 3177 | -s "server hello, secure renegotiation extension" \ |
| 3178 | -c "found renegotiation extension" \ |
| 3179 | -c "=> renegotiate" \ |
| 3180 | -s "=> renegotiate" \ |
| 3181 | -S "write hello request" \ |
| 3182 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3183 | |
| 3184 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3185 | # the server did not parse the Signature Algorithm extension. This test is valid only if an MD |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 3186 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3187 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3188 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3189 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3190 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3191 | 0 \ |
| 3192 | -c "client hello, adding renegotiation extension" \ |
| 3193 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3194 | -s "found renegotiation extension" \ |
| 3195 | -s "server hello, secure renegotiation extension" \ |
| 3196 | -c "found renegotiation extension" \ |
| 3197 | -c "=> renegotiate" \ |
| 3198 | -s "=> renegotiate" \ |
| 3199 | -s "write hello request" \ |
| 3200 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3201 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3202 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3203 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3204 | "$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] | 3205 | "$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] | 3206 | 0 \ |
| 3207 | -c "client hello, adding renegotiation extension" \ |
| 3208 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3209 | -s "found renegotiation extension" \ |
| 3210 | -s "server hello, secure renegotiation extension" \ |
| 3211 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3212 | -c "=> renegotiate" \ |
| 3213 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3214 | -s "write hello request" |
| 3215 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3216 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3217 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3218 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3219 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3220 | "$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" \ |
| 3221 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3222 | -c "Maximum incoming record payload length is 2048" \ |
| 3223 | -c "Maximum outgoing record payload length is 2048" \ |
| 3224 | -s "Maximum incoming record payload length is 2048" \ |
| 3225 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3226 | -c "client hello, adding max_fragment_length extension" \ |
| 3227 | -s "found max fragment length extension" \ |
| 3228 | -s "server hello, max_fragment_length extension" \ |
| 3229 | -c "found max_fragment_length extension" \ |
| 3230 | -c "client hello, adding renegotiation extension" \ |
| 3231 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3232 | -s "found renegotiation extension" \ |
| 3233 | -s "server hello, secure renegotiation extension" \ |
| 3234 | -c "found renegotiation extension" \ |
| 3235 | -c "=> renegotiate" \ |
| 3236 | -s "=> renegotiate" \ |
| 3237 | -s "write hello request" |
| 3238 | |
| 3239 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3240 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3241 | "$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] | 3242 | "$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] | 3243 | 1 \ |
| 3244 | -c "client hello, adding renegotiation extension" \ |
| 3245 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3246 | -S "found renegotiation extension" \ |
| 3247 | -s "server hello, secure renegotiation extension" \ |
| 3248 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3249 | -c "=> renegotiate" \ |
| 3250 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3251 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3252 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3253 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3254 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3255 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3256 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3257 | "$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] | 3258 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3259 | 0 \ |
| 3260 | -C "client hello, adding renegotiation extension" \ |
| 3261 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3262 | -S "found renegotiation extension" \ |
| 3263 | -s "server hello, secure renegotiation extension" \ |
| 3264 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3265 | -C "=> renegotiate" \ |
| 3266 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3267 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3268 | -S "SSL - An unexpected message was received from our peer" \ |
| 3269 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3270 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3271 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3272 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3273 | "$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] | 3274 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3275 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3276 | 0 \ |
| 3277 | -C "client hello, adding renegotiation extension" \ |
| 3278 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3279 | -S "found renegotiation extension" \ |
| 3280 | -s "server hello, secure renegotiation extension" \ |
| 3281 | -c "found renegotiation extension" \ |
| 3282 | -C "=> renegotiate" \ |
| 3283 | -S "=> renegotiate" \ |
| 3284 | -s "write hello request" \ |
| 3285 | -S "SSL - An unexpected message was received from our peer" \ |
| 3286 | -S "failed" |
| 3287 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3288 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3289 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3290 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3291 | "$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] | 3292 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3293 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3294 | 0 \ |
| 3295 | -C "client hello, adding renegotiation extension" \ |
| 3296 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3297 | -S "found renegotiation extension" \ |
| 3298 | -s "server hello, secure renegotiation extension" \ |
| 3299 | -c "found renegotiation extension" \ |
| 3300 | -C "=> renegotiate" \ |
| 3301 | -S "=> renegotiate" \ |
| 3302 | -s "write hello request" \ |
| 3303 | -S "SSL - An unexpected message was received from our peer" \ |
| 3304 | -S "failed" |
| 3305 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3306 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3307 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3308 | "$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] | 3309 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3310 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3311 | 0 \ |
| 3312 | -C "client hello, adding renegotiation extension" \ |
| 3313 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3314 | -S "found renegotiation extension" \ |
| 3315 | -s "server hello, secure renegotiation extension" \ |
| 3316 | -c "found renegotiation extension" \ |
| 3317 | -C "=> renegotiate" \ |
| 3318 | -S "=> renegotiate" \ |
| 3319 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3320 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3321 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3322 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3323 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3324 | "$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] | 3325 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3326 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3327 | 0 \ |
| 3328 | -c "client hello, adding renegotiation extension" \ |
| 3329 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3330 | -s "found renegotiation extension" \ |
| 3331 | -s "server hello, secure renegotiation extension" \ |
| 3332 | -c "found renegotiation extension" \ |
| 3333 | -c "=> renegotiate" \ |
| 3334 | -s "=> renegotiate" \ |
| 3335 | -s "write hello request" \ |
| 3336 | -S "SSL - An unexpected message was received from our peer" \ |
| 3337 | -S "failed" |
| 3338 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3339 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3340 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3341 | "$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] | 3342 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3343 | 0 \ |
| 3344 | -C "client hello, adding renegotiation extension" \ |
| 3345 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3346 | -S "found renegotiation extension" \ |
| 3347 | -s "server hello, secure renegotiation extension" \ |
| 3348 | -c "found renegotiation extension" \ |
| 3349 | -S "record counter limit reached: renegotiate" \ |
| 3350 | -C "=> renegotiate" \ |
| 3351 | -S "=> renegotiate" \ |
| 3352 | -S "write hello request" \ |
| 3353 | -S "SSL - An unexpected message was received from our peer" \ |
| 3354 | -S "failed" |
| 3355 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3356 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3357 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3358 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3359 | "$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] | 3360 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3361 | 0 \ |
| 3362 | -c "client hello, adding renegotiation extension" \ |
| 3363 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3364 | -s "found renegotiation extension" \ |
| 3365 | -s "server hello, secure renegotiation extension" \ |
| 3366 | -c "found renegotiation extension" \ |
| 3367 | -s "record counter limit reached: renegotiate" \ |
| 3368 | -c "=> renegotiate" \ |
| 3369 | -s "=> renegotiate" \ |
| 3370 | -s "write hello request" \ |
| 3371 | -S "SSL - An unexpected message was received from our peer" \ |
| 3372 | -S "failed" |
| 3373 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3374 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3375 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3376 | "$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] | 3377 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3378 | 0 \ |
| 3379 | -c "client hello, adding renegotiation extension" \ |
| 3380 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3381 | -s "found renegotiation extension" \ |
| 3382 | -s "server hello, secure renegotiation extension" \ |
| 3383 | -c "found renegotiation extension" \ |
| 3384 | -s "record counter limit reached: renegotiate" \ |
| 3385 | -c "=> renegotiate" \ |
| 3386 | -s "=> renegotiate" \ |
| 3387 | -s "write hello request" \ |
| 3388 | -S "SSL - An unexpected message was received from our peer" \ |
| 3389 | -S "failed" |
| 3390 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3391 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3392 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3393 | "$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] | 3394 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3395 | 0 \ |
| 3396 | -C "client hello, adding renegotiation extension" \ |
| 3397 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3398 | -S "found renegotiation extension" \ |
| 3399 | -s "server hello, secure renegotiation extension" \ |
| 3400 | -c "found renegotiation extension" \ |
| 3401 | -S "record counter limit reached: renegotiate" \ |
| 3402 | -C "=> renegotiate" \ |
| 3403 | -S "=> renegotiate" \ |
| 3404 | -S "write hello request" \ |
| 3405 | -S "SSL - An unexpected message was received from our peer" \ |
| 3406 | -S "failed" |
| 3407 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3408 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3409 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3410 | "$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] | 3411 | "$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] | 3412 | 0 \ |
| 3413 | -c "client hello, adding renegotiation extension" \ |
| 3414 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3415 | -s "found renegotiation extension" \ |
| 3416 | -s "server hello, secure renegotiation extension" \ |
| 3417 | -c "found renegotiation extension" \ |
| 3418 | -c "=> renegotiate" \ |
| 3419 | -s "=> renegotiate" \ |
| 3420 | -S "write hello request" |
| 3421 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3422 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3423 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3424 | "$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] | 3425 | "$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] | 3426 | 0 \ |
| 3427 | -c "client hello, adding renegotiation extension" \ |
| 3428 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3429 | -s "found renegotiation extension" \ |
| 3430 | -s "server hello, secure renegotiation extension" \ |
| 3431 | -c "found renegotiation extension" \ |
| 3432 | -c "=> renegotiate" \ |
| 3433 | -s "=> renegotiate" \ |
| 3434 | -s "write hello request" |
| 3435 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3436 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3437 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3438 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3439 | "$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] | 3440 | 0 \ |
| 3441 | -c "client hello, adding renegotiation extension" \ |
| 3442 | -c "found renegotiation extension" \ |
| 3443 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3444 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3445 | -C "error" \ |
| 3446 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3447 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3448 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3449 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3450 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3451 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3452 | "$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] | 3453 | 0 \ |
| 3454 | -c "client hello, adding renegotiation extension" \ |
| 3455 | -c "found renegotiation extension" \ |
| 3456 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3457 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3458 | -C "error" \ |
| 3459 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3460 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3461 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3462 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3463 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3464 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3465 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3466 | 1 \ |
| 3467 | -c "client hello, adding renegotiation extension" \ |
| 3468 | -C "found renegotiation extension" \ |
| 3469 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3470 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3471 | -c "error" \ |
| 3472 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3473 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3474 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3475 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3476 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3477 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3478 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3479 | allow_legacy=0" \ |
| 3480 | 1 \ |
| 3481 | -c "client hello, adding renegotiation extension" \ |
| 3482 | -C "found renegotiation extension" \ |
| 3483 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3484 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3485 | -c "error" \ |
| 3486 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3487 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3488 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3489 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3490 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3491 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3492 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3493 | allow_legacy=1" \ |
| 3494 | 0 \ |
| 3495 | -c "client hello, adding renegotiation extension" \ |
| 3496 | -C "found renegotiation extension" \ |
| 3497 | -c "=> renegotiate" \ |
| 3498 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3499 | -C "error" \ |
| 3500 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3501 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3502 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3503 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3504 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3505 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3506 | 0 \ |
| 3507 | -c "client hello, adding renegotiation extension" \ |
| 3508 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3509 | -s "found renegotiation extension" \ |
| 3510 | -s "server hello, secure renegotiation extension" \ |
| 3511 | -c "found renegotiation extension" \ |
| 3512 | -c "=> renegotiate" \ |
| 3513 | -s "=> renegotiate" \ |
| 3514 | -S "write hello request" |
| 3515 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3516 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3517 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3518 | "$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] | 3519 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3520 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3521 | 0 \ |
| 3522 | -c "client hello, adding renegotiation extension" \ |
| 3523 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3524 | -s "found renegotiation extension" \ |
| 3525 | -s "server hello, secure renegotiation extension" \ |
| 3526 | -c "found renegotiation extension" \ |
| 3527 | -c "=> renegotiate" \ |
| 3528 | -s "=> renegotiate" \ |
| 3529 | -s "write hello request" |
| 3530 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3531 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3532 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3533 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3534 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3535 | 0 \ |
| 3536 | -c "client hello, adding renegotiation extension" \ |
| 3537 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3538 | -s "found renegotiation extension" \ |
| 3539 | -s "server hello, secure renegotiation extension" \ |
| 3540 | -s "record counter limit reached: renegotiate" \ |
| 3541 | -c "=> renegotiate" \ |
| 3542 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3543 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3544 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3545 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3546 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3547 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3548 | "$G_SRV -u --mtu 4096" \ |
| 3549 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3550 | 0 \ |
| 3551 | -c "client hello, adding renegotiation extension" \ |
| 3552 | -c "found renegotiation extension" \ |
| 3553 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3554 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3555 | -C "error" \ |
| 3556 | -s "Extra-header:" |
| 3557 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3558 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3559 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3560 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3561 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3562 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3563 | "$P_CLI debug_level=3" \ |
| 3564 | 0 \ |
| 3565 | -c "found renegotiation extension" \ |
| 3566 | -C "error" \ |
| 3567 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3568 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3569 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3570 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3571 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3572 | "$P_CLI debug_level=3" \ |
| 3573 | 0 \ |
| 3574 | -C "found renegotiation extension" \ |
| 3575 | -C "error" \ |
| 3576 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3577 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3578 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3579 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3580 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3581 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3582 | 1 \ |
| 3583 | -C "found renegotiation extension" \ |
| 3584 | -c "error" \ |
| 3585 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3586 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3587 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3588 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3589 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3590 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3591 | 0 \ |
| 3592 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3593 | -s "server hello, secure renegotiation extension" |
| 3594 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3595 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3596 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3597 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3598 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3599 | 0 \ |
| 3600 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3601 | -S "server hello, secure renegotiation extension" |
| 3602 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3603 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3604 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3605 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3606 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3607 | 1 \ |
| 3608 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3609 | -S "server hello, secure renegotiation extension" |
| 3610 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3611 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3612 | |
| 3613 | requires_gnutls |
| 3614 | run_test "DER format: no trailing bytes" \ |
| 3615 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3616 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3617 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3618 | 0 \ |
| 3619 | -c "Handshake was completed" \ |
| 3620 | |
| 3621 | requires_gnutls |
| 3622 | run_test "DER format: with a trailing zero byte" \ |
| 3623 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3624 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3625 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3626 | 0 \ |
| 3627 | -c "Handshake was completed" \ |
| 3628 | |
| 3629 | requires_gnutls |
| 3630 | run_test "DER format: with a trailing random byte" \ |
| 3631 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3632 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3633 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3634 | 0 \ |
| 3635 | -c "Handshake was completed" \ |
| 3636 | |
| 3637 | requires_gnutls |
| 3638 | run_test "DER format: with 2 trailing random bytes" \ |
| 3639 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3640 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3641 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3642 | 0 \ |
| 3643 | -c "Handshake was completed" \ |
| 3644 | |
| 3645 | requires_gnutls |
| 3646 | run_test "DER format: with 4 trailing random bytes" \ |
| 3647 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3648 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3649 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3650 | 0 \ |
| 3651 | -c "Handshake was completed" \ |
| 3652 | |
| 3653 | requires_gnutls |
| 3654 | run_test "DER format: with 8 trailing random bytes" \ |
| 3655 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3656 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3657 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3658 | 0 \ |
| 3659 | -c "Handshake was completed" \ |
| 3660 | |
| 3661 | requires_gnutls |
| 3662 | run_test "DER format: with 9 trailing random bytes" \ |
| 3663 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3664 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3665 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3666 | 0 \ |
| 3667 | -c "Handshake was completed" \ |
| 3668 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3669 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3670 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3671 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3672 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3673 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3674 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3675 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3676 | 1 \ |
| 3677 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3678 | -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] | 3679 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3680 | -c "X509 - Certificate verification failed" |
| 3681 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3682 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3683 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3684 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3685 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3686 | 0 \ |
| 3687 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3688 | -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] | 3689 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3690 | -C "X509 - Certificate verification failed" |
| 3691 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3692 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3693 | "$P_SRV" \ |
| 3694 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3695 | 0 \ |
| 3696 | -c "x509_verify_cert() returned" \ |
| 3697 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3698 | -c "! Certificate verification flags"\ |
| 3699 | -C "! mbedtls_ssl_handshake returned" \ |
| 3700 | -C "X509 - Certificate verification failed" \ |
| 3701 | -C "SSL - No CA Chain is set, but required to operate" |
| 3702 | |
| 3703 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3704 | "$P_SRV" \ |
| 3705 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3706 | 1 \ |
| 3707 | -c "x509_verify_cert() returned" \ |
| 3708 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3709 | -c "! Certificate verification flags"\ |
| 3710 | -c "! mbedtls_ssl_handshake returned" \ |
| 3711 | -c "SSL - No CA Chain is set, but required to operate" |
| 3712 | |
| 3713 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3714 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3715 | # the client informs the server about the supported curves - it does, though, in the |
| 3716 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3717 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3718 | # different means to have the server ignoring the client's supported curve list. |
| 3719 | |
| 3720 | requires_config_enabled MBEDTLS_ECP_C |
| 3721 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3722 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3723 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3724 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3725 | 1 \ |
| 3726 | -c "bad certificate (EC key curve)"\ |
| 3727 | -c "! Certificate verification flags"\ |
| 3728 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3729 | |
| 3730 | requires_config_enabled MBEDTLS_ECP_C |
| 3731 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3732 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3733 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3734 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3735 | 1 \ |
| 3736 | -c "bad certificate (EC key curve)"\ |
| 3737 | -c "! Certificate verification flags"\ |
| 3738 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3739 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3740 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3741 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3742 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3743 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3744 | 0 \ |
| 3745 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3746 | -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] | 3747 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3748 | -C "X509 - Certificate verification failed" |
| 3749 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3750 | run_test "Authentication: client SHA256, server required" \ |
| 3751 | "$P_SRV auth_mode=required" \ |
| 3752 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3753 | key_file=data_files/server6.key \ |
| 3754 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3755 | 0 \ |
| 3756 | -c "Supported Signature Algorithm found: 4," \ |
| 3757 | -c "Supported Signature Algorithm found: 5," |
| 3758 | |
| 3759 | run_test "Authentication: client SHA384, server required" \ |
| 3760 | "$P_SRV auth_mode=required" \ |
| 3761 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3762 | key_file=data_files/server6.key \ |
| 3763 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3764 | 0 \ |
| 3765 | -c "Supported Signature Algorithm found: 4," \ |
| 3766 | -c "Supported Signature Algorithm found: 5," |
| 3767 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3768 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3769 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3770 | "$P_CLI debug_level=3 crt_file=none \ |
| 3771 | key_file=data_files/server5.key" \ |
| 3772 | 1 \ |
| 3773 | -S "skip write certificate request" \ |
| 3774 | -C "skip parse certificate request" \ |
| 3775 | -c "got a certificate request" \ |
| 3776 | -c "= write certificate$" \ |
| 3777 | -C "skip write certificate$" \ |
| 3778 | -S "x509_verify_cert() returned" \ |
| 3779 | -s "client has no certificate" \ |
| 3780 | -s "! mbedtls_ssl_handshake returned" \ |
| 3781 | -c "! mbedtls_ssl_handshake returned" \ |
| 3782 | -s "No client certification received from the client, but required by the authentication mode" |
| 3783 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3784 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3785 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3786 | "$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] | 3787 | key_file=data_files/server5.key" \ |
| 3788 | 1 \ |
| 3789 | -S "skip write certificate request" \ |
| 3790 | -C "skip parse certificate request" \ |
| 3791 | -c "got a certificate request" \ |
| 3792 | -C "skip write certificate" \ |
| 3793 | -C "skip write certificate verify" \ |
| 3794 | -S "skip parse certificate verify" \ |
| 3795 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3796 | -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] | 3797 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3798 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3799 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3800 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3801 | # We don't check that the client receives the alert because it might |
| 3802 | # detect that its write end of the connection is closed and abort |
| 3803 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3804 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3805 | run_test "Authentication: client cert not trusted, server required" \ |
| 3806 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3807 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3808 | key_file=data_files/server5.key" \ |
| 3809 | 1 \ |
| 3810 | -S "skip write certificate request" \ |
| 3811 | -C "skip parse certificate request" \ |
| 3812 | -c "got a certificate request" \ |
| 3813 | -C "skip write certificate" \ |
| 3814 | -C "skip write certificate verify" \ |
| 3815 | -S "skip parse certificate verify" \ |
| 3816 | -s "x509_verify_cert() returned" \ |
| 3817 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3818 | -s "! mbedtls_ssl_handshake returned" \ |
| 3819 | -c "! mbedtls_ssl_handshake returned" \ |
| 3820 | -s "X509 - Certificate verification failed" |
| 3821 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3822 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3823 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3824 | "$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] | 3825 | key_file=data_files/server5.key" \ |
| 3826 | 0 \ |
| 3827 | -S "skip write certificate request" \ |
| 3828 | -C "skip parse certificate request" \ |
| 3829 | -c "got a certificate request" \ |
| 3830 | -C "skip write certificate" \ |
| 3831 | -C "skip write certificate verify" \ |
| 3832 | -S "skip parse certificate verify" \ |
| 3833 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3834 | -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] | 3835 | -S "! mbedtls_ssl_handshake returned" \ |
| 3836 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3837 | -S "X509 - Certificate verification failed" |
| 3838 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3839 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3840 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3841 | "$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] | 3842 | key_file=data_files/server5.key" \ |
| 3843 | 0 \ |
| 3844 | -s "skip write certificate request" \ |
| 3845 | -C "skip parse certificate request" \ |
| 3846 | -c "got no certificate request" \ |
| 3847 | -c "skip write certificate" \ |
| 3848 | -c "skip write certificate verify" \ |
| 3849 | -s "skip parse certificate verify" \ |
| 3850 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3851 | -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] | 3852 | -S "! mbedtls_ssl_handshake returned" \ |
| 3853 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3854 | -S "X509 - Certificate verification failed" |
| 3855 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3856 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3857 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3858 | "$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] | 3859 | 0 \ |
| 3860 | -S "skip write certificate request" \ |
| 3861 | -C "skip parse certificate request" \ |
| 3862 | -c "got a certificate request" \ |
| 3863 | -C "skip write certificate$" \ |
| 3864 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3865 | -c "skip write certificate verify" \ |
| 3866 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3867 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3868 | -S "! mbedtls_ssl_handshake returned" \ |
| 3869 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3870 | -S "X509 - Certificate verification failed" |
| 3871 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3872 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3873 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3874 | "$O_CLI" \ |
| 3875 | 0 \ |
| 3876 | -S "skip write certificate request" \ |
| 3877 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3878 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3879 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3880 | -S "X509 - Certificate verification failed" |
| 3881 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3882 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3883 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3884 | "$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] | 3885 | 0 \ |
| 3886 | -C "skip parse certificate request" \ |
| 3887 | -c "got a certificate request" \ |
| 3888 | -C "skip write certificate$" \ |
| 3889 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3890 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3891 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3892 | run_test "Authentication: client no cert, openssl server required" \ |
| 3893 | "$O_SRV -Verify 10" \ |
| 3894 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3895 | 1 \ |
| 3896 | -C "skip parse certificate request" \ |
| 3897 | -c "got a certificate request" \ |
| 3898 | -C "skip write certificate$" \ |
| 3899 | -c "skip write certificate verify" \ |
| 3900 | -c "! mbedtls_ssl_handshake returned" |
| 3901 | |
Yuto Takano | e43556b | 2021-06-21 20:07:12 +0100 | [diff] [blame] | 3902 | # config.h contains a value for MBEDTLS_X509_MAX_INTERMEDIATE_CA that is |
| 3903 | # different from the script's assumed default value (below). |
| 3904 | # Relevant tests are skipped if they do not match. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3905 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3906 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3907 | |
Yuto Takano | e43556b | 2021-06-21 20:07:12 +0100 | [diff] [blame] | 3908 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 3909 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3910 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3911 | run_test "Authentication: server max_int chain, client default" \ |
| 3912 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 3913 | key_file=data_files/dir-maxpath/09.key" \ |
| 3914 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3915 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3916 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3917 | |
Yuto Takano | 73e7dcb | 2021-06-22 06:08:11 +0100 | [diff] [blame^] | 3918 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 3919 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3920 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3921 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3922 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3923 | key_file=data_files/dir-maxpath/10.key" \ |
| 3924 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3925 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3926 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3927 | |
Yuto Takano | 73e7dcb | 2021-06-22 06:08:11 +0100 | [diff] [blame^] | 3928 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 3929 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3930 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3931 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 3932 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3933 | key_file=data_files/dir-maxpath/10.key" \ |
| 3934 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3935 | auth_mode=optional" \ |
| 3936 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3937 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3938 | |
Yuto Takano | 73e7dcb | 2021-06-22 06:08:11 +0100 | [diff] [blame^] | 3939 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 3940 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3941 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3942 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 3943 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3944 | key_file=data_files/dir-maxpath/10.key" \ |
| 3945 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3946 | auth_mode=none" \ |
| 3947 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3948 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3949 | |
Yuto Takano | 73e7dcb | 2021-06-22 06:08:11 +0100 | [diff] [blame^] | 3950 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 3951 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3952 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3953 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 3954 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 3955 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3956 | key_file=data_files/dir-maxpath/10.key" \ |
| 3957 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3958 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3959 | |
Yuto Takano | 73e7dcb | 2021-06-22 06:08:11 +0100 | [diff] [blame^] | 3960 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 3961 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3962 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3963 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 3964 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3965 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3966 | key_file=data_files/dir-maxpath/10.key" \ |
| 3967 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3968 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3969 | |
Yuto Takano | 73e7dcb | 2021-06-22 06:08:11 +0100 | [diff] [blame^] | 3970 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 3971 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3972 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3973 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 3974 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3975 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3976 | key_file=data_files/dir-maxpath/10.key" \ |
| 3977 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3978 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3979 | |
Yuto Takano | e43556b | 2021-06-21 20:07:12 +0100 | [diff] [blame] | 3980 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 3981 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3982 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3983 | run_test "Authentication: client max_int chain, server required" \ |
| 3984 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3985 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3986 | key_file=data_files/dir-maxpath/09.key" \ |
| 3987 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3988 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3989 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3990 | # Tests for CA list in CertificateRequest messages |
| 3991 | |
| 3992 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3993 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3994 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3995 | key_file=data_files/server6.key" \ |
| 3996 | 0 \ |
| 3997 | -s "requested DN" |
| 3998 | |
| 3999 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4000 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4001 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4002 | key_file=data_files/server6.key" \ |
| 4003 | 0 \ |
| 4004 | -S "requested DN" |
| 4005 | |
| 4006 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4007 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4008 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4009 | key_file=data_files/server5.key" \ |
| 4010 | 1 \ |
| 4011 | -S "requested DN" \ |
| 4012 | -s "x509_verify_cert() returned" \ |
| 4013 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4014 | -s "! mbedtls_ssl_handshake returned" \ |
| 4015 | -c "! mbedtls_ssl_handshake returned" \ |
| 4016 | -s "X509 - Certificate verification failed" |
| 4017 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4018 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4019 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4020 | |
| 4021 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4022 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4023 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4024 | key_file=data_files/server5.key" \ |
| 4025 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4026 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4027 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4028 | -c "x509_verify_cert() returned" \ |
| 4029 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4030 | -c "! mbedtls_ssl_handshake returned" \ |
| 4031 | -c "X509 - Certificate verification failed" |
| 4032 | |
| 4033 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4034 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4035 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4036 | key_file=data_files/server5.key" \ |
| 4037 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4038 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4039 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4040 | -c "x509_verify_cert() returned" \ |
| 4041 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4042 | -C "! mbedtls_ssl_handshake returned" \ |
| 4043 | -C "X509 - Certificate verification failed" |
| 4044 | |
| 4045 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4046 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4047 | # the client informs the server about the supported curves - it does, though, in the |
| 4048 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4049 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4050 | # different means to have the server ignoring the client's supported curve list. |
| 4051 | |
| 4052 | requires_config_enabled MBEDTLS_ECP_C |
| 4053 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4054 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4055 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4056 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4057 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4058 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4059 | -c "use CA callback for X.509 CRT verification" \ |
| 4060 | -c "bad certificate (EC key curve)" \ |
| 4061 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4062 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4063 | |
| 4064 | requires_config_enabled MBEDTLS_ECP_C |
| 4065 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4066 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4067 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4068 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4069 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4070 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4071 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4072 | -c "bad certificate (EC key curve)"\ |
| 4073 | -c "! Certificate verification flags"\ |
| 4074 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4075 | |
| 4076 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4077 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4078 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4079 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4080 | key_file=data_files/server6.key \ |
| 4081 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4082 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4083 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4084 | -c "Supported Signature Algorithm found: 4," \ |
| 4085 | -c "Supported Signature Algorithm found: 5," |
| 4086 | |
| 4087 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4088 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4089 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4090 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4091 | key_file=data_files/server6.key \ |
| 4092 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4093 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4094 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4095 | -c "Supported Signature Algorithm found: 4," \ |
| 4096 | -c "Supported Signature Algorithm found: 5," |
| 4097 | |
| 4098 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4099 | run_test "Authentication, CA callback: client badcert, 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-badsign.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 | -s "send alert level=2 message=48" \ |
| 4115 | -c "! mbedtls_ssl_handshake returned" \ |
| 4116 | -s "X509 - Certificate verification failed" |
| 4117 | # We don't check that the client receives the alert because it might |
| 4118 | # detect that its write end of the connection is closed and abort |
| 4119 | # before reading the alert message. |
| 4120 | |
| 4121 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4122 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4123 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4124 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4125 | key_file=data_files/server5.key" \ |
| 4126 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4127 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4128 | -S "skip write certificate request" \ |
| 4129 | -C "skip parse certificate request" \ |
| 4130 | -c "got a certificate request" \ |
| 4131 | -C "skip write certificate" \ |
| 4132 | -C "skip write certificate verify" \ |
| 4133 | -S "skip parse certificate verify" \ |
| 4134 | -s "x509_verify_cert() returned" \ |
| 4135 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4136 | -s "! mbedtls_ssl_handshake returned" \ |
| 4137 | -c "! mbedtls_ssl_handshake returned" \ |
| 4138 | -s "X509 - Certificate verification failed" |
| 4139 | |
| 4140 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4141 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4142 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4143 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4144 | key_file=data_files/server5.key" \ |
| 4145 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4146 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4147 | -S "skip write certificate request" \ |
| 4148 | -C "skip parse certificate request" \ |
| 4149 | -c "got a certificate request" \ |
| 4150 | -C "skip write certificate" \ |
| 4151 | -C "skip write certificate verify" \ |
| 4152 | -S "skip parse certificate verify" \ |
| 4153 | -s "x509_verify_cert() returned" \ |
| 4154 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4155 | -S "! mbedtls_ssl_handshake returned" \ |
| 4156 | -C "! mbedtls_ssl_handshake returned" \ |
| 4157 | -S "X509 - Certificate verification failed" |
| 4158 | |
Yuto Takano | e43556b | 2021-06-21 20:07:12 +0100 | [diff] [blame] | 4159 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 4160 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4161 | requires_full_size_output_buffer |
| 4162 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4163 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4164 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4165 | key_file=data_files/dir-maxpath/09.key" \ |
| 4166 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4167 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4168 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4169 | -C "X509 - A fatal error occurred" |
| 4170 | |
Yuto Takano | 73e7dcb | 2021-06-22 06:08:11 +0100 | [diff] [blame^] | 4171 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 4172 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4173 | requires_full_size_output_buffer |
| 4174 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4175 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4176 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4177 | key_file=data_files/dir-maxpath/10.key" \ |
| 4178 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4179 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4180 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4181 | -c "X509 - A fatal error occurred" |
| 4182 | |
Yuto Takano | 73e7dcb | 2021-06-22 06:08:11 +0100 | [diff] [blame^] | 4183 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 4184 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4185 | requires_full_size_output_buffer |
| 4186 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4187 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4188 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4189 | key_file=data_files/dir-maxpath/10.key" \ |
| 4190 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4191 | debug_level=3 auth_mode=optional" \ |
| 4192 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4193 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4194 | -c "X509 - A fatal error occurred" |
| 4195 | |
Yuto Takano | 73e7dcb | 2021-06-22 06:08:11 +0100 | [diff] [blame^] | 4196 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 4197 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4198 | requires_full_size_output_buffer |
| 4199 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4200 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4201 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4202 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4203 | key_file=data_files/dir-maxpath/10.key" \ |
| 4204 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4205 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4206 | -s "X509 - A fatal error occurred" |
| 4207 | |
Yuto Takano | 73e7dcb | 2021-06-22 06:08:11 +0100 | [diff] [blame^] | 4208 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 4209 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4210 | requires_full_size_output_buffer |
| 4211 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4212 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4213 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4214 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4215 | key_file=data_files/dir-maxpath/10.key" \ |
| 4216 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4217 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4218 | -s "X509 - A fatal error occurred" |
| 4219 | |
Yuto Takano | e43556b | 2021-06-21 20:07:12 +0100 | [diff] [blame] | 4220 | requires_config_value_at_least "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
| 4221 | requires_config_value_at_most "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4222 | requires_full_size_output_buffer |
| 4223 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4224 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4225 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4226 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4227 | key_file=data_files/dir-maxpath/09.key" \ |
| 4228 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4229 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4230 | -S "X509 - A fatal error occurred" |
| 4231 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4232 | # Tests for certificate selection based on SHA verson |
| 4233 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4234 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4235 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4236 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4237 | key_file=data_files/server5.key \ |
| 4238 | crt_file2=data_files/server5-sha1.crt \ |
| 4239 | key_file2=data_files/server5.key" \ |
| 4240 | "$P_CLI force_version=tls1_2" \ |
| 4241 | 0 \ |
| 4242 | -c "signed using.*ECDSA with SHA256" \ |
| 4243 | -C "signed using.*ECDSA with SHA1" |
| 4244 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4245 | # tests for SNI |
| 4246 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4247 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4248 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4249 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4250 | 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] | 4251 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4252 | 0 \ |
| 4253 | -S "parse ServerName extension" \ |
| 4254 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4255 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4256 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4257 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4258 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4259 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4260 | 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] | 4261 | 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] | 4262 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4263 | 0 \ |
| 4264 | -s "parse ServerName extension" \ |
| 4265 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4266 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4267 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4268 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4269 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4270 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4271 | 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] | 4272 | 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] | 4273 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4274 | 0 \ |
| 4275 | -s "parse ServerName extension" \ |
| 4276 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4277 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4278 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4279 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4280 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4281 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4282 | 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] | 4283 | 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] | 4284 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4285 | 1 \ |
| 4286 | -s "parse ServerName extension" \ |
| 4287 | -s "ssl_sni_wrapper() returned" \ |
| 4288 | -s "mbedtls_ssl_handshake returned" \ |
| 4289 | -c "mbedtls_ssl_handshake returned" \ |
| 4290 | -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] | 4291 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4292 | run_test "SNI: client auth no override: optional" \ |
| 4293 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4294 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4295 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4296 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4297 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4298 | -S "skip write certificate request" \ |
| 4299 | -C "skip parse certificate request" \ |
| 4300 | -c "got a certificate request" \ |
| 4301 | -C "skip write certificate" \ |
| 4302 | -C "skip write certificate verify" \ |
| 4303 | -S "skip parse certificate verify" |
| 4304 | |
| 4305 | run_test "SNI: client auth override: none -> optional" \ |
| 4306 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4307 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4308 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4309 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4310 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4311 | -S "skip write certificate request" \ |
| 4312 | -C "skip parse certificate request" \ |
| 4313 | -c "got a certificate request" \ |
| 4314 | -C "skip write certificate" \ |
| 4315 | -C "skip write certificate verify" \ |
| 4316 | -S "skip parse certificate verify" |
| 4317 | |
| 4318 | run_test "SNI: client auth override: optional -> none" \ |
| 4319 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4320 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4321 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4322 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4323 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4324 | -s "skip write certificate request" \ |
| 4325 | -C "skip parse certificate request" \ |
| 4326 | -c "got no certificate request" \ |
| 4327 | -c "skip write certificate" \ |
| 4328 | -c "skip write certificate verify" \ |
| 4329 | -s "skip parse certificate verify" |
| 4330 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4331 | run_test "SNI: CA no override" \ |
| 4332 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4333 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4334 | ca_file=data_files/test-ca.crt \ |
| 4335 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4336 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4337 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4338 | 1 \ |
| 4339 | -S "skip write certificate request" \ |
| 4340 | -C "skip parse certificate request" \ |
| 4341 | -c "got a certificate request" \ |
| 4342 | -C "skip write certificate" \ |
| 4343 | -C "skip write certificate verify" \ |
| 4344 | -S "skip parse certificate verify" \ |
| 4345 | -s "x509_verify_cert() returned" \ |
| 4346 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4347 | -S "The certificate has been revoked (is on a CRL)" |
| 4348 | |
| 4349 | run_test "SNI: CA override" \ |
| 4350 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4351 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4352 | ca_file=data_files/test-ca.crt \ |
| 4353 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4354 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4355 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4356 | 0 \ |
| 4357 | -S "skip write certificate request" \ |
| 4358 | -C "skip parse certificate request" \ |
| 4359 | -c "got a certificate request" \ |
| 4360 | -C "skip write certificate" \ |
| 4361 | -C "skip write certificate verify" \ |
| 4362 | -S "skip parse certificate verify" \ |
| 4363 | -S "x509_verify_cert() returned" \ |
| 4364 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4365 | -S "The certificate has been revoked (is on a CRL)" |
| 4366 | |
| 4367 | run_test "SNI: CA override with CRL" \ |
| 4368 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4369 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4370 | ca_file=data_files/test-ca.crt \ |
| 4371 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4372 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4373 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4374 | 1 \ |
| 4375 | -S "skip write certificate request" \ |
| 4376 | -C "skip parse certificate request" \ |
| 4377 | -c "got a certificate request" \ |
| 4378 | -C "skip write certificate" \ |
| 4379 | -C "skip write certificate verify" \ |
| 4380 | -S "skip parse certificate verify" \ |
| 4381 | -s "x509_verify_cert() returned" \ |
| 4382 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4383 | -s "The certificate has been revoked (is on a CRL)" |
| 4384 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4385 | # Tests for SNI and DTLS |
| 4386 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4387 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4388 | run_test "SNI: DTLS, no SNI callback" \ |
| 4389 | "$P_SRV debug_level=3 dtls=1 \ |
| 4390 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4391 | "$P_CLI server_name=localhost dtls=1" \ |
| 4392 | 0 \ |
| 4393 | -S "parse ServerName extension" \ |
| 4394 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4395 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4396 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4397 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4398 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4399 | "$P_SRV debug_level=3 dtls=1 \ |
| 4400 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4401 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4402 | "$P_CLI server_name=localhost dtls=1" \ |
| 4403 | 0 \ |
| 4404 | -s "parse ServerName extension" \ |
| 4405 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4406 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4407 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4408 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4409 | run_test "SNI: DTLS, matching cert 2" \ |
| 4410 | "$P_SRV debug_level=3 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,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4413 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4414 | 0 \ |
| 4415 | -s "parse ServerName extension" \ |
| 4416 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4417 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4418 | |
| 4419 | run_test "SNI: DTLS, no matching cert" \ |
| 4420 | "$P_SRV debug_level=3 dtls=1 \ |
| 4421 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4422 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4423 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4424 | 1 \ |
| 4425 | -s "parse ServerName extension" \ |
| 4426 | -s "ssl_sni_wrapper() returned" \ |
| 4427 | -s "mbedtls_ssl_handshake returned" \ |
| 4428 | -c "mbedtls_ssl_handshake returned" \ |
| 4429 | -c "SSL - A fatal alert message was received from our peer" |
| 4430 | |
| 4431 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4432 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4433 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4434 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4435 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4436 | 0 \ |
| 4437 | -S "skip write certificate request" \ |
| 4438 | -C "skip parse certificate request" \ |
| 4439 | -c "got a certificate request" \ |
| 4440 | -C "skip write certificate" \ |
| 4441 | -C "skip write certificate verify" \ |
| 4442 | -S "skip parse certificate verify" |
| 4443 | |
| 4444 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4445 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4446 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4447 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4448 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4449 | 0 \ |
| 4450 | -S "skip write certificate request" \ |
| 4451 | -C "skip parse certificate request" \ |
| 4452 | -c "got a certificate request" \ |
| 4453 | -C "skip write certificate" \ |
| 4454 | -C "skip write certificate verify" \ |
| 4455 | -S "skip parse certificate verify" |
| 4456 | |
| 4457 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4458 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4459 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4460 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4461 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4462 | 0 \ |
| 4463 | -s "skip write certificate request" \ |
| 4464 | -C "skip parse certificate request" \ |
| 4465 | -c "got no certificate request" \ |
| 4466 | -c "skip write certificate" \ |
| 4467 | -c "skip write certificate verify" \ |
| 4468 | -s "skip parse certificate verify" |
| 4469 | |
| 4470 | run_test "SNI: DTLS, CA no override" \ |
| 4471 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4472 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4473 | ca_file=data_files/test-ca.crt \ |
| 4474 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4475 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4476 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4477 | 1 \ |
| 4478 | -S "skip write certificate request" \ |
| 4479 | -C "skip parse certificate request" \ |
| 4480 | -c "got a certificate request" \ |
| 4481 | -C "skip write certificate" \ |
| 4482 | -C "skip write certificate verify" \ |
| 4483 | -S "skip parse certificate verify" \ |
| 4484 | -s "x509_verify_cert() returned" \ |
| 4485 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4486 | -S "The certificate has been revoked (is on a CRL)" |
| 4487 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4488 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4489 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4490 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4491 | ca_file=data_files/test-ca.crt \ |
| 4492 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4493 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4494 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4495 | 0 \ |
| 4496 | -S "skip write certificate request" \ |
| 4497 | -C "skip parse certificate request" \ |
| 4498 | -c "got a certificate request" \ |
| 4499 | -C "skip write certificate" \ |
| 4500 | -C "skip write certificate verify" \ |
| 4501 | -S "skip parse certificate verify" \ |
| 4502 | -S "x509_verify_cert() returned" \ |
| 4503 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4504 | -S "The certificate has been revoked (is on a CRL)" |
| 4505 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4506 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4507 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4508 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4509 | ca_file=data_files/test-ca.crt \ |
| 4510 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4511 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4512 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4513 | 1 \ |
| 4514 | -S "skip write certificate request" \ |
| 4515 | -C "skip parse certificate request" \ |
| 4516 | -c "got a certificate request" \ |
| 4517 | -C "skip write certificate" \ |
| 4518 | -C "skip write certificate verify" \ |
| 4519 | -S "skip parse certificate verify" \ |
| 4520 | -s "x509_verify_cert() returned" \ |
| 4521 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4522 | -s "The certificate has been revoked (is on a CRL)" |
| 4523 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4524 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4525 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4526 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4527 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4528 | "$P_CLI nbio=2 tickets=0" \ |
| 4529 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4530 | -S "mbedtls_ssl_handshake returned" \ |
| 4531 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4532 | -c "Read from server: .* bytes read" |
| 4533 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4534 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4535 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4536 | "$P_CLI nbio=2 tickets=0" \ |
| 4537 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4538 | -S "mbedtls_ssl_handshake returned" \ |
| 4539 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4540 | -c "Read from server: .* bytes read" |
| 4541 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4542 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4543 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4544 | "$P_CLI nbio=2 tickets=1" \ |
| 4545 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4546 | -S "mbedtls_ssl_handshake returned" \ |
| 4547 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4548 | -c "Read from server: .* bytes read" |
| 4549 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4550 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4551 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4552 | "$P_CLI nbio=2 tickets=1" \ |
| 4553 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4554 | -S "mbedtls_ssl_handshake returned" \ |
| 4555 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4556 | -c "Read from server: .* bytes read" |
| 4557 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4558 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4559 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4560 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4561 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4562 | -S "mbedtls_ssl_handshake returned" \ |
| 4563 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4564 | -c "Read from server: .* bytes read" |
| 4565 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4566 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4567 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4568 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4569 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4570 | -S "mbedtls_ssl_handshake returned" \ |
| 4571 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4572 | -c "Read from server: .* bytes read" |
| 4573 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4574 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4575 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4576 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4577 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4578 | -S "mbedtls_ssl_handshake returned" \ |
| 4579 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4580 | -c "Read from server: .* bytes read" |
| 4581 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4582 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4583 | |
| 4584 | run_test "Event-driven I/O: basic handshake" \ |
| 4585 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4586 | "$P_CLI event=1 tickets=0" \ |
| 4587 | 0 \ |
| 4588 | -S "mbedtls_ssl_handshake returned" \ |
| 4589 | -C "mbedtls_ssl_handshake returned" \ |
| 4590 | -c "Read from server: .* bytes read" |
| 4591 | |
| 4592 | run_test "Event-driven I/O: client auth" \ |
| 4593 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4594 | "$P_CLI event=1 tickets=0" \ |
| 4595 | 0 \ |
| 4596 | -S "mbedtls_ssl_handshake returned" \ |
| 4597 | -C "mbedtls_ssl_handshake returned" \ |
| 4598 | -c "Read from server: .* bytes read" |
| 4599 | |
| 4600 | run_test "Event-driven I/O: ticket" \ |
| 4601 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4602 | "$P_CLI event=1 tickets=1" \ |
| 4603 | 0 \ |
| 4604 | -S "mbedtls_ssl_handshake returned" \ |
| 4605 | -C "mbedtls_ssl_handshake returned" \ |
| 4606 | -c "Read from server: .* bytes read" |
| 4607 | |
| 4608 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4609 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4610 | "$P_CLI event=1 tickets=1" \ |
| 4611 | 0 \ |
| 4612 | -S "mbedtls_ssl_handshake returned" \ |
| 4613 | -C "mbedtls_ssl_handshake returned" \ |
| 4614 | -c "Read from server: .* bytes read" |
| 4615 | |
| 4616 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4617 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4618 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4619 | 0 \ |
| 4620 | -S "mbedtls_ssl_handshake returned" \ |
| 4621 | -C "mbedtls_ssl_handshake returned" \ |
| 4622 | -c "Read from server: .* bytes read" |
| 4623 | |
| 4624 | run_test "Event-driven I/O: ticket + resume" \ |
| 4625 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4626 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4627 | 0 \ |
| 4628 | -S "mbedtls_ssl_handshake returned" \ |
| 4629 | -C "mbedtls_ssl_handshake returned" \ |
| 4630 | -c "Read from server: .* bytes read" |
| 4631 | |
| 4632 | run_test "Event-driven I/O: session-id resume" \ |
| 4633 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4634 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4635 | 0 \ |
| 4636 | -S "mbedtls_ssl_handshake returned" \ |
| 4637 | -C "mbedtls_ssl_handshake returned" \ |
| 4638 | -c "Read from server: .* bytes read" |
| 4639 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4640 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4641 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4642 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4643 | 0 \ |
| 4644 | -c "Read from server: .* bytes read" |
| 4645 | |
| 4646 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4647 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4648 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4649 | 0 \ |
| 4650 | -c "Read from server: .* bytes read" |
| 4651 | |
| 4652 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4653 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4654 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4655 | 0 \ |
| 4656 | -c "Read from server: .* bytes read" |
| 4657 | |
| 4658 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4659 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4660 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4661 | 0 \ |
| 4662 | -c "Read from server: .* bytes read" |
| 4663 | |
| 4664 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4665 | "$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] | 4666 | "$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] | 4667 | 0 \ |
| 4668 | -c "Read from server: .* bytes read" |
| 4669 | |
| 4670 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4671 | "$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] | 4672 | "$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] | 4673 | 0 \ |
| 4674 | -c "Read from server: .* bytes read" |
| 4675 | |
| 4676 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4677 | "$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] | 4678 | "$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] | 4679 | 0 \ |
| 4680 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4681 | |
| 4682 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4683 | # During session resumption, the client will send its ApplicationData record |
| 4684 | # within the same datagram as the Finished messages. In this situation, the |
| 4685 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4686 | # because the ApplicationData request has already been queued internally. |
| 4687 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4688 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4689 | "$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] | 4690 | "$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] | 4691 | 0 \ |
| 4692 | -c "Read from server: .* bytes read" |
| 4693 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4694 | # Tests for version negotiation |
| 4695 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4696 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4697 | "$P_SRV" \ |
| 4698 | "$P_CLI" \ |
| 4699 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4700 | -S "mbedtls_ssl_handshake returned" \ |
| 4701 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4702 | -s "Protocol is TLSv1.2" \ |
| 4703 | -c "Protocol is TLSv1.2" |
| 4704 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4705 | # Tests for ALPN extension |
| 4706 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4707 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4708 | "$P_SRV debug_level=3" \ |
| 4709 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4710 | 0 \ |
| 4711 | -C "client hello, adding alpn extension" \ |
| 4712 | -S "found alpn extension" \ |
| 4713 | -C "got an alert message, type: \\[2:120]" \ |
| 4714 | -S "server hello, adding alpn extension" \ |
| 4715 | -C "found alpn extension " \ |
| 4716 | -C "Application Layer Protocol is" \ |
| 4717 | -S "Application Layer Protocol is" |
| 4718 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4719 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4720 | "$P_SRV debug_level=3" \ |
| 4721 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4722 | 0 \ |
| 4723 | -c "client hello, adding alpn extension" \ |
| 4724 | -s "found alpn extension" \ |
| 4725 | -C "got an alert message, type: \\[2:120]" \ |
| 4726 | -S "server hello, adding alpn extension" \ |
| 4727 | -C "found alpn extension " \ |
| 4728 | -c "Application Layer Protocol is (none)" \ |
| 4729 | -S "Application Layer Protocol is" |
| 4730 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4731 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4732 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4733 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4734 | 0 \ |
| 4735 | -C "client hello, adding alpn extension" \ |
| 4736 | -S "found alpn extension" \ |
| 4737 | -C "got an alert message, type: \\[2:120]" \ |
| 4738 | -S "server hello, adding alpn extension" \ |
| 4739 | -C "found alpn extension " \ |
| 4740 | -C "Application Layer Protocol is" \ |
| 4741 | -s "Application Layer Protocol is (none)" |
| 4742 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4743 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4744 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4745 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4746 | 0 \ |
| 4747 | -c "client hello, adding alpn extension" \ |
| 4748 | -s "found alpn extension" \ |
| 4749 | -C "got an alert message, type: \\[2:120]" \ |
| 4750 | -s "server hello, adding alpn extension" \ |
| 4751 | -c "found alpn extension" \ |
| 4752 | -c "Application Layer Protocol is abc" \ |
| 4753 | -s "Application Layer Protocol is abc" |
| 4754 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4755 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4756 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4757 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4758 | 0 \ |
| 4759 | -c "client hello, adding alpn extension" \ |
| 4760 | -s "found alpn extension" \ |
| 4761 | -C "got an alert message, type: \\[2:120]" \ |
| 4762 | -s "server hello, adding alpn extension" \ |
| 4763 | -c "found alpn extension" \ |
| 4764 | -c "Application Layer Protocol is abc" \ |
| 4765 | -s "Application Layer Protocol is abc" |
| 4766 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4767 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4768 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4769 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4770 | 0 \ |
| 4771 | -c "client hello, adding alpn extension" \ |
| 4772 | -s "found alpn extension" \ |
| 4773 | -C "got an alert message, type: \\[2:120]" \ |
| 4774 | -s "server hello, adding alpn extension" \ |
| 4775 | -c "found alpn extension" \ |
| 4776 | -c "Application Layer Protocol is 1234" \ |
| 4777 | -s "Application Layer Protocol is 1234" |
| 4778 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4779 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4780 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4781 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4782 | 1 \ |
| 4783 | -c "client hello, adding alpn extension" \ |
| 4784 | -s "found alpn extension" \ |
| 4785 | -c "got an alert message, type: \\[2:120]" \ |
| 4786 | -S "server hello, adding alpn extension" \ |
| 4787 | -C "found alpn extension" \ |
| 4788 | -C "Application Layer Protocol is 1234" \ |
| 4789 | -S "Application Layer Protocol is 1234" |
| 4790 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4791 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4792 | # Tests for keyUsage in leaf certificates, part 1: |
| 4793 | # server-side certificate/suite selection |
| 4794 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4795 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4796 | "$P_SRV key_file=data_files/server2.key \ |
| 4797 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4798 | "$P_CLI" \ |
| 4799 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4800 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4801 | |
| 4802 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4803 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4804 | "$P_SRV key_file=data_files/server2.key \ |
| 4805 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4806 | "$P_CLI" \ |
| 4807 | 0 \ |
| 4808 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4809 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4810 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4811 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4812 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4813 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4814 | 1 \ |
| 4815 | -C "Ciphersuite is " |
| 4816 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4817 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4818 | "$P_SRV key_file=data_files/server5.key \ |
| 4819 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4820 | "$P_CLI" \ |
| 4821 | 0 \ |
| 4822 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4823 | |
| 4824 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4825 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4826 | "$P_SRV key_file=data_files/server5.key \ |
| 4827 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4828 | "$P_CLI" \ |
| 4829 | 0 \ |
| 4830 | -c "Ciphersuite is TLS-ECDH-" |
| 4831 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4832 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4833 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4834 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4835 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4836 | 1 \ |
| 4837 | -C "Ciphersuite is " |
| 4838 | |
| 4839 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4840 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4841 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4842 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4843 | "$O_SRV -key data_files/server2.key \ |
| 4844 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4845 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4846 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4847 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4848 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4849 | -C "Processing of the Certificate handshake message failed" \ |
| 4850 | -c "Ciphersuite is TLS-" |
| 4851 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4852 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4853 | "$O_SRV -key data_files/server2.key \ |
| 4854 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4855 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4856 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4857 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4858 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4859 | -C "Processing of the Certificate handshake message failed" \ |
| 4860 | -c "Ciphersuite is TLS-" |
| 4861 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4862 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4863 | "$O_SRV -key data_files/server2.key \ |
| 4864 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4865 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4866 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4867 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4868 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4869 | -C "Processing of the Certificate handshake message failed" \ |
| 4870 | -c "Ciphersuite is TLS-" |
| 4871 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4872 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4873 | "$O_SRV -key data_files/server2.key \ |
| 4874 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4875 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4876 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4877 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4878 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4879 | -c "Processing of the Certificate handshake message failed" \ |
| 4880 | -C "Ciphersuite is TLS-" |
| 4881 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4882 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4883 | "$O_SRV -key data_files/server2.key \ |
| 4884 | -cert data_files/server2.ku-ke.crt" \ |
| 4885 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4886 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4887 | 0 \ |
| 4888 | -c "bad certificate (usage extensions)" \ |
| 4889 | -C "Processing of the Certificate handshake message failed" \ |
| 4890 | -c "Ciphersuite is TLS-" \ |
| 4891 | -c "! Usage does not match the keyUsage extension" |
| 4892 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4893 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4894 | "$O_SRV -key data_files/server2.key \ |
| 4895 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4896 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4897 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4898 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4899 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4900 | -C "Processing of the Certificate handshake message failed" \ |
| 4901 | -c "Ciphersuite is TLS-" |
| 4902 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4903 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4904 | "$O_SRV -key data_files/server2.key \ |
| 4905 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4906 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4907 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4908 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4909 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4910 | -c "Processing of the Certificate handshake message failed" \ |
| 4911 | -C "Ciphersuite is TLS-" |
| 4912 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4913 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4914 | "$O_SRV -key data_files/server2.key \ |
| 4915 | -cert data_files/server2.ku-ds.crt" \ |
| 4916 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4917 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4918 | 0 \ |
| 4919 | -c "bad certificate (usage extensions)" \ |
| 4920 | -C "Processing of the Certificate handshake message failed" \ |
| 4921 | -c "Ciphersuite is TLS-" \ |
| 4922 | -c "! Usage does not match the keyUsage extension" |
| 4923 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4924 | # Tests for keyUsage in leaf certificates, part 3: |
| 4925 | # server-side checking of client cert |
| 4926 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4927 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4928 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4929 | "$O_CLI -key data_files/server2.key \ |
| 4930 | -cert data_files/server2.ku-ds.crt" \ |
| 4931 | 0 \ |
| 4932 | -S "bad certificate (usage extensions)" \ |
| 4933 | -S "Processing of the Certificate handshake message failed" |
| 4934 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4935 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4936 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4937 | "$O_CLI -key data_files/server2.key \ |
| 4938 | -cert data_files/server2.ku-ke.crt" \ |
| 4939 | 0 \ |
| 4940 | -s "bad certificate (usage extensions)" \ |
| 4941 | -S "Processing of the Certificate handshake message failed" |
| 4942 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4943 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4944 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4945 | "$O_CLI -key data_files/server2.key \ |
| 4946 | -cert data_files/server2.ku-ke.crt" \ |
| 4947 | 1 \ |
| 4948 | -s "bad certificate (usage extensions)" \ |
| 4949 | -s "Processing of the Certificate handshake message failed" |
| 4950 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4951 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4952 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4953 | "$O_CLI -key data_files/server5.key \ |
| 4954 | -cert data_files/server5.ku-ds.crt" \ |
| 4955 | 0 \ |
| 4956 | -S "bad certificate (usage extensions)" \ |
| 4957 | -S "Processing of the Certificate handshake message failed" |
| 4958 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4959 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4960 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4961 | "$O_CLI -key data_files/server5.key \ |
| 4962 | -cert data_files/server5.ku-ka.crt" \ |
| 4963 | 0 \ |
| 4964 | -s "bad certificate (usage extensions)" \ |
| 4965 | -S "Processing of the Certificate handshake message failed" |
| 4966 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4967 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 4968 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4969 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4970 | "$P_SRV key_file=data_files/server5.key \ |
| 4971 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4972 | "$P_CLI" \ |
| 4973 | 0 |
| 4974 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4975 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4976 | "$P_SRV key_file=data_files/server5.key \ |
| 4977 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4978 | "$P_CLI" \ |
| 4979 | 0 |
| 4980 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4981 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4982 | "$P_SRV key_file=data_files/server5.key \ |
| 4983 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 4984 | "$P_CLI" \ |
| 4985 | 0 |
| 4986 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4987 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4988 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4989 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4990 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4991 | 1 |
| 4992 | |
| 4993 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 4994 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4995 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4996 | "$O_SRV -key data_files/server5.key \ |
| 4997 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4998 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4999 | 0 \ |
| 5000 | -C "bad certificate (usage extensions)" \ |
| 5001 | -C "Processing of the Certificate handshake message failed" \ |
| 5002 | -c "Ciphersuite is TLS-" |
| 5003 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5004 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5005 | "$O_SRV -key data_files/server5.key \ |
| 5006 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5007 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5008 | 0 \ |
| 5009 | -C "bad certificate (usage extensions)" \ |
| 5010 | -C "Processing of the Certificate handshake message failed" \ |
| 5011 | -c "Ciphersuite is TLS-" |
| 5012 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5013 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5014 | "$O_SRV -key data_files/server5.key \ |
| 5015 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5016 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5017 | 0 \ |
| 5018 | -C "bad certificate (usage extensions)" \ |
| 5019 | -C "Processing of the Certificate handshake message failed" \ |
| 5020 | -c "Ciphersuite is TLS-" |
| 5021 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5022 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5023 | "$O_SRV -key data_files/server5.key \ |
| 5024 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5025 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5026 | 1 \ |
| 5027 | -c "bad certificate (usage extensions)" \ |
| 5028 | -c "Processing of the Certificate handshake message failed" \ |
| 5029 | -C "Ciphersuite is TLS-" |
| 5030 | |
| 5031 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5032 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5033 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5034 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5035 | "$O_CLI -key data_files/server5.key \ |
| 5036 | -cert data_files/server5.eku-cli.crt" \ |
| 5037 | 0 \ |
| 5038 | -S "bad certificate (usage extensions)" \ |
| 5039 | -S "Processing of the Certificate handshake message failed" |
| 5040 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5041 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5042 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5043 | "$O_CLI -key data_files/server5.key \ |
| 5044 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5045 | 0 \ |
| 5046 | -S "bad certificate (usage extensions)" \ |
| 5047 | -S "Processing of the Certificate handshake message failed" |
| 5048 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5049 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5050 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5051 | "$O_CLI -key data_files/server5.key \ |
| 5052 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5053 | 0 \ |
| 5054 | -S "bad certificate (usage extensions)" \ |
| 5055 | -S "Processing of the Certificate handshake message failed" |
| 5056 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5057 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5058 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5059 | "$O_CLI -key data_files/server5.key \ |
| 5060 | -cert data_files/server5.eku-cs.crt" \ |
| 5061 | 0 \ |
| 5062 | -s "bad certificate (usage extensions)" \ |
| 5063 | -S "Processing of the Certificate handshake message failed" |
| 5064 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5065 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5066 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5067 | "$O_CLI -key data_files/server5.key \ |
| 5068 | -cert data_files/server5.eku-cs.crt" \ |
| 5069 | 1 \ |
| 5070 | -s "bad certificate (usage extensions)" \ |
| 5071 | -s "Processing of the Certificate handshake message failed" |
| 5072 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5073 | # Tests for DHM parameters loading |
| 5074 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5075 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5076 | "$P_SRV" \ |
| 5077 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5078 | debug_level=3" \ |
| 5079 | 0 \ |
| 5080 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5081 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5082 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5083 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5084 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5085 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5086 | debug_level=3" \ |
| 5087 | 0 \ |
| 5088 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5089 | -c "value of 'DHM: G ' (2 bits)" |
| 5090 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5091 | # Tests for DHM client-side size checking |
| 5092 | |
| 5093 | run_test "DHM size: server default, client default, OK" \ |
| 5094 | "$P_SRV" \ |
| 5095 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5096 | debug_level=1" \ |
| 5097 | 0 \ |
| 5098 | -C "DHM prime too short:" |
| 5099 | |
| 5100 | run_test "DHM size: server default, client 2048, OK" \ |
| 5101 | "$P_SRV" \ |
| 5102 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5103 | debug_level=1 dhmlen=2048" \ |
| 5104 | 0 \ |
| 5105 | -C "DHM prime too short:" |
| 5106 | |
| 5107 | run_test "DHM size: server 1024, client default, OK" \ |
| 5108 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5109 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5110 | debug_level=1" \ |
| 5111 | 0 \ |
| 5112 | -C "DHM prime too short:" |
| 5113 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5114 | run_test "DHM size: server 999, client 999, OK" \ |
| 5115 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5116 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5117 | debug_level=1 dhmlen=999" \ |
| 5118 | 0 \ |
| 5119 | -C "DHM prime too short:" |
| 5120 | |
| 5121 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5122 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5123 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5124 | debug_level=1 dhmlen=1000" \ |
| 5125 | 0 \ |
| 5126 | -C "DHM prime too short:" |
| 5127 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5128 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5129 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5130 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5131 | debug_level=1" \ |
| 5132 | 1 \ |
| 5133 | -c "DHM prime too short:" |
| 5134 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5135 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5136 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5137 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5138 | debug_level=1 dhmlen=1001" \ |
| 5139 | 1 \ |
| 5140 | -c "DHM prime too short:" |
| 5141 | |
| 5142 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5143 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5144 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5145 | debug_level=1 dhmlen=1000" \ |
| 5146 | 1 \ |
| 5147 | -c "DHM prime too short:" |
| 5148 | |
| 5149 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5150 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5151 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5152 | debug_level=1 dhmlen=999" \ |
| 5153 | 1 \ |
| 5154 | -c "DHM prime too short:" |
| 5155 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5156 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5157 | "$P_SRV" \ |
| 5158 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5159 | debug_level=1 dhmlen=2049" \ |
| 5160 | 1 \ |
| 5161 | -c "DHM prime too short:" |
| 5162 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5163 | # Tests for PSK callback |
| 5164 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5165 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5166 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5167 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5168 | psk_identity=foo psk=abc123" \ |
| 5169 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5170 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5171 | -S "SSL - Unknown identity received" \ |
| 5172 | -S "SSL - Verification of the message MAC failed" |
| 5173 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5174 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5175 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5176 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5177 | "$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] | 5178 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5179 | 0 \ |
| 5180 | -c "skip PMS generation for opaque PSK"\ |
| 5181 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5182 | -C "session hash for extended master secret"\ |
| 5183 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5184 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5185 | -S "SSL - Unknown identity received" \ |
| 5186 | -S "SSL - Verification of the message MAC failed" |
| 5187 | |
| 5188 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5189 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5190 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5191 | "$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] | 5192 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5193 | 0 \ |
| 5194 | -c "skip PMS generation for opaque PSK"\ |
| 5195 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5196 | -C "session hash for extended master secret"\ |
| 5197 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5198 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5199 | -S "SSL - Unknown identity received" \ |
| 5200 | -S "SSL - Verification of the message MAC failed" |
| 5201 | |
| 5202 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5203 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5204 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5205 | "$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] | 5206 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5207 | 0 \ |
| 5208 | -c "skip PMS generation for opaque PSK"\ |
| 5209 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5210 | -c "session hash for extended master secret"\ |
| 5211 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5212 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5213 | -S "SSL - Unknown identity received" \ |
| 5214 | -S "SSL - Verification of the message MAC failed" |
| 5215 | |
| 5216 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5217 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5218 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5219 | "$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] | 5220 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5221 | 0 \ |
| 5222 | -c "skip PMS generation for opaque PSK"\ |
| 5223 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5224 | -c "session hash for extended master secret"\ |
| 5225 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5226 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5227 | -S "SSL - Unknown identity received" \ |
| 5228 | -S "SSL - Verification of the message MAC failed" |
| 5229 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5230 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5231 | 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] | 5232 | "$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] | 5233 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5234 | psk_identity=foo psk=abc123" \ |
| 5235 | 0 \ |
| 5236 | -C "skip PMS generation for opaque PSK"\ |
| 5237 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5238 | -C "session hash for extended master secret"\ |
| 5239 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5240 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5241 | -S "SSL - Unknown identity received" \ |
| 5242 | -S "SSL - Verification of the message MAC failed" |
| 5243 | |
| 5244 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5245 | 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] | 5246 | "$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] | 5247 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5248 | psk_identity=foo psk=abc123" \ |
| 5249 | 0 \ |
| 5250 | -C "skip PMS generation for opaque PSK"\ |
| 5251 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5252 | -C "session hash for extended master secret"\ |
| 5253 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5254 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5255 | -S "SSL - Unknown identity received" \ |
| 5256 | -S "SSL - Verification of the message MAC failed" |
| 5257 | |
| 5258 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5259 | 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] | 5260 | "$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] | 5261 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5262 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5263 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5264 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5265 | -c "session hash for extended master secret"\ |
| 5266 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5267 | -C "skip PMS generation for opaque PSK"\ |
| 5268 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5269 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5270 | -S "SSL - Unknown identity received" \ |
| 5271 | -S "SSL - Verification of the message MAC failed" |
| 5272 | |
| 5273 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5274 | 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] | 5275 | "$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] | 5276 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5277 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5278 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5279 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5280 | -c "session hash for extended master secret"\ |
| 5281 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5282 | -C "skip PMS generation for opaque PSK"\ |
| 5283 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5284 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5285 | -S "SSL - Unknown identity received" \ |
| 5286 | -S "SSL - Verification of the message MAC failed" |
| 5287 | |
| 5288 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5289 | 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] | 5290 | "$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] | 5291 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5292 | psk_identity=def psk=beef" \ |
| 5293 | 0 \ |
| 5294 | -C "skip PMS generation for opaque PSK"\ |
| 5295 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5296 | -C "session hash for extended master secret"\ |
| 5297 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5298 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5299 | -S "SSL - Unknown identity received" \ |
| 5300 | -S "SSL - Verification of the message MAC failed" |
| 5301 | |
| 5302 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5303 | 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] | 5304 | "$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] | 5305 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5306 | psk_identity=def psk=beef" \ |
| 5307 | 0 \ |
| 5308 | -C "skip PMS generation for opaque PSK"\ |
| 5309 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5310 | -C "session hash for extended master secret"\ |
| 5311 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5312 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5313 | -S "SSL - Unknown identity received" \ |
| 5314 | -S "SSL - Verification of the message MAC failed" |
| 5315 | |
| 5316 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5317 | 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] | 5318 | "$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] | 5319 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5320 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5321 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5322 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5323 | -c "session hash for extended master secret"\ |
| 5324 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5325 | -C "skip PMS generation for opaque PSK"\ |
| 5326 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5327 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5328 | -S "SSL - Unknown identity received" \ |
| 5329 | -S "SSL - Verification of the message MAC failed" |
| 5330 | |
| 5331 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5332 | 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] | 5333 | "$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] | 5334 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5335 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5336 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5337 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5338 | -c "session hash for extended master secret"\ |
| 5339 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5340 | -C "skip PMS generation for opaque PSK"\ |
| 5341 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5342 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5343 | -S "SSL - Unknown identity received" \ |
| 5344 | -S "SSL - Verification of the message MAC failed" |
| 5345 | |
| 5346 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5347 | 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] | 5348 | "$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] | 5349 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5350 | psk_identity=def psk=beef" \ |
| 5351 | 0 \ |
| 5352 | -C "skip PMS generation for opaque PSK"\ |
| 5353 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5354 | -C "session hash for extended master secret"\ |
| 5355 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5356 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5357 | -S "SSL - Unknown identity received" \ |
| 5358 | -S "SSL - Verification of the message MAC failed" |
| 5359 | |
| 5360 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5361 | 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] | 5362 | "$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] | 5363 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5364 | psk_identity=def psk=beef" \ |
| 5365 | 0 \ |
| 5366 | -C "skip PMS generation for opaque PSK"\ |
| 5367 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5368 | -C "session hash for extended master secret"\ |
| 5369 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5370 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5371 | -S "SSL - Unknown identity received" \ |
| 5372 | -S "SSL - Verification of the message MAC failed" |
| 5373 | |
| 5374 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5375 | 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] | 5376 | "$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] | 5377 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5378 | psk_identity=def psk=beef" \ |
| 5379 | 0 \ |
| 5380 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5381 | -C "session hash for extended master secret"\ |
| 5382 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5383 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5384 | -S "SSL - Unknown identity received" \ |
| 5385 | -S "SSL - Verification of the message MAC failed" |
| 5386 | |
| 5387 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5388 | 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] | 5389 | "$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] | 5390 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5391 | psk_identity=def psk=beef" \ |
| 5392 | 0 \ |
| 5393 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5394 | -C "session hash for extended master secret"\ |
| 5395 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5396 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5397 | -S "SSL - Unknown identity received" \ |
| 5398 | -S "SSL - Verification of the message MAC failed" |
| 5399 | |
| 5400 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5401 | 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] | 5402 | "$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] | 5403 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5404 | psk_identity=def psk=beef" \ |
| 5405 | 1 \ |
| 5406 | -s "SSL - Verification of the message MAC failed" |
| 5407 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5408 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5409 | "$P_SRV" \ |
| 5410 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5411 | psk_identity=foo psk=abc123" \ |
| 5412 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5413 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5414 | -S "SSL - Unknown identity received" \ |
| 5415 | -S "SSL - Verification of the message MAC failed" |
| 5416 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5417 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5418 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5419 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5420 | psk_identity=foo psk=abc123" \ |
| 5421 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5422 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5423 | -s "SSL - Unknown identity received" \ |
| 5424 | -S "SSL - Verification of the message MAC failed" |
| 5425 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5426 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5427 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5428 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5429 | psk_identity=abc psk=dead" \ |
| 5430 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5431 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5432 | -S "SSL - Unknown identity received" \ |
| 5433 | -S "SSL - Verification of the message MAC failed" |
| 5434 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5435 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5436 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5437 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5438 | psk_identity=def psk=beef" \ |
| 5439 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5440 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5441 | -S "SSL - Unknown identity received" \ |
| 5442 | -S "SSL - Verification of the message MAC failed" |
| 5443 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5444 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5445 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5446 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5447 | psk_identity=ghi psk=beef" \ |
| 5448 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5449 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5450 | -s "SSL - Unknown identity received" \ |
| 5451 | -S "SSL - Verification of the message MAC failed" |
| 5452 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5453 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5454 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5455 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5456 | psk_identity=abc psk=beef" \ |
| 5457 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5458 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5459 | -S "SSL - Unknown identity received" \ |
| 5460 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5461 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5462 | # Tests for EC J-PAKE |
| 5463 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5464 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5465 | run_test "ECJPAKE: client not configured" \ |
| 5466 | "$P_SRV debug_level=3" \ |
| 5467 | "$P_CLI debug_level=3" \ |
| 5468 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5469 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5470 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5471 | -S "found ecjpake kkpp extension" \ |
| 5472 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5473 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5474 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5475 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5476 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5477 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5478 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5479 | run_test "ECJPAKE: server not configured" \ |
| 5480 | "$P_SRV debug_level=3" \ |
| 5481 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5482 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5483 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5484 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5485 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5486 | -s "found ecjpake kkpp extension" \ |
| 5487 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5488 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5489 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5490 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5491 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5492 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5493 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5494 | run_test "ECJPAKE: working, TLS" \ |
| 5495 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5496 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5497 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5498 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5499 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5500 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5501 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5502 | -s "found ecjpake kkpp extension" \ |
| 5503 | -S "skip ecjpake kkpp extension" \ |
| 5504 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5505 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5506 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5507 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5508 | -S "SSL - Verification of the message MAC failed" |
| 5509 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5510 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5511 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5512 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5513 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5514 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5515 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5516 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5517 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5518 | -s "SSL - Verification of the message MAC failed" |
| 5519 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5520 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5521 | run_test "ECJPAKE: working, DTLS" \ |
| 5522 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5523 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5524 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5525 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5526 | -c "re-using cached ecjpake parameters" \ |
| 5527 | -S "SSL - Verification of the message MAC failed" |
| 5528 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5529 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5530 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5531 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5532 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5533 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5534 | 0 \ |
| 5535 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5536 | -S "SSL - Verification of the message MAC failed" |
| 5537 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5538 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5539 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5540 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5541 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5542 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5543 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5544 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5545 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5546 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5547 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5548 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5549 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5550 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5551 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5552 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5553 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5554 | 0 |
| 5555 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5556 | # Test for ClientHello without extensions |
| 5557 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5558 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5559 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5560 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5561 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5562 | 0 \ |
| 5563 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5564 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5565 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5566 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5567 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5568 | "$P_SRV" \ |
| 5569 | "$P_CLI request_size=100" \ |
| 5570 | 0 \ |
| 5571 | -s "Read from client: 100 bytes read$" |
| 5572 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5573 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5574 | "$P_SRV" \ |
| 5575 | "$P_CLI request_size=500" \ |
| 5576 | 0 \ |
| 5577 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5578 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5579 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5580 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5581 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5582 | "$P_SRV" \ |
| 5583 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5584 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5585 | 0 \ |
| 5586 | -s "Read from client: 1 bytes read" |
| 5587 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5588 | 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] | 5589 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5590 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5591 | 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] | 5592 | 0 \ |
| 5593 | -s "Read from client: 1 bytes read" |
| 5594 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5595 | 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] | 5596 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5597 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5598 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5599 | 0 \ |
| 5600 | -s "Read from client: 1 bytes read" |
| 5601 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5602 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5603 | "$P_SRV" \ |
| 5604 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5605 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5606 | 0 \ |
| 5607 | -s "Read from client: 1 bytes read" |
| 5608 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5609 | 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] | 5610 | "$P_SRV" \ |
| 5611 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5612 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5613 | 0 \ |
| 5614 | -s "Read from client: 1 bytes read" |
| 5615 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5616 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5617 | |
| 5618 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5619 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5620 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5621 | "$P_CLI dtls=1 request_size=1 \ |
| 5622 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5623 | 0 \ |
| 5624 | -s "Read from client: 1 bytes read" |
| 5625 | |
| 5626 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5627 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5628 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5629 | "$P_CLI dtls=1 request_size=1 \ |
| 5630 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5631 | 0 \ |
| 5632 | -s "Read from client: 1 bytes read" |
| 5633 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5634 | # Tests for small server packets |
| 5635 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5636 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5637 | "$P_SRV response_size=1" \ |
| 5638 | "$P_CLI force_version=tls1_2 \ |
| 5639 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5640 | 0 \ |
| 5641 | -c "Read from server: 1 bytes read" |
| 5642 | |
| 5643 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5644 | "$P_SRV response_size=1" \ |
| 5645 | "$P_CLI force_version=tls1_2 \ |
| 5646 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5647 | 0 \ |
| 5648 | -c "Read from server: 1 bytes read" |
| 5649 | |
| 5650 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5651 | "$P_SRV response_size=1" \ |
| 5652 | "$P_CLI force_version=tls1_2 \ |
| 5653 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5654 | 0 \ |
| 5655 | -c "Read from server: 1 bytes read" |
| 5656 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5657 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5658 | "$P_SRV response_size=1" \ |
| 5659 | "$P_CLI force_version=tls1_2 \ |
| 5660 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5661 | 0 \ |
| 5662 | -c "Read from server: 1 bytes read" |
| 5663 | |
| 5664 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5665 | "$P_SRV response_size=1" \ |
| 5666 | "$P_CLI force_version=tls1_2 \ |
| 5667 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5668 | 0 \ |
| 5669 | -c "Read from server: 1 bytes read" |
| 5670 | |
| 5671 | # Tests for small server packets in DTLS |
| 5672 | |
| 5673 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5674 | run_test "Small server packet DTLS 1.2" \ |
| 5675 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5676 | "$P_CLI dtls=1 \ |
| 5677 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5678 | 0 \ |
| 5679 | -c "Read from server: 1 bytes read" |
| 5680 | |
| 5681 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5682 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5683 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5684 | "$P_CLI dtls=1 \ |
| 5685 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5686 | 0 \ |
| 5687 | -c "Read from server: 1 bytes read" |
| 5688 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5689 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5690 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5691 | # How many fragments do we expect to write $1 bytes? |
| 5692 | fragments_for_write() { |
| 5693 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5694 | } |
| 5695 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5696 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5697 | "$P_SRV" \ |
| 5698 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5699 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5700 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5701 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5702 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5703 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5704 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5705 | "$P_SRV" \ |
| 5706 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5707 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5708 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5709 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5710 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5711 | 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] | 5712 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5713 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5714 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5715 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5716 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5717 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5718 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5719 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5720 | "$P_SRV" \ |
| 5721 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5722 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5723 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5724 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5725 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5726 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5727 | 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] | 5728 | "$P_SRV" \ |
| 5729 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5730 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5731 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5732 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5733 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5734 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5735 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5736 | "$P_SRV response_size=16384" \ |
| 5737 | "$P_CLI force_version=tls1_2 \ |
| 5738 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5739 | 0 \ |
| 5740 | -c "Read from server: 16384 bytes read" |
| 5741 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5742 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5743 | "$P_SRV response_size=16384" \ |
| 5744 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5745 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5746 | 0 \ |
| 5747 | -s "16384 bytes written in 1 fragments" \ |
| 5748 | -c "Read from server: 16384 bytes read" |
| 5749 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5750 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5751 | "$P_SRV response_size=16384" \ |
| 5752 | "$P_CLI force_version=tls1_2 \ |
| 5753 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5754 | 0 \ |
| 5755 | -c "Read from server: 16384 bytes read" |
| 5756 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5757 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5758 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5759 | "$P_CLI force_version=tls1_2 \ |
| 5760 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5761 | 0 \ |
| 5762 | -s "16384 bytes written in 1 fragments" \ |
| 5763 | -c "Read from server: 16384 bytes read" |
| 5764 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5765 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5766 | "$P_SRV response_size=16384" \ |
| 5767 | "$P_CLI force_version=tls1_2 \ |
| 5768 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5769 | 0 \ |
| 5770 | -c "Read from server: 16384 bytes read" |
| 5771 | |
| 5772 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5773 | "$P_SRV response_size=16384" \ |
| 5774 | "$P_CLI force_version=tls1_2 \ |
| 5775 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5776 | 0 \ |
| 5777 | -c "Read from server: 16384 bytes read" |
| 5778 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5779 | # Tests for restartable ECC |
| 5780 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5781 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 5782 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5783 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5784 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5785 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5786 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5787 | "$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] | 5788 | 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] | 5789 | debug_level=1" \ |
| 5790 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5791 | -C "x509_verify_cert.*4b00" \ |
| 5792 | -C "mbedtls_pk_verify.*4b00" \ |
| 5793 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5794 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5795 | |
| 5796 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5797 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5798 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5799 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5800 | "$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] | 5801 | 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] | 5802 | debug_level=1 ec_max_ops=0" \ |
| 5803 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5804 | -C "x509_verify_cert.*4b00" \ |
| 5805 | -C "mbedtls_pk_verify.*4b00" \ |
| 5806 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5807 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5808 | |
| 5809 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5810 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5811 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5812 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5813 | "$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] | 5814 | 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] | 5815 | debug_level=1 ec_max_ops=65535" \ |
| 5816 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5817 | -C "x509_verify_cert.*4b00" \ |
| 5818 | -C "mbedtls_pk_verify.*4b00" \ |
| 5819 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5820 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5821 | |
| 5822 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5823 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5824 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5825 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5826 | "$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] | 5827 | 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] | 5828 | debug_level=1 ec_max_ops=1000" \ |
| 5829 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5830 | -c "x509_verify_cert.*4b00" \ |
| 5831 | -c "mbedtls_pk_verify.*4b00" \ |
| 5832 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5833 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5834 | |
| 5835 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5836 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5837 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5838 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5839 | crt_file=data_files/server5-badsign.crt \ |
| 5840 | key_file=data_files/server5.key" \ |
| 5841 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5842 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5843 | debug_level=1 ec_max_ops=1000" \ |
| 5844 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5845 | -c "x509_verify_cert.*4b00" \ |
| 5846 | -C "mbedtls_pk_verify.*4b00" \ |
| 5847 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5848 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5849 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5850 | -c "! mbedtls_ssl_handshake returned" \ |
| 5851 | -c "X509 - Certificate verification failed" |
| 5852 | |
| 5853 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5854 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5855 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5856 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5857 | crt_file=data_files/server5-badsign.crt \ |
| 5858 | key_file=data_files/server5.key" \ |
| 5859 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5860 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5861 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5862 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5863 | -c "x509_verify_cert.*4b00" \ |
| 5864 | -c "mbedtls_pk_verify.*4b00" \ |
| 5865 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5866 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5867 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5868 | -C "! mbedtls_ssl_handshake returned" \ |
| 5869 | -C "X509 - Certificate verification failed" |
| 5870 | |
| 5871 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5872 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5873 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5874 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5875 | crt_file=data_files/server5-badsign.crt \ |
| 5876 | key_file=data_files/server5.key" \ |
| 5877 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5878 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5879 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 5880 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5881 | -C "x509_verify_cert.*4b00" \ |
| 5882 | -c "mbedtls_pk_verify.*4b00" \ |
| 5883 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5884 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5885 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5886 | -C "! mbedtls_ssl_handshake returned" \ |
| 5887 | -C "X509 - Certificate verification failed" |
| 5888 | |
| 5889 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5890 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5891 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5892 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5893 | "$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] | 5894 | 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] | 5895 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 5896 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5897 | -c "x509_verify_cert.*4b00" \ |
| 5898 | -c "mbedtls_pk_verify.*4b00" \ |
| 5899 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5900 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5901 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5902 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5903 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5904 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5905 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5906 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5907 | debug_level=1 ec_max_ops=1000" \ |
| 5908 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5909 | -c "x509_verify_cert.*4b00" \ |
| 5910 | -c "mbedtls_pk_verify.*4b00" \ |
| 5911 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5912 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5913 | |
| 5914 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5915 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5916 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5917 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5918 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 5919 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 5920 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5921 | -C "x509_verify_cert.*4b00" \ |
| 5922 | -C "mbedtls_pk_verify.*4b00" \ |
| 5923 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5924 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5925 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5926 | # Tests of asynchronous private key support in SSL |
| 5927 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5928 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5929 | run_test "SSL async private: sign, delay=0" \ |
| 5930 | "$P_SRV \ |
| 5931 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5932 | "$P_CLI" \ |
| 5933 | 0 \ |
| 5934 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5935 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5936 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5937 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5938 | run_test "SSL async private: sign, delay=1" \ |
| 5939 | "$P_SRV \ |
| 5940 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5941 | "$P_CLI" \ |
| 5942 | 0 \ |
| 5943 | -s "Async sign callback: using key slot " \ |
| 5944 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5945 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5946 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 5947 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5948 | run_test "SSL async private: sign, delay=2" \ |
| 5949 | "$P_SRV \ |
| 5950 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 5951 | "$P_CLI" \ |
| 5952 | 0 \ |
| 5953 | -s "Async sign callback: using key slot " \ |
| 5954 | -U "Async sign callback: using key slot " \ |
| 5955 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 5956 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5957 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5958 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5959 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5960 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 5961 | run_test "SSL async private: sign, SNI" \ |
| 5962 | "$P_SRV debug_level=3 \ |
| 5963 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 5964 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5965 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5966 | "$P_CLI server_name=polarssl.example" \ |
| 5967 | 0 \ |
| 5968 | -s "Async sign callback: using key slot " \ |
| 5969 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5970 | -s "parse ServerName extension" \ |
| 5971 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5972 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5973 | |
| 5974 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5975 | run_test "SSL async private: decrypt, delay=0" \ |
| 5976 | "$P_SRV \ |
| 5977 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5978 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5979 | 0 \ |
| 5980 | -s "Async decrypt callback: using key slot " \ |
| 5981 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5982 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5983 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5984 | run_test "SSL async private: decrypt, delay=1" \ |
| 5985 | "$P_SRV \ |
| 5986 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5987 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5988 | 0 \ |
| 5989 | -s "Async decrypt callback: using key slot " \ |
| 5990 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5991 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5992 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5993 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5994 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 5995 | "$P_SRV psk=abc123 \ |
| 5996 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5997 | "$P_CLI psk=abc123 \ |
| 5998 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5999 | 0 \ |
| 6000 | -s "Async decrypt callback: using key slot " \ |
| 6001 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6002 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6003 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6004 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6005 | "$P_SRV psk=abc123 \ |
| 6006 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6007 | "$P_CLI psk=abc123 \ |
| 6008 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6009 | 0 \ |
| 6010 | -s "Async decrypt callback: using key slot " \ |
| 6011 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6012 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6013 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6014 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6015 | run_test "SSL async private: sign callback not present" \ |
| 6016 | "$P_SRV \ |
| 6017 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6018 | "$P_CLI; [ \$? -eq 1 ] && |
| 6019 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6020 | 0 \ |
| 6021 | -S "Async sign callback" \ |
| 6022 | -s "! mbedtls_ssl_handshake returned" \ |
| 6023 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6024 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6025 | -s "Successful connection" |
| 6026 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6027 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6028 | run_test "SSL async private: decrypt callback not present" \ |
| 6029 | "$P_SRV debug_level=1 \ |
| 6030 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6031 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6032 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6033 | 0 \ |
| 6034 | -S "Async decrypt callback" \ |
| 6035 | -s "! mbedtls_ssl_handshake returned" \ |
| 6036 | -s "got no RSA private key" \ |
| 6037 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6038 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6039 | |
| 6040 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6041 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6042 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6043 | "$P_SRV \ |
| 6044 | async_operations=s async_private_delay1=1 \ |
| 6045 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6046 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6047 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6048 | 0 \ |
| 6049 | -s "Async sign callback: using key slot 0," \ |
| 6050 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6051 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6052 | |
| 6053 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6054 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6055 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6056 | "$P_SRV \ |
| 6057 | async_operations=s async_private_delay2=1 \ |
| 6058 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6059 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6060 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6061 | 0 \ |
| 6062 | -s "Async sign callback: using key slot 0," \ |
| 6063 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6064 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6065 | |
| 6066 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6067 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6068 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6069 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6070 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6071 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6072 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6073 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6074 | 0 \ |
| 6075 | -s "Async sign callback: using key slot 1," \ |
| 6076 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6077 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6078 | |
| 6079 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6080 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6081 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6082 | "$P_SRV \ |
| 6083 | async_operations=s async_private_delay1=1 \ |
| 6084 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6085 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6086 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6087 | 0 \ |
| 6088 | -s "Async sign callback: no key matches this certificate." |
| 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: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6092 | "$P_SRV \ |
| 6093 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6094 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6095 | "$P_CLI" \ |
| 6096 | 1 \ |
| 6097 | -s "Async sign callback: injected error" \ |
| 6098 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6099 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6100 | -s "! mbedtls_ssl_handshake returned" |
| 6101 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6102 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6103 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6104 | "$P_SRV \ |
| 6105 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6106 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6107 | "$P_CLI" \ |
| 6108 | 1 \ |
| 6109 | -s "Async sign callback: using key slot " \ |
| 6110 | -S "Async resume" \ |
| 6111 | -s "Async cancel" |
| 6112 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6113 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6114 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6115 | "$P_SRV \ |
| 6116 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6117 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6118 | "$P_CLI" \ |
| 6119 | 1 \ |
| 6120 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6121 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6122 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6123 | -s "! mbedtls_ssl_handshake returned" |
| 6124 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6125 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6126 | run_test "SSL async private: decrypt, error in start" \ |
| 6127 | "$P_SRV \ |
| 6128 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6129 | async_private_error=1" \ |
| 6130 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6131 | 1 \ |
| 6132 | -s "Async decrypt callback: injected error" \ |
| 6133 | -S "Async resume" \ |
| 6134 | -S "Async cancel" \ |
| 6135 | -s "! mbedtls_ssl_handshake returned" |
| 6136 | |
| 6137 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6138 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6139 | "$P_SRV \ |
| 6140 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6141 | async_private_error=2" \ |
| 6142 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6143 | 1 \ |
| 6144 | -s "Async decrypt callback: using key slot " \ |
| 6145 | -S "Async resume" \ |
| 6146 | -s "Async cancel" |
| 6147 | |
| 6148 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6149 | run_test "SSL async private: decrypt, error in resume" \ |
| 6150 | "$P_SRV \ |
| 6151 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6152 | async_private_error=3" \ |
| 6153 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6154 | 1 \ |
| 6155 | -s "Async decrypt callback: using key slot " \ |
| 6156 | -s "Async resume callback: decrypt done but injected error" \ |
| 6157 | -S "Async cancel" \ |
| 6158 | -s "! mbedtls_ssl_handshake returned" |
| 6159 | |
| 6160 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6161 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6162 | "$P_SRV \ |
| 6163 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6164 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6165 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6166 | 0 \ |
| 6167 | -s "Async cancel" \ |
| 6168 | -s "! mbedtls_ssl_handshake returned" \ |
| 6169 | -s "Async resume" \ |
| 6170 | -s "Successful connection" |
| 6171 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6172 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6173 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6174 | "$P_SRV \ |
| 6175 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6176 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6177 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6178 | 0 \ |
| 6179 | -s "! mbedtls_ssl_handshake returned" \ |
| 6180 | -s "Async resume" \ |
| 6181 | -s "Successful connection" |
| 6182 | |
| 6183 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6184 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6185 | 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] | 6186 | "$P_SRV \ |
| 6187 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6188 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6189 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6190 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6191 | [ \$? -eq 1 ] && |
| 6192 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6193 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6194 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6195 | -S "Async resume" \ |
| 6196 | -s "Async cancel" \ |
| 6197 | -s "! mbedtls_ssl_handshake returned" \ |
| 6198 | -s "Async sign callback: no key matches this certificate." \ |
| 6199 | -s "Successful connection" |
| 6200 | |
| 6201 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6202 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6203 | 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] | 6204 | "$P_SRV \ |
| 6205 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6206 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6207 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6208 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6209 | [ \$? -eq 1 ] && |
| 6210 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6211 | 0 \ |
| 6212 | -s "Async resume" \ |
| 6213 | -s "! mbedtls_ssl_handshake returned" \ |
| 6214 | -s "Async sign callback: no key matches this certificate." \ |
| 6215 | -s "Successful connection" |
| 6216 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6217 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6218 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6219 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6220 | "$P_SRV \ |
| 6221 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6222 | exchanges=2 renegotiation=1" \ |
| 6223 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6224 | 0 \ |
| 6225 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6226 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6227 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6228 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6229 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6230 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6231 | "$P_SRV \ |
| 6232 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6233 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6234 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6235 | 0 \ |
| 6236 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6237 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6238 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6239 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6240 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6241 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6242 | "$P_SRV \ |
| 6243 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6244 | exchanges=2 renegotiation=1" \ |
| 6245 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6246 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6247 | 0 \ |
| 6248 | -s "Async decrypt callback: using key slot " \ |
| 6249 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6250 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6251 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6252 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6253 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6254 | "$P_SRV \ |
| 6255 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6256 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6257 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6258 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6259 | 0 \ |
| 6260 | -s "Async decrypt callback: using key slot " \ |
| 6261 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6262 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6263 | # Tests for ECC extensions (rfc 4492) |
| 6264 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6265 | requires_config_enabled MBEDTLS_AES_C |
| 6266 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6267 | requires_config_enabled MBEDTLS_SHA256_C |
| 6268 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6269 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6270 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6271 | "$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] | 6272 | 0 \ |
| 6273 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6274 | -C "client hello, adding supported_point_formats extension" \ |
| 6275 | -S "found supported elliptic curves extension" \ |
| 6276 | -S "found supported point formats extension" |
| 6277 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6278 | requires_config_enabled MBEDTLS_AES_C |
| 6279 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6280 | requires_config_enabled MBEDTLS_SHA256_C |
| 6281 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6282 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6283 | "$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] | 6284 | "$P_CLI debug_level=3" \ |
| 6285 | 0 \ |
| 6286 | -C "found supported_point_formats extension" \ |
| 6287 | -S "server hello, supported_point_formats extension" |
| 6288 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6289 | requires_config_enabled MBEDTLS_AES_C |
| 6290 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6291 | requires_config_enabled MBEDTLS_SHA256_C |
| 6292 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6293 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6294 | "$P_SRV debug_level=3" \ |
| 6295 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6296 | 0 \ |
| 6297 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6298 | -c "client hello, adding supported_point_formats extension" \ |
| 6299 | -s "found supported elliptic curves extension" \ |
| 6300 | -s "found supported point formats extension" |
| 6301 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6302 | requires_config_enabled MBEDTLS_AES_C |
| 6303 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6304 | requires_config_enabled MBEDTLS_SHA256_C |
| 6305 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6306 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6307 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6308 | "$P_CLI debug_level=3" \ |
| 6309 | 0 \ |
| 6310 | -c "found supported_point_formats extension" \ |
| 6311 | -s "server hello, supported_point_formats extension" |
| 6312 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6313 | # Tests for DTLS HelloVerifyRequest |
| 6314 | |
| 6315 | run_test "DTLS cookie: enabled" \ |
| 6316 | "$P_SRV dtls=1 debug_level=2" \ |
| 6317 | "$P_CLI dtls=1 debug_level=2" \ |
| 6318 | 0 \ |
| 6319 | -s "cookie verification failed" \ |
| 6320 | -s "cookie verification passed" \ |
| 6321 | -S "cookie verification skipped" \ |
| 6322 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6323 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6324 | -S "SSL - The requested feature is not available" |
| 6325 | |
| 6326 | run_test "DTLS cookie: disabled" \ |
| 6327 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6328 | "$P_CLI dtls=1 debug_level=2" \ |
| 6329 | 0 \ |
| 6330 | -S "cookie verification failed" \ |
| 6331 | -S "cookie verification passed" \ |
| 6332 | -s "cookie verification skipped" \ |
| 6333 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6334 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6335 | -S "SSL - The requested feature is not available" |
| 6336 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6337 | run_test "DTLS cookie: default (failing)" \ |
| 6338 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6339 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6340 | 1 \ |
| 6341 | -s "cookie verification failed" \ |
| 6342 | -S "cookie verification passed" \ |
| 6343 | -S "cookie verification skipped" \ |
| 6344 | -C "received hello verify request" \ |
| 6345 | -S "hello verification requested" \ |
| 6346 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6347 | |
| 6348 | requires_ipv6 |
| 6349 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6350 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6351 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6352 | 0 \ |
| 6353 | -s "cookie verification failed" \ |
| 6354 | -s "cookie verification passed" \ |
| 6355 | -S "cookie verification skipped" \ |
| 6356 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6357 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6358 | -S "SSL - The requested feature is not available" |
| 6359 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6360 | run_test "DTLS cookie: enabled, nbio" \ |
| 6361 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6362 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6363 | 0 \ |
| 6364 | -s "cookie verification failed" \ |
| 6365 | -s "cookie verification passed" \ |
| 6366 | -S "cookie verification skipped" \ |
| 6367 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6368 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6369 | -S "SSL - The requested feature is not available" |
| 6370 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6371 | # Tests for client reconnecting from the same port with DTLS |
| 6372 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6373 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6374 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6375 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6376 | "$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] | 6377 | 0 \ |
| 6378 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6379 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6380 | -S "Client initiated reconnection from same port" |
| 6381 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6382 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6383 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6384 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6385 | "$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] | 6386 | 0 \ |
| 6387 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6388 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6389 | -s "Client initiated reconnection from same port" |
| 6390 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6391 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6392 | 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] | 6393 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6394 | "$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] | 6395 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6396 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6397 | -s "Client initiated reconnection from same port" |
| 6398 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6399 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6400 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6401 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6402 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6403 | 0 \ |
| 6404 | -S "The operation timed out" \ |
| 6405 | -s "Client initiated reconnection from same port" |
| 6406 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6407 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6408 | "$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] | 6409 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6410 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6411 | -s "The operation timed out" \ |
| 6412 | -S "Client initiated reconnection from same port" |
| 6413 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6414 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6415 | -p "$P_PXY inject_clihlo=1" \ |
| 6416 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6417 | "$P_CLI dtls=1 exchanges=2" \ |
| 6418 | 0 \ |
| 6419 | -s "possible client reconnect from the same port" \ |
| 6420 | -S "Client initiated reconnection from same port" |
| 6421 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6422 | # Tests for various cases of client authentication with DTLS |
| 6423 | # (focused on handshake flows and message parsing) |
| 6424 | |
| 6425 | run_test "DTLS client auth: required" \ |
| 6426 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6427 | "$P_CLI dtls=1" \ |
| 6428 | 0 \ |
| 6429 | -s "Verifying peer X.509 certificate... ok" |
| 6430 | |
| 6431 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6432 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6433 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6434 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6435 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6436 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6437 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6438 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6439 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6440 | 0 \ |
| 6441 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6442 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6443 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6444 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6445 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6446 | "$P_CLI dtls=1 psk=abc124" \ |
| 6447 | 1 \ |
| 6448 | -s "SSL - Verification of the message MAC failed" \ |
| 6449 | -c "SSL - A fatal alert message was received from our peer" |
| 6450 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6451 | # Tests for receiving fragmented handshake messages with DTLS |
| 6452 | |
| 6453 | requires_gnutls |
| 6454 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6455 | "$G_SRV -u --mtu 2048 -a" \ |
| 6456 | "$P_CLI dtls=1 debug_level=2" \ |
| 6457 | 0 \ |
| 6458 | -C "found fragmented DTLS handshake message" \ |
| 6459 | -C "error" |
| 6460 | |
| 6461 | requires_gnutls |
| 6462 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6463 | "$G_SRV -u --mtu 512" \ |
| 6464 | "$P_CLI dtls=1 debug_level=2" \ |
| 6465 | 0 \ |
| 6466 | -c "found fragmented DTLS handshake message" \ |
| 6467 | -C "error" |
| 6468 | |
| 6469 | requires_gnutls |
| 6470 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6471 | "$G_SRV -u --mtu 128" \ |
| 6472 | "$P_CLI dtls=1 debug_level=2" \ |
| 6473 | 0 \ |
| 6474 | -c "found fragmented DTLS handshake message" \ |
| 6475 | -C "error" |
| 6476 | |
| 6477 | requires_gnutls |
| 6478 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6479 | "$G_SRV -u --mtu 128" \ |
| 6480 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6481 | 0 \ |
| 6482 | -c "found fragmented DTLS handshake message" \ |
| 6483 | -C "error" |
| 6484 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6485 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6486 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6487 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6488 | "$G_SRV -u --mtu 256" \ |
| 6489 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6490 | 0 \ |
| 6491 | -c "found fragmented DTLS handshake message" \ |
| 6492 | -c "client hello, adding renegotiation extension" \ |
| 6493 | -c "found renegotiation extension" \ |
| 6494 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6495 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6496 | -C "error" \ |
| 6497 | -s "Extra-header:" |
| 6498 | |
| 6499 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6500 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6501 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6502 | "$G_SRV -u --mtu 256" \ |
| 6503 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6504 | 0 \ |
| 6505 | -c "found fragmented DTLS handshake message" \ |
| 6506 | -c "client hello, adding renegotiation extension" \ |
| 6507 | -c "found renegotiation extension" \ |
| 6508 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6509 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6510 | -C "error" \ |
| 6511 | -s "Extra-header:" |
| 6512 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6513 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6514 | "$O_SRV -dtls -mtu 2048" \ |
| 6515 | "$P_CLI dtls=1 debug_level=2" \ |
| 6516 | 0 \ |
| 6517 | -C "found fragmented DTLS handshake message" \ |
| 6518 | -C "error" |
| 6519 | |
| 6520 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6521 | "$O_SRV -dtls -mtu 768" \ |
| 6522 | "$P_CLI dtls=1 debug_level=2" \ |
| 6523 | 0 \ |
| 6524 | -c "found fragmented DTLS handshake message" \ |
| 6525 | -C "error" |
| 6526 | |
| 6527 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6528 | "$O_SRV -dtls -mtu 256" \ |
| 6529 | "$P_CLI dtls=1 debug_level=2" \ |
| 6530 | 0 \ |
| 6531 | -c "found fragmented DTLS handshake message" \ |
| 6532 | -C "error" |
| 6533 | |
| 6534 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6535 | "$O_SRV -dtls -mtu 256" \ |
| 6536 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6537 | 0 \ |
| 6538 | -c "found fragmented DTLS handshake message" \ |
| 6539 | -C "error" |
| 6540 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6541 | # Tests for sending fragmented handshake messages with DTLS |
| 6542 | # |
| 6543 | # Use client auth when we need the client to send large messages, |
| 6544 | # and use large cert chains on both sides too (the long chains we have all use |
| 6545 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6546 | # Sizes reached (UDP payload): |
| 6547 | # - 2037B for server certificate |
| 6548 | # - 1542B for client certificate |
| 6549 | # - 1013B for newsessionticket |
| 6550 | # - all others below 512B |
| 6551 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6552 | |
| 6553 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6554 | requires_config_enabled MBEDTLS_RSA_C |
| 6555 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6556 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6557 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6558 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6559 | crt_file=data_files/server7_int-ca.crt \ |
| 6560 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6561 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6562 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6563 | "$P_CLI dtls=1 debug_level=2 \ |
| 6564 | crt_file=data_files/server8_int-ca2.crt \ |
| 6565 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6566 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6567 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6568 | 0 \ |
| 6569 | -S "found fragmented DTLS handshake message" \ |
| 6570 | -C "found fragmented DTLS handshake message" \ |
| 6571 | -C "error" |
| 6572 | |
| 6573 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6574 | requires_config_enabled MBEDTLS_RSA_C |
| 6575 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6576 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6577 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6578 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6579 | crt_file=data_files/server7_int-ca.crt \ |
| 6580 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6581 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6582 | max_frag_len=1024" \ |
| 6583 | "$P_CLI dtls=1 debug_level=2 \ |
| 6584 | crt_file=data_files/server8_int-ca2.crt \ |
| 6585 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6586 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6587 | max_frag_len=2048" \ |
| 6588 | 0 \ |
| 6589 | -S "found fragmented DTLS handshake message" \ |
| 6590 | -c "found fragmented DTLS handshake message" \ |
| 6591 | -C "error" |
| 6592 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6593 | # With the MFL extension, the server has no way of forcing |
| 6594 | # the client to not exceed a certain MTU; hence, the following |
| 6595 | # test can't be replicated with an MTU proxy such as the one |
| 6596 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6597 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6598 | requires_config_enabled MBEDTLS_RSA_C |
| 6599 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6600 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6601 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6602 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6603 | crt_file=data_files/server7_int-ca.crt \ |
| 6604 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6605 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6606 | max_frag_len=512" \ |
| 6607 | "$P_CLI dtls=1 debug_level=2 \ |
| 6608 | crt_file=data_files/server8_int-ca2.crt \ |
| 6609 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6610 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6611 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6612 | 0 \ |
| 6613 | -S "found fragmented DTLS handshake message" \ |
| 6614 | -c "found fragmented DTLS handshake message" \ |
| 6615 | -C "error" |
| 6616 | |
| 6617 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6618 | requires_config_enabled MBEDTLS_RSA_C |
| 6619 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6620 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6621 | 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] | 6622 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6623 | crt_file=data_files/server7_int-ca.crt \ |
| 6624 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6625 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6626 | max_frag_len=2048" \ |
| 6627 | "$P_CLI dtls=1 debug_level=2 \ |
| 6628 | crt_file=data_files/server8_int-ca2.crt \ |
| 6629 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6630 | hs_timeout=2500-60000 \ |
| 6631 | max_frag_len=1024" \ |
| 6632 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6633 | -S "found fragmented DTLS handshake message" \ |
| 6634 | -c "found fragmented DTLS handshake message" \ |
| 6635 | -C "error" |
| 6636 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6637 | # While not required by the standard defining the MFL extension |
| 6638 | # (according to which it only applies to records, not to datagrams), |
| 6639 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6640 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6641 | # to the peer. |
| 6642 | # The next test checks that no datagrams significantly larger than the |
| 6643 | # negotiated MFL are sent. |
| 6644 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6645 | requires_config_enabled MBEDTLS_RSA_C |
| 6646 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6647 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6648 | 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] | 6649 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6650 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6651 | crt_file=data_files/server7_int-ca.crt \ |
| 6652 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6653 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6654 | max_frag_len=2048" \ |
| 6655 | "$P_CLI dtls=1 debug_level=2 \ |
| 6656 | crt_file=data_files/server8_int-ca2.crt \ |
| 6657 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6658 | hs_timeout=2500-60000 \ |
| 6659 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6660 | 0 \ |
| 6661 | -S "found fragmented DTLS handshake message" \ |
| 6662 | -c "found fragmented DTLS handshake message" \ |
| 6663 | -C "error" |
| 6664 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6665 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6666 | requires_config_enabled MBEDTLS_RSA_C |
| 6667 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6668 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6669 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6670 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6671 | crt_file=data_files/server7_int-ca.crt \ |
| 6672 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6673 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6674 | max_frag_len=2048" \ |
| 6675 | "$P_CLI dtls=1 debug_level=2 \ |
| 6676 | crt_file=data_files/server8_int-ca2.crt \ |
| 6677 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6678 | hs_timeout=2500-60000 \ |
| 6679 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6680 | 0 \ |
| 6681 | -s "found fragmented DTLS handshake message" \ |
| 6682 | -c "found fragmented DTLS handshake message" \ |
| 6683 | -C "error" |
| 6684 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6685 | # While not required by the standard defining the MFL extension |
| 6686 | # (according to which it only applies to records, not to datagrams), |
| 6687 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6688 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6689 | # to the peer. |
| 6690 | # The next test checks that no datagrams significantly larger than the |
| 6691 | # negotiated MFL are sent. |
| 6692 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6693 | requires_config_enabled MBEDTLS_RSA_C |
| 6694 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6695 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 6696 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6697 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6698 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6699 | crt_file=data_files/server7_int-ca.crt \ |
| 6700 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6701 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6702 | max_frag_len=2048" \ |
| 6703 | "$P_CLI dtls=1 debug_level=2 \ |
| 6704 | crt_file=data_files/server8_int-ca2.crt \ |
| 6705 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6706 | hs_timeout=2500-60000 \ |
| 6707 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6708 | 0 \ |
| 6709 | -s "found fragmented DTLS handshake message" \ |
| 6710 | -c "found fragmented DTLS handshake message" \ |
| 6711 | -C "error" |
| 6712 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6713 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6714 | requires_config_enabled MBEDTLS_RSA_C |
| 6715 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6716 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6717 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6718 | crt_file=data_files/server7_int-ca.crt \ |
| 6719 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6720 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6721 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6722 | "$P_CLI dtls=1 debug_level=2 \ |
| 6723 | crt_file=data_files/server8_int-ca2.crt \ |
| 6724 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6725 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6726 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6727 | 0 \ |
| 6728 | -S "found fragmented DTLS handshake message" \ |
| 6729 | -C "found fragmented DTLS handshake message" \ |
| 6730 | -C "error" |
| 6731 | |
| 6732 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6733 | requires_config_enabled MBEDTLS_RSA_C |
| 6734 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6735 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6736 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6737 | crt_file=data_files/server7_int-ca.crt \ |
| 6738 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6739 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6740 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6741 | "$P_CLI dtls=1 debug_level=2 \ |
| 6742 | crt_file=data_files/server8_int-ca2.crt \ |
| 6743 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6744 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6745 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6746 | 0 \ |
| 6747 | -s "found fragmented DTLS handshake message" \ |
| 6748 | -C "found fragmented DTLS handshake message" \ |
| 6749 | -C "error" |
| 6750 | |
| 6751 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6752 | requires_config_enabled MBEDTLS_RSA_C |
| 6753 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6754 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6755 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6756 | crt_file=data_files/server7_int-ca.crt \ |
| 6757 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6758 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6759 | mtu=512" \ |
| 6760 | "$P_CLI dtls=1 debug_level=2 \ |
| 6761 | crt_file=data_files/server8_int-ca2.crt \ |
| 6762 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6763 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6764 | mtu=2048" \ |
| 6765 | 0 \ |
| 6766 | -S "found fragmented DTLS handshake message" \ |
| 6767 | -c "found fragmented DTLS handshake message" \ |
| 6768 | -C "error" |
| 6769 | |
| 6770 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6771 | requires_config_enabled MBEDTLS_RSA_C |
| 6772 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6773 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6774 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6775 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6776 | crt_file=data_files/server7_int-ca.crt \ |
| 6777 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6778 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6779 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6780 | "$P_CLI dtls=1 debug_level=2 \ |
| 6781 | crt_file=data_files/server8_int-ca2.crt \ |
| 6782 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6783 | hs_timeout=2500-60000 \ |
| 6784 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6785 | 0 \ |
| 6786 | -s "found fragmented DTLS handshake message" \ |
| 6787 | -c "found fragmented DTLS handshake message" \ |
| 6788 | -C "error" |
| 6789 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6790 | # 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] | 6791 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6792 | requires_config_enabled MBEDTLS_RSA_C |
| 6793 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6794 | requires_config_enabled MBEDTLS_SHA256_C |
| 6795 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6796 | requires_config_enabled MBEDTLS_AES_C |
| 6797 | requires_config_enabled MBEDTLS_GCM_C |
| 6798 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6799 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6800 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6801 | crt_file=data_files/server7_int-ca.crt \ |
| 6802 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6803 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6804 | mtu=512" \ |
| 6805 | "$P_CLI dtls=1 debug_level=2 \ |
| 6806 | crt_file=data_files/server8_int-ca2.crt \ |
| 6807 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6808 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6809 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6810 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6811 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6812 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6813 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6814 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6815 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6816 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6817 | # 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] | 6818 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 6819 | # retransmissions, but in some cases (like both the server and client using |
| 6820 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 6821 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 6822 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6823 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6824 | requires_config_enabled MBEDTLS_RSA_C |
| 6825 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6826 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6827 | requires_config_enabled MBEDTLS_AES_C |
| 6828 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 6829 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6830 | -p "$P_PXY mtu=508" \ |
| 6831 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6832 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6833 | key_file=data_files/server7.key \ |
| 6834 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6835 | "$P_CLI dtls=1 debug_level=2 \ |
| 6836 | crt_file=data_files/server8_int-ca2.crt \ |
| 6837 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6838 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6839 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6840 | 0 \ |
| 6841 | -s "found fragmented DTLS handshake message" \ |
| 6842 | -c "found fragmented DTLS handshake message" \ |
| 6843 | -C "error" |
| 6844 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6845 | # 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] | 6846 | only_with_valgrind |
| 6847 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6848 | requires_config_enabled MBEDTLS_RSA_C |
| 6849 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6850 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6851 | requires_config_enabled MBEDTLS_AES_C |
| 6852 | requires_config_enabled MBEDTLS_GCM_C |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 6853 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6854 | -p "$P_PXY mtu=508" \ |
| 6855 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6856 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6857 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6858 | hs_timeout=250-10000" \ |
| 6859 | "$P_CLI dtls=1 debug_level=2 \ |
| 6860 | crt_file=data_files/server8_int-ca2.crt \ |
| 6861 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6862 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6863 | hs_timeout=250-10000" \ |
| 6864 | 0 \ |
| 6865 | -s "found fragmented DTLS handshake message" \ |
| 6866 | -c "found fragmented DTLS handshake message" \ |
| 6867 | -C "error" |
| 6868 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6869 | # 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] | 6870 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6871 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6872 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6873 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6874 | requires_config_enabled MBEDTLS_RSA_C |
| 6875 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6876 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6877 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6878 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6879 | crt_file=data_files/server7_int-ca.crt \ |
| 6880 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6881 | hs_timeout=10000-60000 \ |
| 6882 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6883 | "$P_CLI dtls=1 debug_level=2 \ |
| 6884 | crt_file=data_files/server8_int-ca2.crt \ |
| 6885 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6886 | hs_timeout=10000-60000 \ |
| 6887 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6888 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6889 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6890 | -s "found fragmented DTLS handshake message" \ |
| 6891 | -c "found fragmented DTLS handshake message" \ |
| 6892 | -C "error" |
| 6893 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6894 | # 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] | 6895 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 6896 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6897 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6898 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6899 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6900 | requires_config_enabled MBEDTLS_RSA_C |
| 6901 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6902 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6903 | requires_config_enabled MBEDTLS_AES_C |
| 6904 | requires_config_enabled MBEDTLS_GCM_C |
| 6905 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6906 | -p "$P_PXY mtu=512" \ |
| 6907 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6908 | crt_file=data_files/server7_int-ca.crt \ |
| 6909 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6910 | hs_timeout=10000-60000 \ |
| 6911 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6912 | "$P_CLI dtls=1 debug_level=2 \ |
| 6913 | crt_file=data_files/server8_int-ca2.crt \ |
| 6914 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6915 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6916 | hs_timeout=10000-60000 \ |
| 6917 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6918 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6919 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6920 | -s "found fragmented DTLS handshake message" \ |
| 6921 | -c "found fragmented DTLS handshake message" \ |
| 6922 | -C "error" |
| 6923 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6924 | not_with_valgrind # spurious autoreduction due to timeout |
| 6925 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6926 | requires_config_enabled MBEDTLS_RSA_C |
| 6927 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6928 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6929 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6930 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6931 | crt_file=data_files/server7_int-ca.crt \ |
| 6932 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6933 | hs_timeout=10000-60000 \ |
| 6934 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6935 | "$P_CLI dtls=1 debug_level=2 \ |
| 6936 | crt_file=data_files/server8_int-ca2.crt \ |
| 6937 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6938 | hs_timeout=10000-60000 \ |
| 6939 | mtu=1024 nbio=2" \ |
| 6940 | 0 \ |
| 6941 | -S "autoreduction" \ |
| 6942 | -s "found fragmented DTLS handshake message" \ |
| 6943 | -c "found fragmented DTLS handshake message" \ |
| 6944 | -C "error" |
| 6945 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6946 | # 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] | 6947 | not_with_valgrind # spurious autoreduction due to timeout |
| 6948 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6949 | requires_config_enabled MBEDTLS_RSA_C |
| 6950 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6951 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6952 | requires_config_enabled MBEDTLS_AES_C |
| 6953 | requires_config_enabled MBEDTLS_GCM_C |
| 6954 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 6955 | -p "$P_PXY mtu=512" \ |
| 6956 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6957 | crt_file=data_files/server7_int-ca.crt \ |
| 6958 | key_file=data_files/server7.key \ |
| 6959 | hs_timeout=10000-60000 \ |
| 6960 | mtu=512 nbio=2" \ |
| 6961 | "$P_CLI dtls=1 debug_level=2 \ |
| 6962 | crt_file=data_files/server8_int-ca2.crt \ |
| 6963 | key_file=data_files/server8.key \ |
| 6964 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6965 | hs_timeout=10000-60000 \ |
| 6966 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6967 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6968 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6969 | -s "found fragmented DTLS handshake message" \ |
| 6970 | -c "found fragmented DTLS handshake message" \ |
| 6971 | -C "error" |
| 6972 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6973 | # 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] | 6974 | # This ensures things still work after session_reset(). |
| 6975 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6976 | # Since we don't support reading fragmented ClientHello yet, |
| 6977 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 6978 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6979 | # An autoreduction on the client-side might happen if the server is |
| 6980 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6981 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6982 | # resumed listening, which would result in a spurious autoreduction. |
| 6983 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6984 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6985 | requires_config_enabled MBEDTLS_RSA_C |
| 6986 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6987 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6988 | requires_config_enabled MBEDTLS_AES_C |
| 6989 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6990 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 6991 | -p "$P_PXY mtu=1450" \ |
| 6992 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6993 | crt_file=data_files/server7_int-ca.crt \ |
| 6994 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6995 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6996 | mtu=1450" \ |
| 6997 | "$P_CLI dtls=1 debug_level=2 \ |
| 6998 | crt_file=data_files/server8_int-ca2.crt \ |
| 6999 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7000 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7001 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7002 | 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] | 7003 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7004 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7005 | -s "found fragmented DTLS handshake message" \ |
| 7006 | -c "found fragmented DTLS handshake message" \ |
| 7007 | -C "error" |
| 7008 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7009 | # An autoreduction on the client-side might happen if the server is |
| 7010 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7011 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7012 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7013 | requires_config_enabled MBEDTLS_RSA_C |
| 7014 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7015 | requires_config_enabled MBEDTLS_SHA256_C |
| 7016 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7017 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7018 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
| 7019 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7020 | -p "$P_PXY mtu=512" \ |
| 7021 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7022 | crt_file=data_files/server7_int-ca.crt \ |
| 7023 | key_file=data_files/server7.key \ |
| 7024 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7025 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7026 | mtu=512" \ |
| 7027 | "$P_CLI dtls=1 debug_level=2 \ |
| 7028 | crt_file=data_files/server8_int-ca2.crt \ |
| 7029 | key_file=data_files/server8.key \ |
| 7030 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7031 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7032 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7033 | mtu=512" \ |
| 7034 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7035 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7036 | -s "found fragmented DTLS handshake message" \ |
| 7037 | -c "found fragmented DTLS handshake message" \ |
| 7038 | -C "error" |
| 7039 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7040 | # An autoreduction on the client-side might happen if the server is |
| 7041 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7042 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7043 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7044 | requires_config_enabled MBEDTLS_RSA_C |
| 7045 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7046 | requires_config_enabled MBEDTLS_SHA256_C |
| 7047 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7048 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7049 | requires_config_enabled MBEDTLS_AES_C |
| 7050 | requires_config_enabled MBEDTLS_GCM_C |
| 7051 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7052 | -p "$P_PXY mtu=512" \ |
| 7053 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7054 | crt_file=data_files/server7_int-ca.crt \ |
| 7055 | key_file=data_files/server7.key \ |
| 7056 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7057 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7058 | mtu=512" \ |
| 7059 | "$P_CLI dtls=1 debug_level=2 \ |
| 7060 | crt_file=data_files/server8_int-ca2.crt \ |
| 7061 | key_file=data_files/server8.key \ |
| 7062 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7063 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7064 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7065 | mtu=512" \ |
| 7066 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7067 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7068 | -s "found fragmented DTLS handshake message" \ |
| 7069 | -c "found fragmented DTLS handshake message" \ |
| 7070 | -C "error" |
| 7071 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7072 | # An autoreduction on the client-side might happen if the server is |
| 7073 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7074 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7075 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7076 | requires_config_enabled MBEDTLS_RSA_C |
| 7077 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7078 | requires_config_enabled MBEDTLS_SHA256_C |
| 7079 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7080 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7081 | requires_config_enabled MBEDTLS_AES_C |
| 7082 | requires_config_enabled MBEDTLS_CCM_C |
| 7083 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7084 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7085 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7086 | crt_file=data_files/server7_int-ca.crt \ |
| 7087 | key_file=data_files/server7.key \ |
| 7088 | exchanges=2 renegotiation=1 \ |
| 7089 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7090 | hs_timeout=10000-60000 \ |
| 7091 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7092 | "$P_CLI dtls=1 debug_level=2 \ |
| 7093 | crt_file=data_files/server8_int-ca2.crt \ |
| 7094 | key_file=data_files/server8.key \ |
| 7095 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7096 | hs_timeout=10000-60000 \ |
| 7097 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7098 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7099 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7100 | -s "found fragmented DTLS handshake message" \ |
| 7101 | -c "found fragmented DTLS handshake message" \ |
| 7102 | -C "error" |
| 7103 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7104 | # An autoreduction on the client-side might happen if the server is |
| 7105 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7106 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7107 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7108 | requires_config_enabled MBEDTLS_RSA_C |
| 7109 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7110 | requires_config_enabled MBEDTLS_SHA256_C |
| 7111 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7112 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7113 | requires_config_enabled MBEDTLS_AES_C |
| 7114 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7115 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
| 7116 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7117 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7118 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7119 | crt_file=data_files/server7_int-ca.crt \ |
| 7120 | key_file=data_files/server7.key \ |
| 7121 | exchanges=2 renegotiation=1 \ |
| 7122 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7123 | hs_timeout=10000-60000 \ |
| 7124 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7125 | "$P_CLI dtls=1 debug_level=2 \ |
| 7126 | crt_file=data_files/server8_int-ca2.crt \ |
| 7127 | key_file=data_files/server8.key \ |
| 7128 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7129 | hs_timeout=10000-60000 \ |
| 7130 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7131 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7132 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7133 | -s "found fragmented DTLS handshake message" \ |
| 7134 | -c "found fragmented DTLS handshake message" \ |
| 7135 | -C "error" |
| 7136 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7137 | # An autoreduction on the client-side might happen if the server is |
| 7138 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7139 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7140 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7141 | requires_config_enabled MBEDTLS_RSA_C |
| 7142 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7143 | requires_config_enabled MBEDTLS_SHA256_C |
| 7144 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7145 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7146 | requires_config_enabled MBEDTLS_AES_C |
| 7147 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7148 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7149 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7150 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7151 | crt_file=data_files/server7_int-ca.crt \ |
| 7152 | key_file=data_files/server7.key \ |
| 7153 | exchanges=2 renegotiation=1 \ |
| 7154 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7155 | hs_timeout=10000-60000 \ |
| 7156 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7157 | "$P_CLI dtls=1 debug_level=2 \ |
| 7158 | crt_file=data_files/server8_int-ca2.crt \ |
| 7159 | key_file=data_files/server8.key \ |
| 7160 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7161 | hs_timeout=10000-60000 \ |
| 7162 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7163 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7164 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7165 | -s "found fragmented DTLS handshake message" \ |
| 7166 | -c "found fragmented DTLS handshake message" \ |
| 7167 | -C "error" |
| 7168 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7169 | # 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] | 7170 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7171 | requires_config_enabled MBEDTLS_RSA_C |
| 7172 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7173 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7174 | requires_config_enabled MBEDTLS_AES_C |
| 7175 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7176 | client_needs_more_time 2 |
| 7177 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7178 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7179 | "$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] | 7180 | crt_file=data_files/server7_int-ca.crt \ |
| 7181 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7182 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7183 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7184 | crt_file=data_files/server8_int-ca2.crt \ |
| 7185 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7186 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7187 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7188 | 0 \ |
| 7189 | -s "found fragmented DTLS handshake message" \ |
| 7190 | -c "found fragmented DTLS handshake message" \ |
| 7191 | -C "error" |
| 7192 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7193 | # 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] | 7194 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7195 | requires_config_enabled MBEDTLS_RSA_C |
| 7196 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7197 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7198 | requires_config_enabled MBEDTLS_AES_C |
| 7199 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7200 | client_needs_more_time 2 |
| 7201 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7202 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7203 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7204 | crt_file=data_files/server7_int-ca.crt \ |
| 7205 | key_file=data_files/server7.key \ |
| 7206 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7207 | "$P_CLI dtls=1 debug_level=2 \ |
| 7208 | crt_file=data_files/server8_int-ca2.crt \ |
| 7209 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7210 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7211 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7212 | 0 \ |
| 7213 | -s "found fragmented DTLS handshake message" \ |
| 7214 | -c "found fragmented DTLS handshake message" \ |
| 7215 | -C "error" |
| 7216 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7217 | # interop tests for DTLS fragmentating with reliable connection |
| 7218 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7219 | # here and below we just want to test that the we fragment in a way that |
| 7220 | # pleases other implementations, so we don't need the peer to fragment |
| 7221 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7222 | requires_config_enabled MBEDTLS_RSA_C |
| 7223 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7224 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7225 | requires_gnutls |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7226 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7227 | "$G_SRV -u" \ |
| 7228 | "$P_CLI dtls=1 debug_level=2 \ |
| 7229 | crt_file=data_files/server8_int-ca2.crt \ |
| 7230 | key_file=data_files/server8.key \ |
| 7231 | mtu=512 force_version=dtls1_2" \ |
| 7232 | 0 \ |
| 7233 | -c "fragmenting handshake message" \ |
| 7234 | -C "error" |
| 7235 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7236 | # We use --insecure for the GnuTLS client because it expects |
| 7237 | # the hostname / IP it connects to to be the name used in the |
| 7238 | # certificate obtained from the server. Here, however, it |
| 7239 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7240 | # as the server name in the certificate. This will make the |
| 7241 | # certifiate validation fail, but passing --insecure makes |
| 7242 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7243 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7244 | requires_config_enabled MBEDTLS_RSA_C |
| 7245 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7246 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7247 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7248 | requires_not_i686 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7249 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7250 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7251 | crt_file=data_files/server7_int-ca.crt \ |
| 7252 | key_file=data_files/server7.key \ |
| 7253 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7254 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7255 | 0 \ |
| 7256 | -s "fragmenting handshake message" |
| 7257 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7258 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7259 | requires_config_enabled MBEDTLS_RSA_C |
| 7260 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7261 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7262 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7263 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7264 | "$P_CLI dtls=1 debug_level=2 \ |
| 7265 | crt_file=data_files/server8_int-ca2.crt \ |
| 7266 | key_file=data_files/server8.key \ |
| 7267 | mtu=512 force_version=dtls1_2" \ |
| 7268 | 0 \ |
| 7269 | -c "fragmenting handshake message" \ |
| 7270 | -C "error" |
| 7271 | |
| 7272 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7273 | requires_config_enabled MBEDTLS_RSA_C |
| 7274 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7275 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7276 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7277 | "$P_SRV dtls=1 debug_level=2 \ |
| 7278 | crt_file=data_files/server7_int-ca.crt \ |
| 7279 | key_file=data_files/server7.key \ |
| 7280 | mtu=512 force_version=dtls1_2" \ |
| 7281 | "$O_CLI -dtls1_2" \ |
| 7282 | 0 \ |
| 7283 | -s "fragmenting handshake message" |
| 7284 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7285 | # interop tests for DTLS fragmentating with unreliable connection |
| 7286 | # |
| 7287 | # again we just want to test that the we fragment in a way that |
| 7288 | # pleases other implementations, so we don't need the peer to fragment |
| 7289 | requires_gnutls_next |
| 7290 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7291 | requires_config_enabled MBEDTLS_RSA_C |
| 7292 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7293 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7294 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7295 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7296 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7297 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7298 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7299 | crt_file=data_files/server8_int-ca2.crt \ |
| 7300 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7301 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7302 | 0 \ |
| 7303 | -c "fragmenting handshake message" \ |
| 7304 | -C "error" |
| 7305 | |
| 7306 | requires_gnutls_next |
| 7307 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7308 | requires_config_enabled MBEDTLS_RSA_C |
| 7309 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7310 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7311 | client_needs_more_time 4 |
| 7312 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7313 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7314 | "$P_SRV dtls=1 debug_level=2 \ |
| 7315 | crt_file=data_files/server7_int-ca.crt \ |
| 7316 | key_file=data_files/server7.key \ |
| 7317 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7318 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7319 | 0 \ |
| 7320 | -s "fragmenting handshake message" |
| 7321 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7322 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7323 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7324 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7325 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7326 | ## (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] | 7327 | skip_next_test |
| 7328 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7329 | requires_config_enabled MBEDTLS_RSA_C |
| 7330 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7331 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7332 | client_needs_more_time 4 |
| 7333 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7334 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7335 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7336 | "$P_CLI dtls=1 debug_level=2 \ |
| 7337 | crt_file=data_files/server8_int-ca2.crt \ |
| 7338 | key_file=data_files/server8.key \ |
| 7339 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7340 | 0 \ |
| 7341 | -c "fragmenting handshake message" \ |
| 7342 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7343 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7344 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7345 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7346 | requires_config_enabled MBEDTLS_RSA_C |
| 7347 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7348 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7349 | client_needs_more_time 4 |
| 7350 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7351 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7352 | "$P_SRV dtls=1 debug_level=2 \ |
| 7353 | crt_file=data_files/server7_int-ca.crt \ |
| 7354 | key_file=data_files/server7.key \ |
| 7355 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7356 | "$O_CLI -dtls1_2" \ |
| 7357 | 0 \ |
| 7358 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7359 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7360 | # Tests for DTLS-SRTP (RFC 5764) |
| 7361 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7362 | run_test "DTLS-SRTP all profiles supported" \ |
| 7363 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7364 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7365 | 0 \ |
| 7366 | -s "found use_srtp extension" \ |
| 7367 | -s "found srtp profile" \ |
| 7368 | -s "selected srtp profile" \ |
| 7369 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7370 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7371 | -c "client hello, adding use_srtp extension" \ |
| 7372 | -c "found use_srtp extension" \ |
| 7373 | -c "found srtp profile" \ |
| 7374 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7375 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7376 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7377 | -C "error" |
| 7378 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7379 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7380 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7381 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7382 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7383 | "$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] | 7384 | 0 \ |
| 7385 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7386 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7387 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7388 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7389 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7390 | -c "client hello, adding use_srtp extension" \ |
| 7391 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7392 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7393 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7394 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7395 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7396 | -C "error" |
| 7397 | |
| 7398 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7399 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7400 | "$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] | 7401 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7402 | 0 \ |
| 7403 | -s "found use_srtp extension" \ |
| 7404 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7405 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7406 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7407 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7408 | -c "client hello, adding use_srtp extension" \ |
| 7409 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7410 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7411 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7412 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7413 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
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 and Client support only one matching profile." \ |
| 7418 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7419 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7420 | 0 \ |
| 7421 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7422 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7423 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7424 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7425 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7426 | -c "client hello, adding use_srtp extension" \ |
| 7427 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7428 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7429 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7430 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7431 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7432 | -C "error" |
| 7433 | |
| 7434 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7435 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7436 | "$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] | 7437 | "$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] | 7438 | 0 \ |
| 7439 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7440 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7441 | -S "selected srtp profile" \ |
| 7442 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7443 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7444 | -c "client hello, adding use_srtp extension" \ |
| 7445 | -C "found use_srtp extension" \ |
| 7446 | -C "found srtp profile" \ |
| 7447 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7448 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7449 | -C "error" |
| 7450 | |
| 7451 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7452 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7453 | "$P_SRV dtls=1 debug_level=3" \ |
| 7454 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7455 | 0 \ |
| 7456 | -s "found use_srtp extension" \ |
| 7457 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7458 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7459 | -c "client hello, adding use_srtp extension" \ |
| 7460 | -C "found use_srtp extension" \ |
| 7461 | -C "found srtp profile" \ |
| 7462 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7463 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7464 | -C "error" |
| 7465 | |
| 7466 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7467 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 7468 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7469 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7470 | 0 \ |
| 7471 | -s "found use_srtp extension" \ |
| 7472 | -s "found srtp profile" \ |
| 7473 | -s "selected srtp profile" \ |
| 7474 | -s "server hello, adding use_srtp extension" \ |
| 7475 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7476 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7477 | -c "client hello, adding use_srtp extension" \ |
| 7478 | -c "found use_srtp extension" \ |
| 7479 | -c "found srtp profile" \ |
| 7480 | -c "selected srtp profile" \ |
| 7481 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7482 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7483 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7484 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7485 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7486 | -C "error" |
| 7487 | |
| 7488 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7489 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7490 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7491 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7492 | 0 \ |
| 7493 | -s "found use_srtp extension" \ |
| 7494 | -s "found srtp profile" \ |
| 7495 | -s "selected srtp profile" \ |
| 7496 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7497 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7498 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7499 | -S "dumping 'using mki' (8 bytes)" \ |
| 7500 | -c "client hello, adding use_srtp extension" \ |
| 7501 | -c "found use_srtp extension" \ |
| 7502 | -c "found srtp profile" \ |
| 7503 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7504 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7505 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7506 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7507 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7508 | -C "dumping 'received mki' (8 bytes)" \ |
| 7509 | -C "error" |
| 7510 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7511 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7512 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7513 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7514 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7515 | 0 \ |
| 7516 | -s "found use_srtp extension" \ |
| 7517 | -s "found srtp profile" \ |
| 7518 | -s "selected srtp profile" \ |
| 7519 | -s "server hello, adding use_srtp extension" \ |
| 7520 | -s "DTLS-SRTP key material is"\ |
| 7521 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7522 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7523 | |
| 7524 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7525 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7526 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7527 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7528 | 0 \ |
| 7529 | -s "found use_srtp extension" \ |
| 7530 | -s "found srtp profile" \ |
| 7531 | -s "selected srtp profile" \ |
| 7532 | -s "server hello, adding use_srtp extension" \ |
| 7533 | -s "DTLS-SRTP key material is"\ |
| 7534 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7535 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7536 | |
| 7537 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7538 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7539 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7540 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7541 | 0 \ |
| 7542 | -s "found use_srtp extension" \ |
| 7543 | -s "found srtp profile" \ |
| 7544 | -s "selected srtp profile" \ |
| 7545 | -s "server hello, adding use_srtp extension" \ |
| 7546 | -s "DTLS-SRTP key material is"\ |
| 7547 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7548 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7549 | |
| 7550 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7551 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7552 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7553 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7554 | 0 \ |
| 7555 | -s "found use_srtp extension" \ |
| 7556 | -s "found srtp profile" \ |
| 7557 | -s "selected srtp profile" \ |
| 7558 | -s "server hello, adding use_srtp extension" \ |
| 7559 | -s "DTLS-SRTP key material is"\ |
| 7560 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7561 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7562 | |
| 7563 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7564 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7565 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7566 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7567 | 0 \ |
| 7568 | -s "found use_srtp extension" \ |
| 7569 | -s "found srtp profile" \ |
| 7570 | -s "selected srtp profile" \ |
| 7571 | -s "server hello, adding use_srtp extension" \ |
| 7572 | -s "DTLS-SRTP key material is"\ |
| 7573 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7574 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7575 | |
| 7576 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7577 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7578 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7579 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7580 | 0 \ |
| 7581 | -s "found use_srtp extension" \ |
| 7582 | -s "found srtp profile" \ |
| 7583 | -S "selected srtp profile" \ |
| 7584 | -S "server hello, adding use_srtp extension" \ |
| 7585 | -S "DTLS-SRTP key material is"\ |
| 7586 | -C "SRTP Extension negotiated, profile" |
| 7587 | |
| 7588 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7589 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7590 | "$P_SRV dtls=1 debug_level=3" \ |
| 7591 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7592 | 0 \ |
| 7593 | -s "found use_srtp extension" \ |
| 7594 | -S "server hello, adding use_srtp extension" \ |
| 7595 | -S "DTLS-SRTP key material is"\ |
| 7596 | -C "SRTP Extension negotiated, profile" |
| 7597 | |
| 7598 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7599 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7600 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7601 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7602 | 0 \ |
| 7603 | -c "client hello, adding use_srtp extension" \ |
| 7604 | -c "found use_srtp extension" \ |
| 7605 | -c "found srtp profile" \ |
| 7606 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7607 | -c "DTLS-SRTP key material is"\ |
| 7608 | -C "error" |
| 7609 | |
| 7610 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7611 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7612 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7613 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7614 | 0 \ |
| 7615 | -c "client hello, adding use_srtp extension" \ |
| 7616 | -c "found use_srtp extension" \ |
| 7617 | -c "found srtp profile" \ |
| 7618 | -c "selected srtp profile" \ |
| 7619 | -c "DTLS-SRTP key material is"\ |
| 7620 | -C "error" |
| 7621 | |
| 7622 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7623 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7624 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7625 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7626 | 0 \ |
| 7627 | -c "client hello, adding use_srtp extension" \ |
| 7628 | -c "found use_srtp extension" \ |
| 7629 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7630 | -c "selected srtp profile" \ |
| 7631 | -c "DTLS-SRTP key material is"\ |
| 7632 | -C "error" |
| 7633 | |
| 7634 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7635 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7636 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7637 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7638 | 0 \ |
| 7639 | -c "client hello, adding use_srtp extension" \ |
| 7640 | -c "found use_srtp extension" \ |
| 7641 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7642 | -c "selected srtp profile" \ |
| 7643 | -c "DTLS-SRTP key material is"\ |
| 7644 | -C "error" |
| 7645 | |
| 7646 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7647 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7648 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7649 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7650 | 0 \ |
| 7651 | -c "client hello, adding use_srtp extension" \ |
| 7652 | -c "found use_srtp extension" \ |
| 7653 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7654 | -c "selected srtp profile" \ |
| 7655 | -c "DTLS-SRTP key material is"\ |
| 7656 | -C "error" |
| 7657 | |
| 7658 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7659 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 7660 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7661 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 7662 | 0 \ |
| 7663 | -c "client hello, adding use_srtp extension" \ |
| 7664 | -C "found use_srtp extension" \ |
| 7665 | -C "found srtp profile" \ |
| 7666 | -C "selected srtp profile" \ |
| 7667 | -C "DTLS-SRTP key material is"\ |
| 7668 | -C "error" |
| 7669 | |
| 7670 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7671 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 7672 | "$O_SRV -dtls" \ |
| 7673 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7674 | 0 \ |
| 7675 | -c "client hello, adding use_srtp extension" \ |
| 7676 | -C "found use_srtp extension" \ |
| 7677 | -C "found srtp profile" \ |
| 7678 | -C "selected srtp profile" \ |
| 7679 | -C "DTLS-SRTP key material is"\ |
| 7680 | -C "error" |
| 7681 | |
| 7682 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7683 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 7684 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7685 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7686 | 0 \ |
| 7687 | -c "client hello, adding use_srtp extension" \ |
| 7688 | -c "found use_srtp extension" \ |
| 7689 | -c "found srtp profile" \ |
| 7690 | -c "selected srtp profile" \ |
| 7691 | -c "DTLS-SRTP key material is"\ |
| 7692 | -c "DTLS-SRTP no mki value negotiated"\ |
| 7693 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7694 | -C "dumping 'received mki' (8 bytes)" \ |
| 7695 | -C "error" |
| 7696 | |
| 7697 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7698 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7699 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7700 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7701 | "$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] | 7702 | 0 \ |
| 7703 | -s "found use_srtp extension" \ |
| 7704 | -s "found srtp profile" \ |
| 7705 | -s "selected srtp profile" \ |
| 7706 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7707 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7708 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 7709 | |
| 7710 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7711 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7712 | 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] | 7713 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7714 | "$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] | 7715 | 0 \ |
| 7716 | -s "found use_srtp extension" \ |
| 7717 | -s "found srtp profile" \ |
| 7718 | -s "selected srtp profile" \ |
| 7719 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7720 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7721 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 7722 | |
| 7723 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7724 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7725 | 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] | 7726 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7727 | "$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] | 7728 | 0 \ |
| 7729 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7730 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7731 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7732 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7733 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7734 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7735 | |
| 7736 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7737 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7738 | 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] | 7739 | "$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] | 7740 | "$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] | 7741 | 0 \ |
| 7742 | -s "found use_srtp extension" \ |
| 7743 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7744 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7745 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7746 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7747 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 7748 | |
| 7749 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7750 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7751 | 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] | 7752 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7753 | "$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] | 7754 | 0 \ |
| 7755 | -s "found use_srtp extension" \ |
| 7756 | -s "found srtp profile" \ |
| 7757 | -s "selected srtp profile" \ |
| 7758 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7759 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7760 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7761 | |
| 7762 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7763 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7764 | 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] | 7765 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7766 | "$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] | 7767 | 0 \ |
| 7768 | -s "found use_srtp extension" \ |
| 7769 | -s "found srtp profile" \ |
| 7770 | -S "selected srtp profile" \ |
| 7771 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7772 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7773 | -C "SRTP profile:" |
| 7774 | |
| 7775 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7776 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7777 | 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] | 7778 | "$P_SRV dtls=1 debug_level=3" \ |
| 7779 | "$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] | 7780 | 0 \ |
| 7781 | -s "found use_srtp extension" \ |
| 7782 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7783 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7784 | -C "SRTP profile:" |
| 7785 | |
| 7786 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7787 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7788 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 7789 | "$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" \ |
| 7790 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7791 | 0 \ |
| 7792 | -c "client hello, adding use_srtp extension" \ |
| 7793 | -c "found use_srtp extension" \ |
| 7794 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7795 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7796 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7797 | -C "error" |
| 7798 | |
| 7799 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7800 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7801 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 7802 | "$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" \ |
| 7803 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7804 | 0 \ |
| 7805 | -c "client hello, adding use_srtp extension" \ |
| 7806 | -c "found use_srtp extension" \ |
| 7807 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7808 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7809 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7810 | -C "error" |
| 7811 | |
| 7812 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7813 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7814 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 7815 | "$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" \ |
| 7816 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7817 | 0 \ |
| 7818 | -c "client hello, adding use_srtp extension" \ |
| 7819 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7820 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7821 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7822 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7823 | -C "error" |
| 7824 | |
| 7825 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7826 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7827 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 7828 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7829 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7830 | 0 \ |
| 7831 | -c "client hello, adding use_srtp extension" \ |
| 7832 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7833 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7834 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7835 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7836 | -C "error" |
| 7837 | |
| 7838 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7839 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7840 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 7841 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7842 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7843 | 0 \ |
| 7844 | -c "client hello, adding use_srtp extension" \ |
| 7845 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7846 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7847 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7848 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7849 | -C "error" |
| 7850 | |
| 7851 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7852 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7853 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 7854 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7855 | "$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] | 7856 | 0 \ |
| 7857 | -c "client hello, adding use_srtp extension" \ |
| 7858 | -C "found use_srtp extension" \ |
| 7859 | -C "found srtp profile" \ |
| 7860 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7861 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7862 | -C "error" |
| 7863 | |
| 7864 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7865 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7866 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 7867 | "$G_SRV -u" \ |
| 7868 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7869 | 0 \ |
| 7870 | -c "client hello, adding use_srtp extension" \ |
| 7871 | -C "found use_srtp extension" \ |
| 7872 | -C "found srtp profile" \ |
| 7873 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7874 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7875 | -C "error" |
| 7876 | |
| 7877 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7878 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7879 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 7880 | "$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" \ |
| 7881 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7882 | 0 \ |
| 7883 | -c "client hello, adding use_srtp extension" \ |
| 7884 | -c "found use_srtp extension" \ |
| 7885 | -c "found srtp profile" \ |
| 7886 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7887 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7888 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7889 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7890 | -c "dumping 'received mki' (8 bytes)" \ |
| 7891 | -C "error" |
| 7892 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7893 | # Tests for specific things with "unreliable" UDP connection |
| 7894 | |
| 7895 | not_with_valgrind # spurious resend due to timeout |
| 7896 | run_test "DTLS proxy: reference" \ |
| 7897 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7898 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 7899 | "$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] | 7900 | 0 \ |
| 7901 | -C "replayed record" \ |
| 7902 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 7903 | -C "Buffer record from epoch" \ |
| 7904 | -S "Buffer record from epoch" \ |
| 7905 | -C "ssl_buffer_message" \ |
| 7906 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7907 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7908 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7909 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7910 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7911 | -c "HTTP/1.0 200 OK" |
| 7912 | |
| 7913 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7914 | run_test "DTLS proxy: duplicate every packet" \ |
| 7915 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7916 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 7917 | "$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] | 7918 | 0 \ |
| 7919 | -c "replayed record" \ |
| 7920 | -s "replayed record" \ |
| 7921 | -c "record from another epoch" \ |
| 7922 | -s "record from another epoch" \ |
| 7923 | -S "resend" \ |
| 7924 | -s "Extra-header:" \ |
| 7925 | -c "HTTP/1.0 200 OK" |
| 7926 | |
| 7927 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 7928 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7929 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 7930 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7931 | 0 \ |
| 7932 | -c "replayed record" \ |
| 7933 | -S "replayed record" \ |
| 7934 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7935 | -s "record from another epoch" \ |
| 7936 | -c "resend" \ |
| 7937 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7938 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7939 | -c "HTTP/1.0 200 OK" |
| 7940 | |
| 7941 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 7942 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7943 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7944 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7945 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7946 | -c "next record in same datagram" \ |
| 7947 | -s "next record in same datagram" |
| 7948 | |
| 7949 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 7950 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7951 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7952 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7953 | 0 \ |
| 7954 | -c "next record in same datagram" \ |
| 7955 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7956 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7957 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 7958 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7959 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 7960 | "$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] | 7961 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7962 | -c "discarding invalid record (mac)" \ |
| 7963 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7964 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7965 | -c "HTTP/1.0 200 OK" \ |
| 7966 | -S "too many records with bad MAC" \ |
| 7967 | -S "Verification of the message MAC failed" |
| 7968 | |
| 7969 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 7970 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7971 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 7972 | "$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] | 7973 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7974 | -C "discarding invalid record (mac)" \ |
| 7975 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7976 | -S "Extra-header:" \ |
| 7977 | -C "HTTP/1.0 200 OK" \ |
| 7978 | -s "too many records with bad MAC" \ |
| 7979 | -s "Verification of the message MAC failed" |
| 7980 | |
| 7981 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 7982 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7983 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 7984 | "$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] | 7985 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7986 | -c "discarding invalid record (mac)" \ |
| 7987 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7988 | -s "Extra-header:" \ |
| 7989 | -c "HTTP/1.0 200 OK" \ |
| 7990 | -S "too many records with bad MAC" \ |
| 7991 | -S "Verification of the message MAC failed" |
| 7992 | |
| 7993 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 7994 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7995 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 7996 | "$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] | 7997 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7998 | -c "discarding invalid record (mac)" \ |
| 7999 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8000 | -s "Extra-header:" \ |
| 8001 | -c "HTTP/1.0 200 OK" \ |
| 8002 | -s "too many records with bad MAC" \ |
| 8003 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8004 | |
| 8005 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8006 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8007 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8008 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8009 | 0 \ |
| 8010 | -c "record from another epoch" \ |
| 8011 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8012 | -s "Extra-header:" \ |
| 8013 | -c "HTTP/1.0 200 OK" |
| 8014 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8015 | # Tests for reordering support with DTLS |
| 8016 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8017 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8018 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8019 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8020 | hs_timeout=2500-60000" \ |
| 8021 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8022 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8023 | 0 \ |
| 8024 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8025 | -c "Next handshake message has been buffered - load"\ |
| 8026 | -S "Buffering HS message" \ |
| 8027 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8028 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8029 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8030 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8031 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8032 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8033 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8034 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8035 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8036 | hs_timeout=2500-60000" \ |
| 8037 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8038 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8039 | 0 \ |
| 8040 | -c "Buffering HS message" \ |
| 8041 | -c "found fragmented DTLS handshake message"\ |
| 8042 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8043 | -c "Next handshake message has been buffered - load"\ |
| 8044 | -S "Buffering HS message" \ |
| 8045 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8046 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8047 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8048 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8049 | -S "Remember CCS message" |
| 8050 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8051 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8052 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8053 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8054 | # while keeping the ServerKeyExchange. |
| 8055 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8056 | 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] | 8057 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8058 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8059 | hs_timeout=2500-60000" \ |
| 8060 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8061 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8062 | 0 \ |
| 8063 | -c "Buffering HS message" \ |
| 8064 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8065 | -C "attempt to make space by freeing buffered messages" \ |
| 8066 | -S "Buffering HS message" \ |
| 8067 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8068 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8069 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8070 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8071 | -S "Remember CCS message" |
| 8072 | |
| 8073 | # The size constraints ensure that the delayed certificate message can't |
| 8074 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8075 | # when dropping it first. |
| 8076 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8077 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8078 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8079 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8080 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8081 | hs_timeout=2500-60000" \ |
| 8082 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8083 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8084 | 0 \ |
| 8085 | -c "Buffering HS message" \ |
| 8086 | -c "attempt to make space by freeing buffered future messages" \ |
| 8087 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8088 | -S "Buffering HS message" \ |
| 8089 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8090 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8091 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8092 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8093 | -S "Remember CCS message" |
| 8094 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8095 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8096 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8097 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8098 | hs_timeout=2500-60000" \ |
| 8099 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8100 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8101 | 0 \ |
| 8102 | -C "Buffering HS message" \ |
| 8103 | -C "Next handshake message has been buffered - load"\ |
| 8104 | -s "Buffering HS message" \ |
| 8105 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8106 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8107 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8108 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8109 | -S "Remember CCS message" |
| 8110 | |
| 8111 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8112 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8113 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8114 | hs_timeout=2500-60000" \ |
| 8115 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8116 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8117 | 0 \ |
| 8118 | -C "Buffering HS message" \ |
| 8119 | -C "Next handshake message has been buffered - load"\ |
| 8120 | -S "Buffering HS message" \ |
| 8121 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8122 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8123 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8124 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8125 | -S "Remember CCS message" |
| 8126 | |
| 8127 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8128 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8129 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8130 | hs_timeout=2500-60000" \ |
| 8131 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8132 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8133 | 0 \ |
| 8134 | -C "Buffering HS message" \ |
| 8135 | -C "Next handshake message has been buffered - load"\ |
| 8136 | -S "Buffering HS message" \ |
| 8137 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8138 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8139 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8140 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8141 | -s "Remember CCS message" |
| 8142 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8143 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8144 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8145 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8146 | hs_timeout=2500-60000" \ |
| 8147 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8148 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8149 | 0 \ |
| 8150 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8151 | -s "Found buffered record from current epoch - load" \ |
| 8152 | -c "Buffer record from epoch 1" \ |
| 8153 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8154 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8155 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8156 | # from the server are delayed, so that the encrypted Finished message |
| 8157 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8158 | # in afterwards, the encrypted Finished message must be freed in order |
| 8159 | # to make space for the NewSessionTicket to be reassembled. |
| 8160 | # This works only in very particular circumstances: |
| 8161 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8162 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8163 | # the encrypted Finished message. |
| 8164 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8165 | # needs to be fragmented. |
| 8166 | # - All messages sent by the server must be small enough to be either sent |
| 8167 | # without fragmentation or be reassembled within the bounds of |
| 8168 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8169 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8170 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8171 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8172 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8173 | -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] | 8174 | "$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] | 8175 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8176 | 0 \ |
| 8177 | -s "Buffer record from epoch 1" \ |
| 8178 | -s "Found buffered record from current epoch - load" \ |
| 8179 | -c "Buffer record from epoch 1" \ |
| 8180 | -C "Found buffered record from current epoch - load" \ |
| 8181 | -c "Enough space available after freeing future epoch record" |
| 8182 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8183 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8184 | |
| 8185 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8186 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8187 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8188 | "$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] | 8189 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8190 | "$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] | 8191 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8192 | 0 \ |
| 8193 | -s "Extra-header:" \ |
| 8194 | -c "HTTP/1.0 200 OK" |
| 8195 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8196 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8197 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8198 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8199 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8200 | "$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] | 8201 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8202 | 0 \ |
| 8203 | -s "Extra-header:" \ |
| 8204 | -c "HTTP/1.0 200 OK" |
| 8205 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8206 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8207 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8208 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8209 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8210 | "$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] | 8211 | 0 \ |
| 8212 | -s "Extra-header:" \ |
| 8213 | -c "HTTP/1.0 200 OK" |
| 8214 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8215 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8216 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8217 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8218 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8219 | "$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] | 8220 | 0 \ |
| 8221 | -s "Extra-header:" \ |
| 8222 | -c "HTTP/1.0 200 OK" |
| 8223 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8224 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8225 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8226 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8227 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8228 | "$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] | 8229 | 0 \ |
| 8230 | -s "Extra-header:" \ |
| 8231 | -c "HTTP/1.0 200 OK" |
| 8232 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8233 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8234 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8235 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8236 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8237 | "$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] | 8238 | 0 \ |
| 8239 | -s "Extra-header:" \ |
| 8240 | -c "HTTP/1.0 200 OK" |
| 8241 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8242 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8243 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8244 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8245 | "$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] | 8246 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8247 | "$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] | 8248 | 0 \ |
| 8249 | -s "Extra-header:" \ |
| 8250 | -c "HTTP/1.0 200 OK" |
| 8251 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8252 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8253 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8254 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8255 | "$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] | 8256 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8257 | "$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] | 8258 | 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] | 8259 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8260 | 0 \ |
| 8261 | -s "a session has been resumed" \ |
| 8262 | -c "a session has been resumed" \ |
| 8263 | -s "Extra-header:" \ |
| 8264 | -c "HTTP/1.0 200 OK" |
| 8265 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8266 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8267 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8268 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8269 | "$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] | 8270 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8271 | "$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] | 8272 | 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] | 8273 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8274 | 0 \ |
| 8275 | -s "a session has been resumed" \ |
| 8276 | -c "a session has been resumed" \ |
| 8277 | -s "Extra-header:" \ |
| 8278 | -c "HTTP/1.0 200 OK" |
| 8279 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8280 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8281 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8282 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8283 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8284 | "$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] | 8285 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8286 | "$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] | 8287 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8288 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8289 | 0 \ |
| 8290 | -c "=> renegotiate" \ |
| 8291 | -s "=> renegotiate" \ |
| 8292 | -s "Extra-header:" \ |
| 8293 | -c "HTTP/1.0 200 OK" |
| 8294 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8295 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8296 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8297 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8298 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8299 | "$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] | 8300 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8301 | "$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] | 8302 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8303 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8304 | 0 \ |
| 8305 | -c "=> renegotiate" \ |
| 8306 | -s "=> renegotiate" \ |
| 8307 | -s "Extra-header:" \ |
| 8308 | -c "HTTP/1.0 200 OK" |
| 8309 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8310 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8311 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8312 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8313 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8314 | "$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] | 8315 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8316 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8317 | "$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] | 8318 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8319 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8320 | 0 \ |
| 8321 | -c "=> renegotiate" \ |
| 8322 | -s "=> renegotiate" \ |
| 8323 | -s "Extra-header:" \ |
| 8324 | -c "HTTP/1.0 200 OK" |
| 8325 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8326 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8327 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8328 | 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] | 8329 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8330 | "$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] | 8331 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8332 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8333 | "$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] | 8334 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8335 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8336 | 0 \ |
| 8337 | -c "=> renegotiate" \ |
| 8338 | -s "=> renegotiate" \ |
| 8339 | -s "Extra-header:" \ |
| 8340 | -c "HTTP/1.0 200 OK" |
| 8341 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8342 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8343 | ## all versions installed on the CI machines), reported here: |
| 8344 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8345 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8346 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8347 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8348 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8349 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8350 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8351 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8352 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8353 | "$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] | 8354 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8355 | -c "HTTP/1.0 200 OK" |
| 8356 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8357 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8358 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8359 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8360 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8361 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8362 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8363 | "$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] | 8364 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8365 | -c "HTTP/1.0 200 OK" |
| 8366 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8367 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8368 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8369 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8370 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8371 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8372 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8373 | "$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] | 8374 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8375 | -c "HTTP/1.0 200 OK" |
| 8376 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8377 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8378 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8379 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8380 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8381 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8382 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8383 | "$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] | 8384 | 0 \ |
| 8385 | -s "Extra-header:" \ |
| 8386 | -c "Extra-header:" |
| 8387 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8388 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8389 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8390 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8391 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8392 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8393 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8394 | "$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] | 8395 | 0 \ |
| 8396 | -s "Extra-header:" \ |
| 8397 | -c "Extra-header:" |
| 8398 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8399 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8400 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8401 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8402 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8403 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8404 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8405 | "$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] | 8406 | 0 \ |
| 8407 | -s "Extra-header:" \ |
| 8408 | -c "Extra-header:" |
| 8409 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8410 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8411 | run_test "export keys functionality" \ |
| 8412 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8413 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8414 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8415 | -c "EAP-TLS key material is:"\ |
| 8416 | -s "EAP-TLS key material is:"\ |
| 8417 | -c "EAP-TLS IV is:" \ |
| 8418 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8419 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8420 | # Test heap memory usage after handshake |
| 8421 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8422 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8423 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 8424 | run_tests_memory_after_hanshake |
| 8425 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8426 | # Final report |
| 8427 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8428 | echo "------------------------------------------------------------------------" |
| 8429 | |
| 8430 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8431 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8432 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8433 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8434 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8435 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8436 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8437 | |
| 8438 | exit $FAILS |