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 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 245 | requires_config_value_equals() { |
| 246 | VAL=$( get_config_value_or_default "$1" ) |
| 247 | if [ -z "$VAL" ]; then |
| 248 | # Should never happen |
| 249 | echo "Mbed TLS configuration $1 is not defined" |
| 250 | exit 1 |
| 251 | elif [ "$VAL" -ne "$2" ]; then |
| 252 | SKIP_NEXT="YES" |
| 253 | fi |
| 254 | } |
| 255 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 256 | # Space-separated list of ciphersuites supported by this build of |
| 257 | # Mbed TLS. |
| 258 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
| 259 | grep TLS- | |
| 260 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 261 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 262 | case $P_CIPHERSUITES in |
| 263 | *" $1 "*) :;; |
| 264 | *) SKIP_NEXT="YES";; |
| 265 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 266 | } |
| 267 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 268 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 269 | # If CMD (call to a TLS client or server program) requires a specific |
| 270 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 271 | # enabled. |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 272 | maybe_requires_ciphersuite_enabled() { |
| 273 | case "$1" in |
| 274 | *\ force_ciphersuite=*) :;; |
| 275 | *) return;; # No specific required ciphersuite |
| 276 | esac |
| 277 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 278 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 279 | shift |
| 280 | |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 281 | requires_ciphersuite_enabled "$ciphersuite" |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 282 | |
| 283 | unset ciphersuite |
| 284 | } |
| 285 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 286 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 287 | requires_openssl_with_fallback_scsv() { |
| 288 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 289 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 290 | then |
| 291 | OPENSSL_HAS_FBSCSV="YES" |
| 292 | else |
| 293 | OPENSSL_HAS_FBSCSV="NO" |
| 294 | fi |
| 295 | fi |
| 296 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 297 | SKIP_NEXT="YES" |
| 298 | fi |
| 299 | } |
| 300 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 301 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 302 | requires_max_content_len() { |
| 303 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 304 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 305 | } |
| 306 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 307 | # skip next test if GnuTLS isn't available |
| 308 | requires_gnutls() { |
| 309 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 310 | 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] | 311 | GNUTLS_AVAILABLE="YES" |
| 312 | else |
| 313 | GNUTLS_AVAILABLE="NO" |
| 314 | fi |
| 315 | fi |
| 316 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 317 | SKIP_NEXT="YES" |
| 318 | fi |
| 319 | } |
| 320 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 321 | # skip next test if GnuTLS-next isn't available |
| 322 | requires_gnutls_next() { |
| 323 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 324 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 325 | GNUTLS_NEXT_AVAILABLE="YES" |
| 326 | else |
| 327 | GNUTLS_NEXT_AVAILABLE="NO" |
| 328 | fi |
| 329 | fi |
| 330 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 331 | SKIP_NEXT="YES" |
| 332 | fi |
| 333 | } |
| 334 | |
| 335 | # skip next test if OpenSSL-legacy isn't available |
| 336 | requires_openssl_legacy() { |
| 337 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 338 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 339 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 340 | else |
| 341 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 342 | fi |
| 343 | fi |
| 344 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 345 | SKIP_NEXT="YES" |
| 346 | fi |
| 347 | } |
| 348 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 349 | # skip next test if IPv6 isn't available on this host |
| 350 | requires_ipv6() { |
| 351 | if [ -z "${HAS_IPV6:-}" ]; then |
| 352 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 353 | SRV_PID=$! |
| 354 | sleep 1 |
| 355 | kill $SRV_PID >/dev/null 2>&1 |
| 356 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 357 | HAS_IPV6="NO" |
| 358 | else |
| 359 | HAS_IPV6="YES" |
| 360 | fi |
| 361 | rm -r $SRV_OUT |
| 362 | fi |
| 363 | |
| 364 | if [ "$HAS_IPV6" = "NO" ]; then |
| 365 | SKIP_NEXT="YES" |
| 366 | fi |
| 367 | } |
| 368 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 369 | # skip next test if it's i686 or uname is not available |
| 370 | requires_not_i686() { |
| 371 | if [ -z "${IS_I686:-}" ]; then |
| 372 | IS_I686="YES" |
| 373 | if which "uname" >/dev/null 2>&1; then |
| 374 | if [ -z "$(uname -a | grep i686)" ]; then |
| 375 | IS_I686="NO" |
| 376 | fi |
| 377 | fi |
| 378 | fi |
| 379 | if [ "$IS_I686" = "YES" ]; then |
| 380 | SKIP_NEXT="YES" |
| 381 | fi |
| 382 | } |
| 383 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 384 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 385 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 386 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 387 | 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] | 388 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 389 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 390 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 391 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 392 | fi |
| 393 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 394 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 395 | fi |
| 396 | |
| 397 | # skip the next test if the SSL output buffer is less than 16KB |
| 398 | requires_full_size_output_buffer() { |
| 399 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 400 | SKIP_NEXT="YES" |
| 401 | fi |
| 402 | } |
| 403 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 404 | # skip the next test if valgrind is in use |
| 405 | not_with_valgrind() { |
| 406 | if [ "$MEMCHECK" -gt 0 ]; then |
| 407 | SKIP_NEXT="YES" |
| 408 | fi |
| 409 | } |
| 410 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 411 | # skip the next test if valgrind is NOT in use |
| 412 | only_with_valgrind() { |
| 413 | if [ "$MEMCHECK" -eq 0 ]; then |
| 414 | SKIP_NEXT="YES" |
| 415 | fi |
| 416 | } |
| 417 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 418 | # 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] | 419 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 420 | CLI_DELAY_FACTOR=$1 |
| 421 | } |
| 422 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 423 | # wait for the given seconds after the client finished in the next test |
| 424 | server_needs_more_time() { |
| 425 | SRV_DELAY_SECONDS=$1 |
| 426 | } |
| 427 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 428 | # print_name <name> |
| 429 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 430 | TESTS=$(( $TESTS + 1 )) |
| 431 | LINE="" |
| 432 | |
| 433 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 434 | LINE="$TESTS " |
| 435 | fi |
| 436 | |
| 437 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 438 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 439 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 440 | for i in `seq 1 $LEN`; do printf '.'; done |
| 441 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 442 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 443 | } |
| 444 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 445 | # record_outcome <outcome> [<failure-reason>] |
| 446 | # The test name must be in $NAME. |
| 447 | record_outcome() { |
| 448 | echo "$1" |
| 449 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 450 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 451 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 452 | "ssl-opt" "$NAME" \ |
| 453 | "$1" "${2-}" \ |
| 454 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 455 | fi |
| 456 | } |
| 457 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 458 | # fail <message> |
| 459 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 460 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 461 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 462 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 463 | mv $SRV_OUT o-srv-${TESTS}.log |
| 464 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 465 | if [ -n "$PXY_CMD" ]; then |
| 466 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 467 | fi |
| 468 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 469 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 470 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 471 | echo " ! server output:" |
| 472 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 473 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 474 | echo " ! client output:" |
| 475 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 476 | if [ -n "$PXY_CMD" ]; then |
| 477 | echo " ! ========================================================" |
| 478 | echo " ! proxy output:" |
| 479 | cat o-pxy-${TESTS}.log |
| 480 | fi |
| 481 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 482 | fi |
| 483 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 484 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 485 | } |
| 486 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 487 | # is_polar <cmd_line> |
| 488 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 489 | case "$1" in |
| 490 | *ssl_client2*) true;; |
| 491 | *ssl_server2*) true;; |
| 492 | *) false;; |
| 493 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 494 | } |
| 495 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 496 | # openssl s_server doesn't have -www with DTLS |
| 497 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 498 | case "$SRV_CMD" in |
| 499 | *s_server*-dtls*) |
| 500 | NEEDS_INPUT=1 |
| 501 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 502 | *) NEEDS_INPUT=0;; |
| 503 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 504 | } |
| 505 | |
| 506 | # provide input to commands that need it |
| 507 | provide_input() { |
| 508 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 509 | return |
| 510 | fi |
| 511 | |
| 512 | while true; do |
| 513 | echo "HTTP/1.0 200 OK" |
| 514 | sleep 1 |
| 515 | done |
| 516 | } |
| 517 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 518 | # has_mem_err <log_file_name> |
| 519 | has_mem_err() { |
| 520 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 521 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 522 | then |
| 523 | return 1 # false: does not have errors |
| 524 | else |
| 525 | return 0 # true: has errors |
| 526 | fi |
| 527 | } |
| 528 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 529 | # 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] | 530 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 531 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 532 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 533 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 534 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 535 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 536 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 537 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 538 | # Make a tight loop, server normally takes less than 1s to start. |
| 539 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 540 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 541 | echo "$3 START TIMEOUT" |
| 542 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 543 | break |
| 544 | fi |
| 545 | # Linux and *BSD support decimal arguments to sleep. On other |
| 546 | # OSes this may be a tight loop. |
| 547 | sleep 0.1 2>/dev/null || true |
| 548 | done |
| 549 | } |
| 550 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 551 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 552 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 553 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 554 | } |
| 555 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 556 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 557 | # Wait for server process $2 to be listening on port $1. |
| 558 | wait_server_start() { |
| 559 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 560 | } |
| 561 | |
| 562 | # Wait for proxy process $2 to be listening on port $1. |
| 563 | wait_proxy_start() { |
| 564 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 565 | } |
| 566 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 567 | # 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] | 568 | # 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] | 569 | # acceptable bounds |
| 570 | check_server_hello_time() { |
| 571 | # 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] | 572 | 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] | 573 | # Get the Unix timestamp for now |
| 574 | CUR_TIME=$(date +'%s') |
| 575 | THRESHOLD_IN_SECS=300 |
| 576 | |
| 577 | # Check if the ServerHello time was printed |
| 578 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 579 | return 1 |
| 580 | fi |
| 581 | |
| 582 | # Check the time in ServerHello is within acceptable bounds |
| 583 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 584 | # The time in ServerHello is at least 5 minutes before now |
| 585 | return 1 |
| 586 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 587 | # 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] | 588 | return 1 |
| 589 | else |
| 590 | return 0 |
| 591 | fi |
| 592 | } |
| 593 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 594 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 595 | handshake_memory_get() { |
| 596 | OUTPUT_VARIABLE="$1" |
| 597 | OUTPUT_FILE="$2" |
| 598 | |
| 599 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 600 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 601 | |
| 602 | # Check if memory usage was read |
| 603 | if [ -z "$MEM_USAGE" ]; then |
| 604 | echo "Error: Can not read the value of handshake memory usage" |
| 605 | return 1 |
| 606 | else |
| 607 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 608 | return 0 |
| 609 | fi |
| 610 | } |
| 611 | |
| 612 | # Get handshake memory usage from server or client output and check if this value |
| 613 | # is not higher than the maximum given by the first argument |
| 614 | handshake_memory_check() { |
| 615 | MAX_MEMORY="$1" |
| 616 | OUTPUT_FILE="$2" |
| 617 | |
| 618 | # Get memory usage |
| 619 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 620 | return 1 |
| 621 | fi |
| 622 | |
| 623 | # Check if memory usage is below max value |
| 624 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 625 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 626 | "but should be below $MAX_MEMORY bytes" |
| 627 | return 1 |
| 628 | else |
| 629 | return 0 |
| 630 | fi |
| 631 | } |
| 632 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 633 | # wait for client to terminate and set CLI_EXIT |
| 634 | # must be called right after starting the client |
| 635 | wait_client_done() { |
| 636 | CLI_PID=$! |
| 637 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 638 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 639 | CLI_DELAY_FACTOR=1 |
| 640 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 641 | ( 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] | 642 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 643 | |
| 644 | wait $CLI_PID |
| 645 | CLI_EXIT=$? |
| 646 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 647 | kill $DOG_PID >/dev/null 2>&1 |
| 648 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 649 | |
| 650 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 651 | |
| 652 | sleep $SRV_DELAY_SECONDS |
| 653 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 654 | } |
| 655 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 656 | # check if the given command uses dtls and sets global variable DTLS |
| 657 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 658 | case "$1" in |
| 659 | *dtls=1*|-dtls|-u) DTLS=1;; |
| 660 | *) DTLS=0;; |
| 661 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 662 | } |
| 663 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 664 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 665 | is_gnutls() { |
| 666 | case "$1" in |
| 667 | *gnutls-cli*) |
| 668 | CMD_IS_GNUTLS=1 |
| 669 | ;; |
| 670 | *gnutls-serv*) |
| 671 | CMD_IS_GNUTLS=1 |
| 672 | ;; |
| 673 | *) |
| 674 | CMD_IS_GNUTLS=0 |
| 675 | ;; |
| 676 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 677 | } |
| 678 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 679 | # Compare file content |
| 680 | # Usage: find_in_both pattern file1 file2 |
| 681 | # extract from file1 the first line matching the pattern |
| 682 | # check in file2 that the same line can be found |
| 683 | find_in_both() { |
| 684 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 685 | if [ -z "$srv_pattern" ]; then |
| 686 | return 1; |
| 687 | fi |
| 688 | |
| 689 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 690 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 691 | else |
| 692 | return 1; |
| 693 | fi |
| 694 | } |
| 695 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 696 | # 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] | 697 | # Options: -s pattern pattern that must be present in server output |
| 698 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 699 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 700 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 701 | # -S pattern pattern that must be absent in server output |
| 702 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 703 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 704 | # -F call shell function on server output |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 705 | # -g call shell function on server and client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 706 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 707 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 708 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 709 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 710 | if is_excluded "$NAME"; then |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 711 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 712 | # 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] | 713 | return |
| 714 | fi |
| 715 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 716 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 717 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 718 | # Do we only run numbered tests? |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 719 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 720 | case ",$RUN_TEST_NUMBER," in |
| 721 | *",$TESTS,"*) :;; |
| 722 | *) SKIP_NEXT="YES";; |
| 723 | esac |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 724 | fi |
| 725 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 726 | # does this test use a proxy? |
| 727 | if [ "X$1" = "X-p" ]; then |
| 728 | PXY_CMD="$2" |
| 729 | shift 2 |
| 730 | else |
| 731 | PXY_CMD="" |
| 732 | fi |
| 733 | |
| 734 | # get commands and client output |
| 735 | SRV_CMD="$1" |
| 736 | CLI_CMD="$2" |
| 737 | CLI_EXPECT="$3" |
| 738 | shift 3 |
| 739 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 740 | # Check if test uses files |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 741 | case "$SRV_CMD $CLI_CMD" in |
| 742 | *data_files/*) |
| 743 | requires_config_enabled MBEDTLS_FS_IO;; |
| 744 | esac |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 745 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 746 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 747 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 748 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 749 | |
| 750 | # should we skip? |
| 751 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 752 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 753 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 754 | SKIPS=$(( $SKIPS + 1 )) |
| 755 | return |
| 756 | fi |
| 757 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 758 | # update DTLS variable |
| 759 | detect_dtls "$SRV_CMD" |
| 760 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 761 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 762 | # 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] | 763 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 764 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 765 | case " $SRV_CMD " in |
| 766 | *' server_addr=::1 '*) |
| 767 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 768 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 769 | fi |
| 770 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 771 | # update CMD_IS_GNUTLS variable |
| 772 | is_gnutls "$SRV_CMD" |
| 773 | |
| 774 | # if the server uses gnutls but doesn't set priority, explicitly |
| 775 | # set the default priority |
| 776 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 777 | case "$SRV_CMD" in |
| 778 | *--priority*) :;; |
| 779 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 780 | esac |
| 781 | fi |
| 782 | |
| 783 | # update CMD_IS_GNUTLS variable |
| 784 | is_gnutls "$CLI_CMD" |
| 785 | |
| 786 | # if the client uses gnutls but doesn't set priority, explicitly |
| 787 | # set the default priority |
| 788 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 789 | case "$CLI_CMD" in |
| 790 | *--priority*) :;; |
| 791 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 792 | esac |
| 793 | fi |
| 794 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 795 | # fix client port |
| 796 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 797 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 798 | else |
| 799 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 800 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 801 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 802 | # prepend valgrind to our commands if active |
| 803 | if [ "$MEMCHECK" -gt 0 ]; then |
| 804 | if is_polar "$SRV_CMD"; then |
| 805 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 806 | fi |
| 807 | if is_polar "$CLI_CMD"; then |
| 808 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 809 | fi |
| 810 | fi |
| 811 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 812 | TIMES_LEFT=2 |
| 813 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 814 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 815 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 816 | # run the commands |
| 817 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 818 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 819 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 820 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 821 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 822 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 823 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 824 | check_osrv_dtls |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 825 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 826 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 827 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 828 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 829 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 830 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 831 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 832 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 833 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 834 | sleep 0.05 |
| 835 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 836 | # terminate the server (and the proxy) |
| 837 | kill $SRV_PID |
| 838 | wait $SRV_PID |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 839 | SRV_RET=$? |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 840 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 841 | if [ -n "$PXY_CMD" ]; then |
| 842 | kill $PXY_PID >/dev/null 2>&1 |
| 843 | wait $PXY_PID |
| 844 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 845 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 846 | # retry only on timeouts |
| 847 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 848 | printf "RETRY " |
| 849 | else |
| 850 | TIMES_LEFT=0 |
| 851 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 852 | done |
| 853 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 854 | # 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] | 855 | # (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] | 856 | # expected client exit to incorrectly succeed in case of catastrophic |
| 857 | # failure) |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 858 | if is_polar "$SRV_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 859 | 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] | 860 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 861 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 862 | return |
| 863 | fi |
| 864 | fi |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 865 | if is_polar "$CLI_CMD"; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 866 | 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] | 867 | else |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 868 | fail "server or client failed to reach handshake stage" |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 869 | return |
| 870 | fi |
| 871 | fi |
| 872 | |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 873 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 874 | # exit with status 0 when interrupted by a signal, and we don't really |
| 875 | # care anyway), in case e.g. the server reports a memory leak. |
| 876 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 877 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 878 | return |
| 879 | fi |
| 880 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 881 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 882 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 883 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 884 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 885 | 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] | 886 | return |
| 887 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 888 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 889 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 890 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 891 | # 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] | 892 | while [ $# -gt 0 ] |
| 893 | do |
| 894 | case $1 in |
| 895 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 896 | 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] | 897 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 898 | return |
| 899 | fi |
| 900 | ;; |
| 901 | |
| 902 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 903 | 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] | 904 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 905 | return |
| 906 | fi |
| 907 | ;; |
| 908 | |
| 909 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 910 | 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] | 911 | 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] | 912 | return |
| 913 | fi |
| 914 | ;; |
| 915 | |
| 916 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 917 | 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] | 918 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 919 | return |
| 920 | fi |
| 921 | ;; |
| 922 | |
| 923 | # The filtering in the following two options (-u and -U) do the following |
| 924 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 925 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 926 | # - keep one of each non-unique line |
| 927 | # - count how many lines remain |
| 928 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 929 | # if there were no duplicates. |
| 930 | "-U") |
| 931 | 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 |
| 932 | fail "lines following pattern '$2' must be unique in Server output" |
| 933 | return |
| 934 | fi |
| 935 | ;; |
| 936 | |
| 937 | "-u") |
| 938 | 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 |
| 939 | 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] | 940 | return |
| 941 | fi |
| 942 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 943 | "-F") |
| 944 | if ! $2 "$SRV_OUT"; then |
| 945 | fail "function call to '$2' failed on Server output" |
| 946 | return |
| 947 | fi |
| 948 | ;; |
| 949 | "-f") |
| 950 | if ! $2 "$CLI_OUT"; then |
| 951 | fail "function call to '$2' failed on Client output" |
| 952 | return |
| 953 | fi |
| 954 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 955 | "-g") |
| 956 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 957 | fail "function call to '$2' failed on Server and Client output" |
| 958 | return |
| 959 | fi |
| 960 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 961 | |
| 962 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 963 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 964 | exit 1 |
| 965 | esac |
| 966 | shift 2 |
| 967 | done |
| 968 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 969 | # check valgrind's results |
| 970 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 971 | 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] | 972 | fail "Server has memory errors" |
| 973 | return |
| 974 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 975 | 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] | 976 | fail "Client has memory errors" |
| 977 | return |
| 978 | fi |
| 979 | fi |
| 980 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 981 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 982 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 983 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 984 | mv $SRV_OUT o-srv-${TESTS}.log |
| 985 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 986 | if [ -n "$PXY_CMD" ]; then |
| 987 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 988 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 989 | fi |
| 990 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 991 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 992 | } |
| 993 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 994 | run_test_psa() { |
| 995 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 996 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 997 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 998 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 999 | 0 \ |
| 1000 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1001 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1002 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1003 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1004 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1005 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1006 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1007 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1008 | -C "Failed to setup PSA-based cipher context"\ |
| 1009 | -S "Failed to setup PSA-based cipher context"\ |
| 1010 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1011 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1012 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1013 | -S "error" \ |
| 1014 | -C "error" |
| 1015 | } |
| 1016 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1017 | run_test_psa_force_curve() { |
| 1018 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1019 | run_test "PSA - ECDH with $1" \ |
Gilles Peskine | 12b5b38 | 2021-06-02 10:00:42 +0200 | [diff] [blame] | 1020 | "$P_SRV debug_level=4 force_version=tls1_2 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1021 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1022 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1023 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1024 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1025 | -c "PSA calc verify" \ |
| 1026 | -c "calc PSA finished" \ |
| 1027 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1028 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1029 | -s "PSA calc verify" \ |
| 1030 | -s "calc PSA finished" \ |
| 1031 | -C "Failed to setup PSA-based cipher context"\ |
| 1032 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1033 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1034 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1035 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1036 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1037 | -C "error" |
| 1038 | } |
| 1039 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1040 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1041 | # a maximum fragment length. |
| 1042 | # first argument ($1) is MFL for SSL client |
| 1043 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1044 | run_test_memory_after_hanshake_with_mfl() |
| 1045 | { |
| 1046 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1047 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1048 | |
| 1049 | # Leave some margin for robustness |
| 1050 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1051 | |
| 1052 | run_test "Handshake memory usage (MFL $1)" \ |
| 1053 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1054 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1055 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1056 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1057 | 0 \ |
| 1058 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1059 | } |
| 1060 | |
| 1061 | |
| 1062 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1063 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1064 | run_tests_memory_after_hanshake() |
| 1065 | { |
| 1066 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1067 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1068 | |
| 1069 | # first test with default MFU is to get reference memory usage |
| 1070 | MEMORY_USAGE_MFL_16K=0 |
| 1071 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1072 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1073 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1074 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1075 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1076 | 0 \ |
| 1077 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1078 | |
| 1079 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1080 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1081 | |
| 1082 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1083 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1084 | |
| 1085 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1086 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1087 | |
| 1088 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1089 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1090 | } |
| 1091 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1092 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1093 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1094 | rm -f context_srv.txt |
| 1095 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1096 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1097 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1098 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1099 | 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] | 1100 | exit 1 |
| 1101 | } |
| 1102 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1103 | # |
| 1104 | # MAIN |
| 1105 | # |
| 1106 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1107 | get_options "$@" |
| 1108 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1109 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1110 | # patterns rather than regular expressions, use a case statement instead |
| 1111 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1112 | # detects simple cases: plain substring, everything, nothing. |
| 1113 | # |
| 1114 | # As an exception, the character '.' is treated as an ordinary character |
| 1115 | # if it is the only special character in the string. This is because it's |
| 1116 | # rare to need "any one character", but needing a literal '.' is common |
| 1117 | # (e.g. '-f "DTLS 1.2"'). |
| 1118 | need_grep= |
| 1119 | case "$FILTER" in |
| 1120 | '^$') simple_filter=;; |
| 1121 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1122 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1123 | need_grep=1;; |
| 1124 | *) # No regexp or shell-pattern special character |
| 1125 | simple_filter="*$FILTER*";; |
| 1126 | esac |
| 1127 | case "$EXCLUDE" in |
| 1128 | '^$') simple_exclude=;; |
| 1129 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1130 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1131 | need_grep=1;; |
| 1132 | *) # No regexp or shell-pattern special character |
| 1133 | simple_exclude="*$EXCLUDE*";; |
| 1134 | esac |
| 1135 | if [ -n "$need_grep" ]; then |
| 1136 | is_excluded () { |
| 1137 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1138 | } |
| 1139 | else |
| 1140 | is_excluded () { |
| 1141 | case "$1" in |
| 1142 | $simple_exclude) true;; |
| 1143 | $simple_filter) false;; |
| 1144 | *) true;; |
| 1145 | esac |
| 1146 | } |
| 1147 | fi |
| 1148 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1149 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1150 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1151 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1152 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1153 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1154 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1155 | exit 1 |
| 1156 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1157 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1158 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1159 | exit 1 |
| 1160 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1161 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1162 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1163 | exit 1 |
| 1164 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1165 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1166 | if which valgrind >/dev/null 2>&1; then :; else |
| 1167 | echo "Memcheck not possible. Valgrind not found" |
| 1168 | exit 1 |
| 1169 | fi |
| 1170 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1171 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1172 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1173 | exit 1 |
| 1174 | fi |
| 1175 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1176 | # used by watchdog |
| 1177 | MAIN_PID="$$" |
| 1178 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1179 | # We use somewhat arbitrary delays for tests: |
| 1180 | # - how long do we wait for the server to start (when lsof not available)? |
| 1181 | # - how long do we allow for the client to finish? |
| 1182 | # (not to check performance, just to avoid waiting indefinitely) |
| 1183 | # Things are slower with valgrind, so give extra time here. |
| 1184 | # |
| 1185 | # Note: without lsof, there is a trade-off between the running time of this |
| 1186 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1187 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1188 | # 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] | 1189 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1190 | START_DELAY=6 |
| 1191 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1192 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1193 | START_DELAY=2 |
| 1194 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1195 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1196 | |
| 1197 | # some particular tests need more time: |
| 1198 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1199 | # - for the server, we sleep for a number of seconds after the client exits |
| 1200 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1201 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1202 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1203 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1204 | # 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] | 1205 | # +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] | 1206 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1207 | 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] | 1208 | 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] | 1209 | O_SRV="$O_SRV -accept $SRV_PORT" |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 1210 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1211 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1212 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1213 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1214 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1215 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1216 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1217 | fi |
| 1218 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1219 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1220 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1221 | fi |
| 1222 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1223 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1224 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1225 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1226 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1227 | # Allow SHA-1, because many of our test certificates use it |
| 1228 | P_SRV="$P_SRV allow_sha1=1" |
| 1229 | P_CLI="$P_CLI allow_sha1=1" |
| 1230 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1231 | # Also pick a unique name for intermediate files |
| 1232 | SRV_OUT="srv_out.$$" |
| 1233 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1234 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1235 | SESSION="session.$$" |
| 1236 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1237 | SKIP_NEXT="NO" |
| 1238 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1239 | trap cleanup INT TERM HUP |
| 1240 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1241 | # Basic test |
| 1242 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1243 | # Checks that: |
| 1244 | # - 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] | 1245 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1246 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1247 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1248 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1249 | "$P_CLI" \ |
| 1250 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1251 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1252 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1253 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1254 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1255 | -S "error" \ |
| 1256 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1257 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1258 | run_test "Default, DTLS" \ |
| 1259 | "$P_SRV dtls=1" \ |
| 1260 | "$P_CLI dtls=1" \ |
| 1261 | 0 \ |
| 1262 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1263 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1264 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1265 | run_test "TLS client auth: required" \ |
| 1266 | "$P_SRV auth_mode=required" \ |
| 1267 | "$P_CLI" \ |
| 1268 | 0 \ |
| 1269 | -s "Verifying peer X.509 certificate... ok" |
| 1270 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1271 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1272 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1273 | requires_config_enabled MBEDTLS_SHA256_C |
| 1274 | run_test "TLS: password protected client key" \ |
| 1275 | "$P_SRV auth_mode=required" \ |
| 1276 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1277 | 0 |
| 1278 | |
| 1279 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1280 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1281 | requires_config_enabled MBEDTLS_SHA256_C |
| 1282 | run_test "TLS: password protected server key" \ |
| 1283 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1284 | "$P_CLI" \ |
| 1285 | 0 |
| 1286 | |
| 1287 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1288 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1289 | requires_config_enabled MBEDTLS_RSA_C |
| 1290 | requires_config_enabled MBEDTLS_SHA256_C |
| 1291 | run_test "TLS: password protected server key, two certificates" \ |
| 1292 | "$P_SRV \ |
| 1293 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1294 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1295 | "$P_CLI" \ |
| 1296 | 0 |
| 1297 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1298 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1299 | run_test "CA callback on client" \ |
| 1300 | "$P_SRV debug_level=3" \ |
| 1301 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1302 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1303 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1304 | -S "error" \ |
| 1305 | -C "error" |
| 1306 | |
| 1307 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1308 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1309 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1310 | requires_config_enabled MBEDTLS_SHA256_C |
| 1311 | run_test "CA callback on server" \ |
| 1312 | "$P_SRV auth_mode=required" \ |
| 1313 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1314 | key_file=data_files/server5.key" \ |
| 1315 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1316 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1317 | -s "Verifying peer X.509 certificate... ok" \ |
| 1318 | -S "error" \ |
| 1319 | -C "error" |
| 1320 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1321 | # Test using an opaque private key for client authentication |
| 1322 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1323 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1324 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1325 | requires_config_enabled MBEDTLS_SHA256_C |
| 1326 | run_test "Opaque key for client authentication" \ |
| 1327 | "$P_SRV auth_mode=required" \ |
| 1328 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1329 | key_file=data_files/server5.key" \ |
| 1330 | 0 \ |
| 1331 | -c "key type: Opaque" \ |
| 1332 | -s "Verifying peer X.509 certificate... ok" \ |
| 1333 | -S "error" \ |
| 1334 | -C "error" |
| 1335 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1336 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1337 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1338 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1339 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1340 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1341 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1342 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1343 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1344 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1345 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1346 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1347 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1348 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1349 | run_test_psa_force_curve "secp521r1" |
| 1350 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1351 | run_test_psa_force_curve "brainpoolP512r1" |
| 1352 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1353 | run_test_psa_force_curve "secp384r1" |
| 1354 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1355 | run_test_psa_force_curve "brainpoolP384r1" |
| 1356 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1357 | run_test_psa_force_curve "secp256r1" |
| 1358 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1359 | run_test_psa_force_curve "secp256k1" |
| 1360 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1361 | run_test_psa_force_curve "brainpoolP256r1" |
| 1362 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1363 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1364 | ## SECP224K1 is buggy via the PSA API |
| 1365 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1366 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1367 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1368 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1369 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1370 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1371 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1372 | run_test_psa_force_curve "secp192r1" |
| 1373 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1374 | run_test_psa_force_curve "secp192k1" |
| 1375 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1376 | # Test current time in ServerHello |
| 1377 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1378 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1379 | "$P_SRV debug_level=3" \ |
| 1380 | "$P_CLI debug_level=3" \ |
| 1381 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1382 | -f "check_server_hello_time" \ |
| 1383 | -F "check_server_hello_time" |
| 1384 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1385 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1386 | run_test "Unique IV in GCM" \ |
| 1387 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1388 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1389 | 0 \ |
| 1390 | -u "IV used" \ |
| 1391 | -U "IV used" |
| 1392 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1393 | # Tests for certificate verification callback |
| 1394 | run_test "Configuration-specific CRT verification callback" \ |
| 1395 | "$P_SRV debug_level=3" \ |
| 1396 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1397 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1398 | -S "error" \ |
| 1399 | -c "Verify requested for " \ |
| 1400 | -c "Use configuration-specific verification callback" \ |
| 1401 | -C "Use context-specific verification callback" \ |
| 1402 | -C "error" |
| 1403 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1404 | run_test "Context-specific CRT verification callback" \ |
| 1405 | "$P_SRV debug_level=3" \ |
| 1406 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1407 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1408 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1409 | -c "Verify requested for " \ |
| 1410 | -c "Use context-specific verification callback" \ |
| 1411 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1412 | -C "error" |
| 1413 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1414 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1415 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1416 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1417 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1418 | 1 \ |
| 1419 | -c "The certificate is signed with an unacceptable hash" |
| 1420 | |
| 1421 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1422 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1423 | "$P_CLI allow_sha1=1" \ |
| 1424 | 0 |
| 1425 | |
| 1426 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1427 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1428 | "$P_CLI allow_sha1=0" \ |
| 1429 | 0 |
| 1430 | |
| 1431 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1432 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1433 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1434 | 1 \ |
| 1435 | -s "The certificate is signed with an unacceptable hash" |
| 1436 | |
| 1437 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1438 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1439 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1440 | 0 |
| 1441 | |
| 1442 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1443 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1444 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1445 | 0 |
| 1446 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1447 | # Tests for datagram packing |
| 1448 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1449 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1450 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1451 | 0 \ |
| 1452 | -c "next record in same datagram" \ |
| 1453 | -s "next record in same datagram" |
| 1454 | |
| 1455 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1456 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1457 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1458 | 0 \ |
| 1459 | -s "next record in same datagram" \ |
| 1460 | -C "next record in same datagram" |
| 1461 | |
| 1462 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1463 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1464 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1465 | 0 \ |
| 1466 | -S "next record in same datagram" \ |
| 1467 | -c "next record in same datagram" |
| 1468 | |
| 1469 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1470 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1471 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1472 | 0 \ |
| 1473 | -S "next record in same datagram" \ |
| 1474 | -C "next record in same datagram" |
| 1475 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1476 | # Tests for Context serialization |
| 1477 | |
| 1478 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1479 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1480 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1481 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1482 | 0 \ |
| 1483 | -c "Deserializing connection..." \ |
| 1484 | -S "Deserializing connection..." |
| 1485 | |
| 1486 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1487 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1488 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1489 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1490 | 0 \ |
| 1491 | -c "Deserializing connection..." \ |
| 1492 | -S "Deserializing connection..." |
| 1493 | |
| 1494 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1495 | run_test "Context serialization, client serializes, GCM" \ |
| 1496 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1497 | "$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] | 1498 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1499 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1500 | -S "Deserializing connection..." |
| 1501 | |
| 1502 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1503 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1504 | run_test "Context serialization, client serializes, with CID" \ |
| 1505 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1506 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1507 | 0 \ |
| 1508 | -c "Deserializing connection..." \ |
| 1509 | -S "Deserializing connection..." |
| 1510 | |
| 1511 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1512 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1513 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1514 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1515 | 0 \ |
| 1516 | -C "Deserializing connection..." \ |
| 1517 | -s "Deserializing connection..." |
| 1518 | |
| 1519 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1520 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1521 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1522 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1523 | 0 \ |
| 1524 | -C "Deserializing connection..." \ |
| 1525 | -s "Deserializing connection..." |
| 1526 | |
| 1527 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1528 | run_test "Context serialization, server serializes, GCM" \ |
| 1529 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1530 | "$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] | 1531 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1532 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1533 | -s "Deserializing connection..." |
| 1534 | |
| 1535 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1536 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1537 | run_test "Context serialization, server serializes, with CID" \ |
| 1538 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1539 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1540 | 0 \ |
| 1541 | -C "Deserializing connection..." \ |
| 1542 | -s "Deserializing connection..." |
| 1543 | |
| 1544 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1545 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1546 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1547 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1548 | 0 \ |
| 1549 | -c "Deserializing connection..." \ |
| 1550 | -s "Deserializing connection..." |
| 1551 | |
| 1552 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1553 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1554 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1555 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1556 | 0 \ |
| 1557 | -c "Deserializing connection..." \ |
| 1558 | -s "Deserializing connection..." |
| 1559 | |
| 1560 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1561 | run_test "Context serialization, both serialize, GCM" \ |
| 1562 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1563 | "$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] | 1564 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1565 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1566 | -s "Deserializing connection..." |
| 1567 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1568 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1569 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1570 | run_test "Context serialization, both serialize, with CID" \ |
| 1571 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1572 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1573 | 0 \ |
| 1574 | -c "Deserializing connection..." \ |
| 1575 | -s "Deserializing connection..." |
| 1576 | |
| 1577 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1578 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1579 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1580 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1581 | 0 \ |
| 1582 | -c "Deserializing connection..." \ |
| 1583 | -S "Deserializing connection..." |
| 1584 | |
| 1585 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1586 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1587 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1588 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1589 | 0 \ |
| 1590 | -c "Deserializing connection..." \ |
| 1591 | -S "Deserializing connection..." |
| 1592 | |
| 1593 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1594 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1595 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1596 | "$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] | 1597 | 0 \ |
| 1598 | -c "Deserializing connection..." \ |
| 1599 | -S "Deserializing connection..." |
| 1600 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1601 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1602 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1603 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1604 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1605 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1606 | 0 \ |
| 1607 | -c "Deserializing connection..." \ |
| 1608 | -S "Deserializing connection..." |
| 1609 | |
| 1610 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1611 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1612 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1613 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1614 | 0 \ |
| 1615 | -C "Deserializing connection..." \ |
| 1616 | -s "Deserializing connection..." |
| 1617 | |
| 1618 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1619 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1620 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1621 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1622 | 0 \ |
| 1623 | -C "Deserializing connection..." \ |
| 1624 | -s "Deserializing connection..." |
| 1625 | |
| 1626 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1627 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1628 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1629 | "$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] | 1630 | 0 \ |
| 1631 | -C "Deserializing connection..." \ |
| 1632 | -s "Deserializing connection..." |
| 1633 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1634 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1635 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1636 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1637 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1638 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1639 | 0 \ |
| 1640 | -C "Deserializing connection..." \ |
| 1641 | -s "Deserializing connection..." |
| 1642 | |
| 1643 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1644 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1645 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1646 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1647 | 0 \ |
| 1648 | -c "Deserializing connection..." \ |
| 1649 | -s "Deserializing connection..." |
| 1650 | |
| 1651 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1652 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1653 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1654 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1655 | 0 \ |
| 1656 | -c "Deserializing connection..." \ |
| 1657 | -s "Deserializing connection..." |
| 1658 | |
| 1659 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1660 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1661 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1662 | "$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] | 1663 | 0 \ |
| 1664 | -c "Deserializing connection..." \ |
| 1665 | -s "Deserializing connection..." |
| 1666 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1667 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1668 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1669 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1670 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1671 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1672 | 0 \ |
| 1673 | -c "Deserializing connection..." \ |
| 1674 | -s "Deserializing connection..." |
| 1675 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1676 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1677 | run_test "Saving the serialized context to a file" \ |
| 1678 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1679 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1680 | 0 \ |
| 1681 | -s "Save serialized context to a file... ok" \ |
| 1682 | -c "Save serialized context to a file... ok" |
| 1683 | rm -f context_srv.txt |
| 1684 | rm -f context_cli.txt |
| 1685 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1686 | # Tests for DTLS Connection ID extension |
| 1687 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1688 | # So far, the CID API isn't implemented, so we can't |
| 1689 | # grep for output witnessing its use. This needs to be |
| 1690 | # changed once the CID extension is implemented. |
| 1691 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1692 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1693 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1694 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1695 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1696 | 0 \ |
| 1697 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1698 | -s "found CID extension" \ |
| 1699 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1700 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1701 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1702 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1703 | -C "found CID extension" \ |
| 1704 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1705 | -C "Copy CIDs into SSL transform" \ |
| 1706 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1707 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1708 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1709 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1710 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1711 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1712 | 0 \ |
| 1713 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1714 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1715 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1716 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1717 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1718 | -C "found CID extension" \ |
| 1719 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1720 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1721 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1722 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1723 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1724 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1725 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1726 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1727 | 0 \ |
| 1728 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1729 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1730 | -c "client hello, adding CID extension" \ |
| 1731 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1732 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1733 | -s "server hello, adding CID extension" \ |
| 1734 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1735 | -c "Use of CID extension negotiated" \ |
| 1736 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1737 | -c "Copy CIDs into SSL transform" \ |
| 1738 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1739 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1740 | -s "Use of Connection ID has been negotiated" \ |
| 1741 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1742 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1743 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1744 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1745 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1746 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1747 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1748 | 0 \ |
| 1749 | -c "Enable use of CID extension." \ |
| 1750 | -s "Enable use of CID extension." \ |
| 1751 | -c "client hello, adding CID extension" \ |
| 1752 | -s "found CID extension" \ |
| 1753 | -s "Use of CID extension negotiated" \ |
| 1754 | -s "server hello, adding CID extension" \ |
| 1755 | -c "found CID extension" \ |
| 1756 | -c "Use of CID extension negotiated" \ |
| 1757 | -s "Copy CIDs into SSL transform" \ |
| 1758 | -c "Copy CIDs into SSL transform" \ |
| 1759 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1760 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1761 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1762 | -c "Use of Connection ID has been negotiated" \ |
| 1763 | -c "ignoring unexpected CID" \ |
| 1764 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1765 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1766 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1767 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1768 | -p "$P_PXY mtu=800" \ |
| 1769 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1770 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1771 | 0 \ |
| 1772 | -c "Enable use of CID extension." \ |
| 1773 | -s "Enable use of CID extension." \ |
| 1774 | -c "client hello, adding CID extension" \ |
| 1775 | -s "found CID extension" \ |
| 1776 | -s "Use of CID extension negotiated" \ |
| 1777 | -s "server hello, adding CID extension" \ |
| 1778 | -c "found CID extension" \ |
| 1779 | -c "Use of CID extension negotiated" \ |
| 1780 | -s "Copy CIDs into SSL transform" \ |
| 1781 | -c "Copy CIDs into SSL transform" \ |
| 1782 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1783 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1784 | -s "Use of Connection ID has been negotiated" \ |
| 1785 | -c "Use of Connection ID has been negotiated" |
| 1786 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1787 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1788 | 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] | 1789 | -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] | 1790 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1791 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1792 | 0 \ |
| 1793 | -c "Enable use of CID extension." \ |
| 1794 | -s "Enable use of CID extension." \ |
| 1795 | -c "client hello, adding CID extension" \ |
| 1796 | -s "found CID extension" \ |
| 1797 | -s "Use of CID extension negotiated" \ |
| 1798 | -s "server hello, adding CID extension" \ |
| 1799 | -c "found CID extension" \ |
| 1800 | -c "Use of CID extension negotiated" \ |
| 1801 | -s "Copy CIDs into SSL transform" \ |
| 1802 | -c "Copy CIDs into SSL transform" \ |
| 1803 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1804 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1805 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1806 | -c "Use of Connection ID has been negotiated" \ |
| 1807 | -c "ignoring unexpected CID" \ |
| 1808 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1809 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1810 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1811 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1812 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1813 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1814 | 0 \ |
| 1815 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1816 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1817 | -c "client hello, adding CID extension" \ |
| 1818 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1819 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1820 | -s "server hello, adding CID extension" \ |
| 1821 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1822 | -c "Use of CID extension negotiated" \ |
| 1823 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1824 | -c "Copy CIDs into SSL transform" \ |
| 1825 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1826 | -s "Peer CID (length 0 Bytes):" \ |
| 1827 | -s "Use of Connection ID has been negotiated" \ |
| 1828 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1829 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1830 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1831 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1832 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1833 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1834 | 0 \ |
| 1835 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1836 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1837 | -c "client hello, adding CID extension" \ |
| 1838 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1839 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1840 | -s "server hello, adding CID extension" \ |
| 1841 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1842 | -c "Use of CID extension negotiated" \ |
| 1843 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1844 | -c "Copy CIDs into SSL transform" \ |
| 1845 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1846 | -c "Peer CID (length 0 Bytes):" \ |
| 1847 | -s "Use of Connection ID has been negotiated" \ |
| 1848 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1849 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1850 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1851 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1852 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1853 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1854 | 0 \ |
| 1855 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1856 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1857 | -c "client hello, adding CID extension" \ |
| 1858 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1859 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1860 | -s "server hello, adding CID extension" \ |
| 1861 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1862 | -c "Use of CID extension negotiated" \ |
| 1863 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1864 | -c "Copy CIDs into SSL transform" \ |
| 1865 | -S "Use of Connection ID has been negotiated" \ |
| 1866 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1867 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1868 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1869 | 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] | 1870 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1871 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1872 | 0 \ |
| 1873 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1874 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1875 | -c "client hello, adding CID extension" \ |
| 1876 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1877 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1878 | -s "server hello, adding CID extension" \ |
| 1879 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1880 | -c "Use of CID extension negotiated" \ |
| 1881 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1882 | -c "Copy CIDs into SSL transform" \ |
| 1883 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1884 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1885 | -s "Use of Connection ID has been negotiated" \ |
| 1886 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1887 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1888 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1889 | 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] | 1890 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1891 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1892 | 0 \ |
| 1893 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1894 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1895 | -c "client hello, adding CID extension" \ |
| 1896 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1897 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1898 | -s "server hello, adding CID extension" \ |
| 1899 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1900 | -c "Use of CID extension negotiated" \ |
| 1901 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1902 | -c "Copy CIDs into SSL transform" \ |
| 1903 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1904 | -s "Peer CID (length 0 Bytes):" \ |
| 1905 | -s "Use of Connection ID has been negotiated" \ |
| 1906 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1907 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1908 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1909 | 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] | 1910 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1911 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1912 | 0 \ |
| 1913 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1914 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1915 | -c "client hello, adding CID extension" \ |
| 1916 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1917 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1918 | -s "server hello, adding CID extension" \ |
| 1919 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1920 | -c "Use of CID extension negotiated" \ |
| 1921 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1922 | -c "Copy CIDs into SSL transform" \ |
| 1923 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1924 | -c "Peer CID (length 0 Bytes):" \ |
| 1925 | -s "Use of Connection ID has been negotiated" \ |
| 1926 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1927 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1928 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1929 | 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] | 1930 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1931 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1932 | 0 \ |
| 1933 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1934 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1935 | -c "client hello, adding CID extension" \ |
| 1936 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1937 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1938 | -s "server hello, adding CID extension" \ |
| 1939 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1940 | -c "Use of CID extension negotiated" \ |
| 1941 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1942 | -c "Copy CIDs into SSL transform" \ |
| 1943 | -S "Use of Connection ID has been negotiated" \ |
| 1944 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1945 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1946 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1947 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty, AES-128-CBC" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1948 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1949 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1950 | 0 \ |
| 1951 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1952 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1953 | -c "client hello, adding CID extension" \ |
| 1954 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1955 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1956 | -s "server hello, adding CID extension" \ |
| 1957 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1958 | -c "Use of CID extension negotiated" \ |
| 1959 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1960 | -c "Copy CIDs into SSL transform" \ |
| 1961 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1962 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1963 | -s "Use of Connection ID has been negotiated" \ |
| 1964 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1965 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1966 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1967 | 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] | 1968 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1969 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1970 | 0 \ |
| 1971 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1972 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1973 | -c "client hello, adding CID extension" \ |
| 1974 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1975 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1976 | -s "server hello, adding CID extension" \ |
| 1977 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1978 | -c "Use of CID extension negotiated" \ |
| 1979 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1980 | -c "Copy CIDs into SSL transform" \ |
| 1981 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1982 | -s "Peer CID (length 0 Bytes):" \ |
| 1983 | -s "Use of Connection ID has been negotiated" \ |
| 1984 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1985 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1986 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1987 | 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] | 1988 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1989 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 1990 | 0 \ |
| 1991 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1992 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1993 | -c "client hello, adding CID extension" \ |
| 1994 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1995 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1996 | -s "server hello, adding CID extension" \ |
| 1997 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1998 | -c "Use of CID extension negotiated" \ |
| 1999 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2000 | -c "Copy CIDs into SSL transform" \ |
| 2001 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2002 | -c "Peer CID (length 0 Bytes):" \ |
| 2003 | -s "Use of Connection ID has been negotiated" \ |
| 2004 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2005 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2006 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2007 | 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] | 2008 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2009 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2010 | 0 \ |
| 2011 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2012 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2013 | -c "client hello, adding CID extension" \ |
| 2014 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2015 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2016 | -s "server hello, adding CID extension" \ |
| 2017 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2018 | -c "Use of CID extension negotiated" \ |
| 2019 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2020 | -c "Copy CIDs into SSL transform" \ |
| 2021 | -S "Use of Connection ID has been negotiated" \ |
| 2022 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2023 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2024 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2025 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2026 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2027 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2028 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2029 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2030 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2031 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2032 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2033 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2034 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2035 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2036 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2037 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2038 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2039 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2040 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2041 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2042 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2043 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2044 | 0 \ |
| 2045 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2046 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2047 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2048 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2049 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2050 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2051 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2052 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2053 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2054 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2055 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2056 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2057 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2058 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2059 | 0 \ |
| 2060 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2061 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2062 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2063 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2064 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2065 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2066 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2067 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2068 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2069 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2070 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2071 | 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] | 2072 | -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] | 2073 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2074 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead 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): be ef" \ |
| 2081 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2082 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2083 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2084 | -c "ignoring unexpected CID" \ |
| 2085 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2086 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2087 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2088 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2089 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2090 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2091 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2092 | 0 \ |
| 2093 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2094 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2095 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2096 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2097 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2098 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2099 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2100 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2101 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2102 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2103 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2104 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2105 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2106 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2107 | 0 \ |
| 2108 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2109 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2110 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2111 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2112 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2113 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2114 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2115 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2116 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2117 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2118 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2119 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2120 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2121 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2122 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2123 | 0 \ |
| 2124 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2125 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2126 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2127 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2128 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2129 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2130 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2131 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2132 | -c "ignoring unexpected CID" \ |
| 2133 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2134 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2135 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2136 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2137 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2138 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2139 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2140 | 0 \ |
| 2141 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2142 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2143 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2144 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2145 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2146 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2147 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2148 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2149 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2150 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2151 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2152 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2153 | 0 \ |
| 2154 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2155 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2156 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2157 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2158 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2159 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2160 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2161 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2162 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2163 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2164 | -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] | 2165 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2166 | "$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" \ |
| 2167 | 0 \ |
| 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" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2173 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2174 | -c "ignoring unexpected CID" \ |
| 2175 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2176 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2177 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2178 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2179 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +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" \ |
| 2191 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2192 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2193 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2194 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2195 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2196 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2197 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2198 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2199 | 0 \ |
| 2200 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2201 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2202 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2203 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2204 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2205 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2206 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2207 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2208 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2209 | -c "ignoring unexpected CID" \ |
| 2210 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2211 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2212 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2213 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2214 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 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" \ |
| 2226 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2227 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2228 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2229 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2230 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2231 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2232 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2233 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2234 | 0 \ |
| 2235 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2236 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2237 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2238 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2239 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2240 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2241 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2242 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2243 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2244 | -c "ignoring unexpected CID" \ |
| 2245 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2246 | |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2247 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2248 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 2249 | requires_max_content_len 512 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2250 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2251 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2252 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2253 | 0 \ |
| 2254 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2255 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2256 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2257 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2258 | -s "Reallocating in_buf" \ |
| 2259 | -s "Reallocating out_buf" |
| 2260 | |
| 2261 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2262 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 2263 | requires_max_content_len 1024 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2264 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2265 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2266 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2267 | 0 \ |
| 2268 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2269 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2270 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2271 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2272 | -s "Reallocating in_buf" \ |
| 2273 | -s "Reallocating out_buf" |
| 2274 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2275 | # Tests for Encrypt-then-MAC extension |
| 2276 | |
| 2277 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2278 | "$P_SRV debug_level=3 \ |
| 2279 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2280 | "$P_CLI debug_level=3" \ |
| 2281 | 0 \ |
| 2282 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2283 | -s "found encrypt then mac extension" \ |
| 2284 | -s "server hello, adding encrypt then mac extension" \ |
| 2285 | -c "found encrypt_then_mac extension" \ |
| 2286 | -c "using encrypt then mac" \ |
| 2287 | -s "using encrypt then mac" |
| 2288 | |
| 2289 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2290 | "$P_SRV debug_level=3 etm=0 \ |
| 2291 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2292 | "$P_CLI debug_level=3 etm=1" \ |
| 2293 | 0 \ |
| 2294 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2295 | -s "found encrypt then mac extension" \ |
| 2296 | -S "server hello, adding encrypt then mac extension" \ |
| 2297 | -C "found encrypt_then_mac extension" \ |
| 2298 | -C "using encrypt then mac" \ |
| 2299 | -S "using encrypt then mac" |
| 2300 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2301 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2302 | "$P_SRV debug_level=3 etm=1 \ |
| 2303 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2304 | "$P_CLI debug_level=3 etm=1" \ |
| 2305 | 0 \ |
| 2306 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2307 | -s "found encrypt then mac extension" \ |
| 2308 | -S "server hello, adding encrypt then mac extension" \ |
| 2309 | -C "found encrypt_then_mac extension" \ |
| 2310 | -C "using encrypt then mac" \ |
| 2311 | -S "using encrypt then mac" |
| 2312 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2313 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2314 | "$P_SRV debug_level=3 etm=1 \ |
| 2315 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2316 | "$P_CLI debug_level=3 etm=0" \ |
| 2317 | 0 \ |
| 2318 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2319 | -S "found encrypt then mac extension" \ |
| 2320 | -S "server hello, adding encrypt then mac extension" \ |
| 2321 | -C "found encrypt_then_mac extension" \ |
| 2322 | -C "using encrypt then mac" \ |
| 2323 | -S "using encrypt then mac" |
| 2324 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2325 | # Tests for Extended Master Secret extension |
| 2326 | |
| 2327 | run_test "Extended Master Secret: default" \ |
| 2328 | "$P_SRV debug_level=3" \ |
| 2329 | "$P_CLI debug_level=3" \ |
| 2330 | 0 \ |
| 2331 | -c "client hello, adding extended_master_secret extension" \ |
| 2332 | -s "found extended master secret extension" \ |
| 2333 | -s "server hello, adding extended master secret extension" \ |
| 2334 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2335 | -c "session hash for extended master secret" \ |
| 2336 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2337 | |
| 2338 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2339 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2340 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2341 | 0 \ |
| 2342 | -c "client hello, adding extended_master_secret extension" \ |
| 2343 | -s "found extended master secret extension" \ |
| 2344 | -S "server hello, adding extended master secret extension" \ |
| 2345 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2346 | -C "session hash for extended master secret" \ |
| 2347 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2348 | |
| 2349 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2350 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2351 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2352 | 0 \ |
| 2353 | -C "client hello, adding extended_master_secret extension" \ |
| 2354 | -S "found extended master secret extension" \ |
| 2355 | -S "server hello, adding extended master secret extension" \ |
| 2356 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2357 | -C "session hash for extended master secret" \ |
| 2358 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2359 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2360 | # Test sending and receiving empty application data records |
| 2361 | |
| 2362 | run_test "Encrypt then MAC: empty application data record" \ |
| 2363 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2364 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2365 | 0 \ |
| 2366 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2367 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2368 | -c "0 bytes written in 1 fragments" |
| 2369 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2370 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2371 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2372 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2373 | 0 \ |
| 2374 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2375 | -c "0 bytes written in 1 fragments" |
| 2376 | |
| 2377 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2378 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2379 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2380 | 0 \ |
| 2381 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2382 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2383 | -c "0 bytes written in 1 fragments" |
| 2384 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2385 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2386 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2387 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2388 | 0 \ |
| 2389 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2390 | -c "0 bytes written in 1 fragments" |
| 2391 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2392 | # Tests for CBC 1/n-1 record splitting |
| 2393 | |
| 2394 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2395 | "$P_SRV" \ |
| 2396 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2397 | request_size=123 force_version=tls1_2" \ |
| 2398 | 0 \ |
| 2399 | -s "Read from client: 123 bytes read" \ |
| 2400 | -S "Read from client: 1 bytes read" \ |
| 2401 | -S "122 bytes read" |
| 2402 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2403 | # Tests for Session Tickets |
| 2404 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2405 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2406 | "$P_SRV debug_level=3 tickets=1" \ |
| 2407 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2408 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2409 | -c "client hello, adding session ticket extension" \ |
| 2410 | -s "found session ticket extension" \ |
| 2411 | -s "server hello, adding session ticket extension" \ |
| 2412 | -c "found session_ticket extension" \ |
| 2413 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2414 | -S "session successfully restored from cache" \ |
| 2415 | -s "session successfully restored from ticket" \ |
| 2416 | -s "a session has been resumed" \ |
| 2417 | -c "a session has been resumed" |
| 2418 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2419 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2420 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2421 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2422 | 0 \ |
| 2423 | -c "client hello, adding session ticket extension" \ |
| 2424 | -s "found session ticket extension" \ |
| 2425 | -s "server hello, adding session ticket extension" \ |
| 2426 | -c "found session_ticket extension" \ |
| 2427 | -c "parse new session ticket" \ |
| 2428 | -S "session successfully restored from cache" \ |
| 2429 | -s "session successfully restored from ticket" \ |
| 2430 | -s "a session has been resumed" \ |
| 2431 | -c "a session has been resumed" |
| 2432 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2433 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2434 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2435 | "$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] | 2436 | 0 \ |
| 2437 | -c "client hello, adding session ticket extension" \ |
| 2438 | -s "found session ticket extension" \ |
| 2439 | -s "server hello, adding session ticket extension" \ |
| 2440 | -c "found session_ticket extension" \ |
| 2441 | -c "parse new session ticket" \ |
| 2442 | -S "session successfully restored from cache" \ |
| 2443 | -S "session successfully restored from ticket" \ |
| 2444 | -S "a session has been resumed" \ |
| 2445 | -C "a session has been resumed" |
| 2446 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2447 | run_test "Session resume using tickets: session copy" \ |
| 2448 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2449 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2450 | 0 \ |
| 2451 | -c "client hello, adding session ticket extension" \ |
| 2452 | -s "found session ticket extension" \ |
| 2453 | -s "server hello, adding session ticket extension" \ |
| 2454 | -c "found session_ticket extension" \ |
| 2455 | -c "parse new session ticket" \ |
| 2456 | -S "session successfully restored from cache" \ |
| 2457 | -s "session successfully restored from ticket" \ |
| 2458 | -s "a session has been resumed" \ |
| 2459 | -c "a session has been resumed" |
| 2460 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2461 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2462 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2463 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2464 | 0 \ |
| 2465 | -c "client hello, adding session ticket extension" \ |
| 2466 | -c "found session_ticket extension" \ |
| 2467 | -c "parse new session ticket" \ |
| 2468 | -c "a session has been resumed" |
| 2469 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2470 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2471 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2472 | "( $O_CLI -sess_out $SESSION; \ |
| 2473 | $O_CLI -sess_in $SESSION; \ |
| 2474 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2475 | 0 \ |
| 2476 | -s "found session ticket extension" \ |
| 2477 | -s "server hello, adding session ticket extension" \ |
| 2478 | -S "session successfully restored from cache" \ |
| 2479 | -s "session successfully restored from ticket" \ |
| 2480 | -s "a session has been resumed" |
| 2481 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2482 | # Tests for Session Tickets with DTLS |
| 2483 | |
| 2484 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2485 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2486 | "$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] | 2487 | 0 \ |
| 2488 | -c "client hello, adding session ticket extension" \ |
| 2489 | -s "found session ticket extension" \ |
| 2490 | -s "server hello, adding session ticket extension" \ |
| 2491 | -c "found session_ticket extension" \ |
| 2492 | -c "parse new session ticket" \ |
| 2493 | -S "session successfully restored from cache" \ |
| 2494 | -s "session successfully restored from ticket" \ |
| 2495 | -s "a session has been resumed" \ |
| 2496 | -c "a session has been resumed" |
| 2497 | |
| 2498 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2499 | "$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] | 2500 | "$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] | 2501 | 0 \ |
| 2502 | -c "client hello, adding session ticket extension" \ |
| 2503 | -s "found session ticket extension" \ |
| 2504 | -s "server hello, adding session ticket extension" \ |
| 2505 | -c "found session_ticket extension" \ |
| 2506 | -c "parse new session ticket" \ |
| 2507 | -S "session successfully restored from cache" \ |
| 2508 | -s "session successfully restored from ticket" \ |
| 2509 | -s "a session has been resumed" \ |
| 2510 | -c "a session has been resumed" |
| 2511 | |
| 2512 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2513 | "$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] | 2514 | "$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] | 2515 | 0 \ |
| 2516 | -c "client hello, adding session ticket extension" \ |
| 2517 | -s "found session ticket extension" \ |
| 2518 | -s "server hello, adding session ticket extension" \ |
| 2519 | -c "found session_ticket extension" \ |
| 2520 | -c "parse new session ticket" \ |
| 2521 | -S "session successfully restored from cache" \ |
| 2522 | -S "session successfully restored from ticket" \ |
| 2523 | -S "a session has been resumed" \ |
| 2524 | -C "a session has been resumed" |
| 2525 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2526 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2527 | "$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] | 2528 | "$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] | 2529 | 0 \ |
| 2530 | -c "client hello, adding session ticket extension" \ |
| 2531 | -s "found session ticket extension" \ |
| 2532 | -s "server hello, adding session ticket extension" \ |
| 2533 | -c "found session_ticket extension" \ |
| 2534 | -c "parse new session ticket" \ |
| 2535 | -S "session successfully restored from cache" \ |
| 2536 | -s "session successfully restored from ticket" \ |
| 2537 | -s "a session has been resumed" \ |
| 2538 | -c "a session has been resumed" |
| 2539 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2540 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2541 | "$O_SRV -dtls" \ |
| 2542 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2543 | 0 \ |
| 2544 | -c "client hello, adding session ticket extension" \ |
| 2545 | -c "found session_ticket extension" \ |
| 2546 | -c "parse new session ticket" \ |
| 2547 | -c "a session has been resumed" |
| 2548 | |
| 2549 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2550 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2551 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2552 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2553 | rm -f $SESSION )" \ |
| 2554 | 0 \ |
| 2555 | -s "found session ticket extension" \ |
| 2556 | -s "server hello, adding session ticket extension" \ |
| 2557 | -S "session successfully restored from cache" \ |
| 2558 | -s "session successfully restored from ticket" \ |
| 2559 | -s "a session has been resumed" |
| 2560 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2561 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2562 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2563 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2564 | "$P_SRV debug_level=3 tickets=0" \ |
| 2565 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2566 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2567 | -c "client hello, adding session ticket extension" \ |
| 2568 | -s "found session ticket extension" \ |
| 2569 | -S "server hello, adding session ticket extension" \ |
| 2570 | -C "found session_ticket extension" \ |
| 2571 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2572 | -s "session successfully restored from cache" \ |
| 2573 | -S "session successfully restored from ticket" \ |
| 2574 | -s "a session has been resumed" \ |
| 2575 | -c "a session has been resumed" |
| 2576 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2577 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2578 | "$P_SRV debug_level=3 tickets=1" \ |
| 2579 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2580 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2581 | -C "client hello, adding session ticket extension" \ |
| 2582 | -S "found session ticket extension" \ |
| 2583 | -S "server hello, adding session ticket extension" \ |
| 2584 | -C "found session_ticket extension" \ |
| 2585 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2586 | -s "session successfully restored from cache" \ |
| 2587 | -S "session successfully restored from ticket" \ |
| 2588 | -s "a session has been resumed" \ |
| 2589 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2590 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2591 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2592 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2593 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2594 | 0 \ |
| 2595 | -S "session successfully restored from cache" \ |
| 2596 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2597 | -S "a session has been resumed" \ |
| 2598 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2599 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2600 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2601 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2602 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2603 | 0 \ |
| 2604 | -s "session successfully restored from cache" \ |
| 2605 | -S "session successfully restored from ticket" \ |
| 2606 | -s "a session has been resumed" \ |
| 2607 | -c "a session has been resumed" |
| 2608 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2609 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2610 | "$P_SRV debug_level=3 tickets=0" \ |
| 2611 | "$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] | 2612 | 0 \ |
| 2613 | -s "session successfully restored from cache" \ |
| 2614 | -S "session successfully restored from ticket" \ |
| 2615 | -s "a session has been resumed" \ |
| 2616 | -c "a session has been resumed" |
| 2617 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2618 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2619 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2620 | "$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] | 2621 | 0 \ |
| 2622 | -S "session successfully restored from cache" \ |
| 2623 | -S "session successfully restored from ticket" \ |
| 2624 | -S "a session has been resumed" \ |
| 2625 | -C "a session has been resumed" |
| 2626 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2627 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2628 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2629 | "$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] | 2630 | 0 \ |
| 2631 | -s "session successfully restored from cache" \ |
| 2632 | -S "session successfully restored from ticket" \ |
| 2633 | -s "a session has been resumed" \ |
| 2634 | -c "a session has been resumed" |
| 2635 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2636 | run_test "Session resume using cache: session copy" \ |
| 2637 | "$P_SRV debug_level=3 tickets=0" \ |
| 2638 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2639 | 0 \ |
| 2640 | -s "session successfully restored from cache" \ |
| 2641 | -S "session successfully restored from ticket" \ |
| 2642 | -s "a session has been resumed" \ |
| 2643 | -c "a session has been resumed" |
| 2644 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2645 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2646 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2647 | "( $O_CLI -sess_out $SESSION; \ |
| 2648 | $O_CLI -sess_in $SESSION; \ |
| 2649 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2650 | 0 \ |
| 2651 | -s "found session ticket extension" \ |
| 2652 | -S "server hello, adding session ticket extension" \ |
| 2653 | -s "session successfully restored from cache" \ |
| 2654 | -S "session successfully restored from ticket" \ |
| 2655 | -s "a session has been resumed" |
| 2656 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2657 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2658 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2659 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2660 | 0 \ |
| 2661 | -C "found session_ticket extension" \ |
| 2662 | -C "parse new session ticket" \ |
| 2663 | -c "a session has been resumed" |
| 2664 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2665 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2666 | |
| 2667 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2668 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2669 | "$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] | 2670 | 0 \ |
| 2671 | -c "client hello, adding session ticket extension" \ |
| 2672 | -s "found session ticket extension" \ |
| 2673 | -S "server hello, adding session ticket extension" \ |
| 2674 | -C "found session_ticket extension" \ |
| 2675 | -C "parse new session ticket" \ |
| 2676 | -s "session successfully restored from cache" \ |
| 2677 | -S "session successfully restored from ticket" \ |
| 2678 | -s "a session has been resumed" \ |
| 2679 | -c "a session has been resumed" |
| 2680 | |
| 2681 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2682 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2683 | "$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] | 2684 | 0 \ |
| 2685 | -C "client hello, adding session ticket extension" \ |
| 2686 | -S "found session ticket extension" \ |
| 2687 | -S "server hello, adding session ticket extension" \ |
| 2688 | -C "found session_ticket extension" \ |
| 2689 | -C "parse new session ticket" \ |
| 2690 | -s "session successfully restored from cache" \ |
| 2691 | -S "session successfully restored from ticket" \ |
| 2692 | -s "a session has been resumed" \ |
| 2693 | -c "a session has been resumed" |
| 2694 | |
| 2695 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2696 | "$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] | 2697 | "$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] | 2698 | 0 \ |
| 2699 | -S "session successfully restored from cache" \ |
| 2700 | -S "session successfully restored from ticket" \ |
| 2701 | -S "a session has been resumed" \ |
| 2702 | -C "a session has been resumed" |
| 2703 | |
| 2704 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2705 | "$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] | 2706 | "$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] | 2707 | 0 \ |
| 2708 | -s "session successfully restored from cache" \ |
| 2709 | -S "session successfully restored from ticket" \ |
| 2710 | -s "a session has been resumed" \ |
| 2711 | -c "a session has been resumed" |
| 2712 | |
| 2713 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2714 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2715 | "$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] | 2716 | 0 \ |
| 2717 | -s "session successfully restored from cache" \ |
| 2718 | -S "session successfully restored from ticket" \ |
| 2719 | -s "a session has been resumed" \ |
| 2720 | -c "a session has been resumed" |
| 2721 | |
| 2722 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2723 | "$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] | 2724 | "$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] | 2725 | 0 \ |
| 2726 | -S "session successfully restored from cache" \ |
| 2727 | -S "session successfully restored from ticket" \ |
| 2728 | -S "a session has been resumed" \ |
| 2729 | -C "a session has been resumed" |
| 2730 | |
| 2731 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2732 | "$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] | 2733 | "$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] | 2734 | 0 \ |
| 2735 | -s "session successfully restored from cache" \ |
| 2736 | -S "session successfully restored from ticket" \ |
| 2737 | -s "a session has been resumed" \ |
| 2738 | -c "a session has been resumed" |
| 2739 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2740 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2741 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2742 | "$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] | 2743 | 0 \ |
| 2744 | -s "session successfully restored from cache" \ |
| 2745 | -S "session successfully restored from ticket" \ |
| 2746 | -s "a session has been resumed" \ |
| 2747 | -c "a session has been resumed" |
| 2748 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2749 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2750 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2751 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2752 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2753 | rm -f $SESSION )" \ |
| 2754 | 0 \ |
| 2755 | -s "found session ticket extension" \ |
| 2756 | -S "server hello, adding session ticket extension" \ |
| 2757 | -s "session successfully restored from cache" \ |
| 2758 | -S "session successfully restored from ticket" \ |
| 2759 | -s "a session has been resumed" |
| 2760 | |
| 2761 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2762 | "$O_SRV -dtls" \ |
| 2763 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2764 | 0 \ |
| 2765 | -C "found session_ticket extension" \ |
| 2766 | -C "parse new session ticket" \ |
| 2767 | -c "a session has been resumed" |
| 2768 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2769 | # Tests for Max Fragment Length extension |
| 2770 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2771 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2772 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2773 | "$P_SRV debug_level=3" \ |
| 2774 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2775 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2776 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2777 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2778 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2779 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2780 | -C "client hello, adding max_fragment_length extension" \ |
| 2781 | -S "found max fragment length extension" \ |
| 2782 | -S "server hello, max_fragment_length extension" \ |
| 2783 | -C "found max_fragment_length extension" |
| 2784 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2785 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2786 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2787 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2788 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2789 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2790 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2791 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2792 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2793 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2794 | -C "client hello, adding max_fragment_length extension" \ |
| 2795 | -S "found max fragment length extension" \ |
| 2796 | -S "server hello, max_fragment_length extension" \ |
| 2797 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2798 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2799 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2800 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2801 | |
| 2802 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2803 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2804 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2805 | "$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] | 2806 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2807 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2808 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2809 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2810 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2811 | -C "client hello, adding max_fragment_length extension" \ |
| 2812 | -S "found max fragment length extension" \ |
| 2813 | -S "server hello, max_fragment_length extension" \ |
| 2814 | -C "found max_fragment_length extension" \ |
| 2815 | -c "fragment larger than.*maximum " |
| 2816 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2817 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2818 | # (session fragment length will be 16384 regardless of mbedtls |
| 2819 | # content length configuration.) |
| 2820 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2821 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2822 | run_test "Max fragment length: disabled, larger message" \ |
| 2823 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2824 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2825 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2826 | -C "Maximum incoming record payload length is 16384" \ |
| 2827 | -C "Maximum outgoing record payload length is 16384" \ |
| 2828 | -S "Maximum incoming record payload length is 16384" \ |
| 2829 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2830 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2831 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2832 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2833 | |
| 2834 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2835 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2836 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2837 | "$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] | 2838 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2839 | -C "Maximum incoming record payload length is 16384" \ |
| 2840 | -C "Maximum outgoing record payload length is 16384" \ |
| 2841 | -S "Maximum incoming record payload length is 16384" \ |
| 2842 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2843 | -c "fragment larger than.*maximum " |
| 2844 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2845 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2846 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2847 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2848 | "$P_SRV debug_level=3" \ |
| 2849 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2850 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2851 | -c "Maximum incoming record payload length is 4096" \ |
| 2852 | -c "Maximum outgoing record payload length is 4096" \ |
| 2853 | -s "Maximum incoming record payload length is 4096" \ |
| 2854 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2855 | -c "client hello, adding max_fragment_length extension" \ |
| 2856 | -s "found max fragment length extension" \ |
| 2857 | -s "server hello, max_fragment_length extension" \ |
| 2858 | -c "found max_fragment_length extension" |
| 2859 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2860 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2861 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2862 | run_test "Max fragment length: client 512, server 1024" \ |
| 2863 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 2864 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2865 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2866 | -c "Maximum incoming record payload length is 512" \ |
| 2867 | -c "Maximum outgoing record payload length is 512" \ |
| 2868 | -s "Maximum incoming record payload length is 512" \ |
| 2869 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2870 | -c "client hello, adding max_fragment_length extension" \ |
| 2871 | -s "found max fragment length extension" \ |
| 2872 | -s "server hello, max_fragment_length extension" \ |
| 2873 | -c "found max_fragment_length extension" |
| 2874 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2875 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2876 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2877 | run_test "Max fragment length: client 512, server 2048" \ |
| 2878 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 2879 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2880 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2881 | -c "Maximum incoming record payload length is 512" \ |
| 2882 | -c "Maximum outgoing record payload length is 512" \ |
| 2883 | -s "Maximum incoming record payload length is 512" \ |
| 2884 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2885 | -c "client hello, adding max_fragment_length extension" \ |
| 2886 | -s "found max fragment length extension" \ |
| 2887 | -s "server hello, max_fragment_length extension" \ |
| 2888 | -c "found max_fragment_length extension" |
| 2889 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2890 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2891 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2892 | run_test "Max fragment length: client 512, server 4096" \ |
| 2893 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2894 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 2895 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2896 | -c "Maximum incoming record payload length is 512" \ |
| 2897 | -c "Maximum outgoing record payload length is 512" \ |
| 2898 | -s "Maximum incoming record payload length is 512" \ |
| 2899 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2900 | -c "client hello, adding max_fragment_length extension" \ |
| 2901 | -s "found max fragment length extension" \ |
| 2902 | -s "server hello, max_fragment_length extension" \ |
| 2903 | -c "found max_fragment_length extension" |
| 2904 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2905 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2906 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2907 | run_test "Max fragment length: client 1024, server 512" \ |
| 2908 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 2909 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2910 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2911 | -c "Maximum incoming record payload length is 1024" \ |
| 2912 | -c "Maximum outgoing record payload length is 1024" \ |
| 2913 | -s "Maximum incoming record payload length is 1024" \ |
| 2914 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2915 | -c "client hello, adding max_fragment_length extension" \ |
| 2916 | -s "found max fragment length extension" \ |
| 2917 | -s "server hello, max_fragment_length extension" \ |
| 2918 | -c "found max_fragment_length extension" |
| 2919 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2920 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2921 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2922 | run_test "Max fragment length: client 1024, server 2048" \ |
| 2923 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 2924 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2925 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2926 | -c "Maximum incoming record payload length is 1024" \ |
| 2927 | -c "Maximum outgoing record payload length is 1024" \ |
| 2928 | -s "Maximum incoming record payload length is 1024" \ |
| 2929 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2930 | -c "client hello, adding max_fragment_length extension" \ |
| 2931 | -s "found max fragment length extension" \ |
| 2932 | -s "server hello, max_fragment_length extension" \ |
| 2933 | -c "found max_fragment_length extension" |
| 2934 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2935 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2936 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2937 | run_test "Max fragment length: client 1024, server 4096" \ |
| 2938 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2939 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 2940 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2941 | -c "Maximum incoming record payload length is 1024" \ |
| 2942 | -c "Maximum outgoing record payload length is 1024" \ |
| 2943 | -s "Maximum incoming record payload length is 1024" \ |
| 2944 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2945 | -c "client hello, adding max_fragment_length extension" \ |
| 2946 | -s "found max fragment length extension" \ |
| 2947 | -s "server hello, max_fragment_length extension" \ |
| 2948 | -c "found max_fragment_length extension" |
| 2949 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2950 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2951 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2952 | run_test "Max fragment length: client 2048, server 512" \ |
| 2953 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 2954 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 2955 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2956 | -c "Maximum incoming record payload length is 2048" \ |
| 2957 | -c "Maximum outgoing record payload length is 2048" \ |
| 2958 | -s "Maximum incoming record payload length is 2048" \ |
| 2959 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2960 | -c "client hello, adding max_fragment_length extension" \ |
| 2961 | -s "found max fragment length extension" \ |
| 2962 | -s "server hello, max_fragment_length extension" \ |
| 2963 | -c "found max_fragment_length extension" |
| 2964 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2965 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2966 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2967 | run_test "Max fragment length: client 2048, server 1024" \ |
| 2968 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 2969 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 2970 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2971 | -c "Maximum incoming record payload length is 2048" \ |
| 2972 | -c "Maximum outgoing record payload length is 2048" \ |
| 2973 | -s "Maximum incoming record payload length is 2048" \ |
| 2974 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2975 | -c "client hello, adding max_fragment_length extension" \ |
| 2976 | -s "found max fragment length extension" \ |
| 2977 | -s "server hello, max_fragment_length extension" \ |
| 2978 | -c "found max_fragment_length extension" |
| 2979 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2980 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2981 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2982 | run_test "Max fragment length: client 2048, server 4096" \ |
| 2983 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 2984 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 2985 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2986 | -c "Maximum incoming record payload length is 2048" \ |
| 2987 | -c "Maximum outgoing record payload length is 2048" \ |
| 2988 | -s "Maximum incoming record payload length is 2048" \ |
| 2989 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2990 | -c "client hello, adding max_fragment_length extension" \ |
| 2991 | -s "found max fragment length extension" \ |
| 2992 | -s "server hello, max_fragment_length extension" \ |
| 2993 | -c "found max_fragment_length extension" |
| 2994 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2995 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 2996 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2997 | run_test "Max fragment length: client 4096, server 512" \ |
| 2998 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 2999 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3000 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3001 | -c "Maximum incoming record payload length is 4096" \ |
| 3002 | -c "Maximum outgoing record payload length is 4096" \ |
| 3003 | -s "Maximum incoming record payload length is 4096" \ |
| 3004 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3005 | -c "client hello, adding max_fragment_length extension" \ |
| 3006 | -s "found max fragment length extension" \ |
| 3007 | -s "server hello, max_fragment_length extension" \ |
| 3008 | -c "found max_fragment_length extension" |
| 3009 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3010 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3011 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3012 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3013 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3014 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3015 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3016 | -c "Maximum incoming record payload length is 4096" \ |
| 3017 | -c "Maximum outgoing record payload length is 4096" \ |
| 3018 | -s "Maximum incoming record payload length is 4096" \ |
| 3019 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3020 | -c "client hello, adding max_fragment_length extension" \ |
| 3021 | -s "found max fragment length extension" \ |
| 3022 | -s "server hello, max_fragment_length extension" \ |
| 3023 | -c "found max_fragment_length extension" |
| 3024 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3025 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3026 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3027 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3028 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3029 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3030 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3031 | -c "Maximum incoming record payload length is 4096" \ |
| 3032 | -c "Maximum outgoing record payload length is 4096" \ |
| 3033 | -s "Maximum incoming record payload length is 4096" \ |
| 3034 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3035 | -c "client hello, adding max_fragment_length extension" \ |
| 3036 | -s "found max fragment length extension" \ |
| 3037 | -s "server hello, max_fragment_length extension" \ |
| 3038 | -c "found max_fragment_length extension" |
| 3039 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3040 | requires_max_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 | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3055 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3056 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3057 | requires_gnutls |
| 3058 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3059 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3060 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3061 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3062 | -c "Maximum incoming record payload length is 4096" \ |
| 3063 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3064 | -c "client hello, adding max_fragment_length extension" \ |
| 3065 | -c "found max_fragment_length extension" |
| 3066 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3067 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3068 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3069 | run_test "Max fragment length: client, message just fits" \ |
| 3070 | "$P_SRV debug_level=3" \ |
| 3071 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3072 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3073 | -c "Maximum incoming record payload length is 2048" \ |
| 3074 | -c "Maximum outgoing record payload length is 2048" \ |
| 3075 | -s "Maximum incoming record payload length is 2048" \ |
| 3076 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3077 | -c "client hello, adding max_fragment_length extension" \ |
| 3078 | -s "found max fragment length extension" \ |
| 3079 | -s "server hello, max_fragment_length extension" \ |
| 3080 | -c "found max_fragment_length extension" \ |
| 3081 | -c "2048 bytes written in 1 fragments" \ |
| 3082 | -s "2048 bytes read" |
| 3083 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3084 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3085 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3086 | run_test "Max fragment length: client, larger message" \ |
| 3087 | "$P_SRV debug_level=3" \ |
| 3088 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3089 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3090 | -c "Maximum incoming record payload length is 2048" \ |
| 3091 | -c "Maximum outgoing record payload length is 2048" \ |
| 3092 | -s "Maximum incoming record payload length is 2048" \ |
| 3093 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3094 | -c "client hello, adding max_fragment_length extension" \ |
| 3095 | -s "found max fragment length extension" \ |
| 3096 | -s "server hello, max_fragment_length extension" \ |
| 3097 | -c "found max_fragment_length extension" \ |
| 3098 | -c "2345 bytes written in 2 fragments" \ |
| 3099 | -s "2048 bytes read" \ |
| 3100 | -s "297 bytes read" |
| 3101 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3102 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3103 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3104 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3105 | "$P_SRV debug_level=3 dtls=1" \ |
| 3106 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3107 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3108 | -c "Maximum incoming record payload length is 2048" \ |
| 3109 | -c "Maximum outgoing record payload length is 2048" \ |
| 3110 | -s "Maximum incoming record payload length is 2048" \ |
| 3111 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3112 | -c "client hello, adding max_fragment_length extension" \ |
| 3113 | -s "found max fragment length extension" \ |
| 3114 | -s "server hello, max_fragment_length extension" \ |
| 3115 | -c "found max_fragment_length extension" \ |
| 3116 | -c "fragment larger than.*maximum" |
| 3117 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3118 | # Tests for renegotiation |
| 3119 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3120 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3121 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3122 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3123 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3124 | 0 \ |
| 3125 | -C "client hello, adding renegotiation extension" \ |
| 3126 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3127 | -S "found renegotiation extension" \ |
| 3128 | -s "server hello, secure renegotiation extension" \ |
| 3129 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3130 | -C "=> renegotiate" \ |
| 3131 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3132 | -S "write hello request" |
| 3133 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3134 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3135 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3136 | "$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] | 3137 | "$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] | 3138 | 0 \ |
| 3139 | -c "client hello, adding renegotiation extension" \ |
| 3140 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3141 | -s "found renegotiation extension" \ |
| 3142 | -s "server hello, secure renegotiation extension" \ |
| 3143 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3144 | -c "=> renegotiate" \ |
| 3145 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3146 | -S "write hello request" |
| 3147 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3148 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3149 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3150 | "$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] | 3151 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3152 | 0 \ |
| 3153 | -c "client hello, adding renegotiation extension" \ |
| 3154 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3155 | -s "found renegotiation extension" \ |
| 3156 | -s "server hello, secure renegotiation extension" \ |
| 3157 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3158 | -c "=> renegotiate" \ |
| 3159 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3160 | -s "write hello request" |
| 3161 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3162 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3163 | # 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] | 3164 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3165 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3166 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3167 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3168 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3169 | 0 \ |
| 3170 | -c "client hello, adding renegotiation extension" \ |
| 3171 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3172 | -s "found renegotiation extension" \ |
| 3173 | -s "server hello, secure renegotiation extension" \ |
| 3174 | -c "found renegotiation extension" \ |
| 3175 | -c "=> renegotiate" \ |
| 3176 | -s "=> renegotiate" \ |
| 3177 | -S "write hello request" \ |
| 3178 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3179 | |
| 3180 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3181 | # 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] | 3182 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3183 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3184 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3185 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3186 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3187 | 0 \ |
| 3188 | -c "client hello, adding renegotiation extension" \ |
| 3189 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3190 | -s "found renegotiation extension" \ |
| 3191 | -s "server hello, secure renegotiation extension" \ |
| 3192 | -c "found renegotiation extension" \ |
| 3193 | -c "=> renegotiate" \ |
| 3194 | -s "=> renegotiate" \ |
| 3195 | -s "write hello request" \ |
| 3196 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3197 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3198 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3199 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3200 | "$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] | 3201 | "$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] | 3202 | 0 \ |
| 3203 | -c "client hello, adding renegotiation extension" \ |
| 3204 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3205 | -s "found renegotiation extension" \ |
| 3206 | -s "server hello, secure renegotiation extension" \ |
| 3207 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3208 | -c "=> renegotiate" \ |
| 3209 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3210 | -s "write hello request" |
| 3211 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3212 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3213 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3214 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3215 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3216 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3217 | "$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" \ |
| 3218 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3219 | -c "Maximum incoming record payload length is 2048" \ |
| 3220 | -c "Maximum outgoing record payload length is 2048" \ |
| 3221 | -s "Maximum incoming record payload length is 2048" \ |
| 3222 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3223 | -c "client hello, adding max_fragment_length extension" \ |
| 3224 | -s "found max fragment length extension" \ |
| 3225 | -s "server hello, max_fragment_length extension" \ |
| 3226 | -c "found max_fragment_length extension" \ |
| 3227 | -c "client hello, adding renegotiation extension" \ |
| 3228 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3229 | -s "found renegotiation extension" \ |
| 3230 | -s "server hello, secure renegotiation extension" \ |
| 3231 | -c "found renegotiation extension" \ |
| 3232 | -c "=> renegotiate" \ |
| 3233 | -s "=> renegotiate" \ |
| 3234 | -s "write hello request" |
| 3235 | |
| 3236 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3237 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3238 | "$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] | 3239 | "$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] | 3240 | 1 \ |
| 3241 | -c "client hello, adding renegotiation extension" \ |
| 3242 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3243 | -S "found renegotiation extension" \ |
| 3244 | -s "server hello, secure renegotiation extension" \ |
| 3245 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3246 | -c "=> renegotiate" \ |
| 3247 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3248 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3249 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3250 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3251 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3252 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3253 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3254 | "$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] | 3255 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3256 | 0 \ |
| 3257 | -C "client hello, adding renegotiation extension" \ |
| 3258 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3259 | -S "found renegotiation extension" \ |
| 3260 | -s "server hello, secure renegotiation extension" \ |
| 3261 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3262 | -C "=> renegotiate" \ |
| 3263 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3264 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3265 | -S "SSL - An unexpected message was received from our peer" \ |
| 3266 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3267 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3268 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3269 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3270 | "$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] | 3271 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3272 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3273 | 0 \ |
| 3274 | -C "client hello, adding renegotiation extension" \ |
| 3275 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3276 | -S "found renegotiation extension" \ |
| 3277 | -s "server hello, secure renegotiation extension" \ |
| 3278 | -c "found renegotiation extension" \ |
| 3279 | -C "=> renegotiate" \ |
| 3280 | -S "=> renegotiate" \ |
| 3281 | -s "write hello request" \ |
| 3282 | -S "SSL - An unexpected message was received from our peer" \ |
| 3283 | -S "failed" |
| 3284 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3285 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3286 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3287 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3288 | "$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] | 3289 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3290 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3291 | 0 \ |
| 3292 | -C "client hello, adding renegotiation extension" \ |
| 3293 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3294 | -S "found renegotiation extension" \ |
| 3295 | -s "server hello, secure renegotiation extension" \ |
| 3296 | -c "found renegotiation extension" \ |
| 3297 | -C "=> renegotiate" \ |
| 3298 | -S "=> renegotiate" \ |
| 3299 | -s "write hello request" \ |
| 3300 | -S "SSL - An unexpected message was received from our peer" \ |
| 3301 | -S "failed" |
| 3302 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3303 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3304 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3305 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 renegotiate=1 \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3306 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3307 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3308 | 0 \ |
| 3309 | -C "client hello, adding renegotiation extension" \ |
| 3310 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3311 | -S "found renegotiation extension" \ |
| 3312 | -s "server hello, secure renegotiation extension" \ |
| 3313 | -c "found renegotiation extension" \ |
| 3314 | -C "=> renegotiate" \ |
| 3315 | -S "=> renegotiate" \ |
| 3316 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3317 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3318 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3319 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3320 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3321 | "$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] | 3322 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3323 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3324 | 0 \ |
| 3325 | -c "client hello, adding renegotiation extension" \ |
| 3326 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3327 | -s "found renegotiation extension" \ |
| 3328 | -s "server hello, secure renegotiation extension" \ |
| 3329 | -c "found renegotiation extension" \ |
| 3330 | -c "=> renegotiate" \ |
| 3331 | -s "=> renegotiate" \ |
| 3332 | -s "write hello request" \ |
| 3333 | -S "SSL - An unexpected message was received from our peer" \ |
| 3334 | -S "failed" |
| 3335 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3336 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3337 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3338 | "$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] | 3339 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3340 | 0 \ |
| 3341 | -C "client hello, adding renegotiation extension" \ |
| 3342 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3343 | -S "found renegotiation extension" \ |
| 3344 | -s "server hello, secure renegotiation extension" \ |
| 3345 | -c "found renegotiation extension" \ |
| 3346 | -S "record counter limit reached: renegotiate" \ |
| 3347 | -C "=> renegotiate" \ |
| 3348 | -S "=> renegotiate" \ |
| 3349 | -S "write hello request" \ |
| 3350 | -S "SSL - An unexpected message was received from our peer" \ |
| 3351 | -S "failed" |
| 3352 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3353 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3354 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3355 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3356 | "$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] | 3357 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3358 | 0 \ |
| 3359 | -c "client hello, adding renegotiation extension" \ |
| 3360 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3361 | -s "found renegotiation extension" \ |
| 3362 | -s "server hello, secure renegotiation extension" \ |
| 3363 | -c "found renegotiation extension" \ |
| 3364 | -s "record counter limit reached: renegotiate" \ |
| 3365 | -c "=> renegotiate" \ |
| 3366 | -s "=> renegotiate" \ |
| 3367 | -s "write hello request" \ |
| 3368 | -S "SSL - An unexpected message was received from our peer" \ |
| 3369 | -S "failed" |
| 3370 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3371 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3372 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3373 | "$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] | 3374 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3375 | 0 \ |
| 3376 | -c "client hello, adding renegotiation extension" \ |
| 3377 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3378 | -s "found renegotiation extension" \ |
| 3379 | -s "server hello, secure renegotiation extension" \ |
| 3380 | -c "found renegotiation extension" \ |
| 3381 | -s "record counter limit reached: renegotiate" \ |
| 3382 | -c "=> renegotiate" \ |
| 3383 | -s "=> renegotiate" \ |
| 3384 | -s "write hello request" \ |
| 3385 | -S "SSL - An unexpected message was received from our peer" \ |
| 3386 | -S "failed" |
| 3387 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3388 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3389 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3390 | "$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] | 3391 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3392 | 0 \ |
| 3393 | -C "client hello, adding renegotiation extension" \ |
| 3394 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3395 | -S "found renegotiation extension" \ |
| 3396 | -s "server hello, secure renegotiation extension" \ |
| 3397 | -c "found renegotiation extension" \ |
| 3398 | -S "record counter limit reached: renegotiate" \ |
| 3399 | -C "=> renegotiate" \ |
| 3400 | -S "=> renegotiate" \ |
| 3401 | -S "write hello request" \ |
| 3402 | -S "SSL - An unexpected message was received from our peer" \ |
| 3403 | -S "failed" |
| 3404 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3405 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3406 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3407 | "$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] | 3408 | "$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] | 3409 | 0 \ |
| 3410 | -c "client hello, adding renegotiation extension" \ |
| 3411 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3412 | -s "found renegotiation extension" \ |
| 3413 | -s "server hello, secure renegotiation extension" \ |
| 3414 | -c "found renegotiation extension" \ |
| 3415 | -c "=> renegotiate" \ |
| 3416 | -s "=> renegotiate" \ |
| 3417 | -S "write hello request" |
| 3418 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3419 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3420 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3421 | "$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] | 3422 | "$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] | 3423 | 0 \ |
| 3424 | -c "client hello, adding renegotiation extension" \ |
| 3425 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3426 | -s "found renegotiation extension" \ |
| 3427 | -s "server hello, secure renegotiation extension" \ |
| 3428 | -c "found renegotiation extension" \ |
| 3429 | -c "=> renegotiate" \ |
| 3430 | -s "=> renegotiate" \ |
| 3431 | -s "write hello request" |
| 3432 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3433 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3434 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3435 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3436 | "$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] | 3437 | 0 \ |
| 3438 | -c "client hello, adding renegotiation extension" \ |
| 3439 | -c "found renegotiation extension" \ |
| 3440 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3441 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3442 | -C "error" \ |
| 3443 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3444 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3445 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3446 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3447 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3448 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3449 | "$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] | 3450 | 0 \ |
| 3451 | -c "client hello, adding renegotiation extension" \ |
| 3452 | -c "found renegotiation extension" \ |
| 3453 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3454 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3455 | -C "error" \ |
| 3456 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3457 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3458 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3459 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3460 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3461 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3462 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3463 | 1 \ |
| 3464 | -c "client hello, adding renegotiation extension" \ |
| 3465 | -C "found renegotiation extension" \ |
| 3466 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3467 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3468 | -c "error" \ |
| 3469 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3470 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3471 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3472 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3473 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3474 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3475 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3476 | allow_legacy=0" \ |
| 3477 | 1 \ |
| 3478 | -c "client hello, adding renegotiation extension" \ |
| 3479 | -C "found renegotiation extension" \ |
| 3480 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3481 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3482 | -c "error" \ |
| 3483 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3484 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3485 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3486 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3487 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3488 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3489 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3490 | allow_legacy=1" \ |
| 3491 | 0 \ |
| 3492 | -c "client hello, adding renegotiation extension" \ |
| 3493 | -C "found renegotiation extension" \ |
| 3494 | -c "=> renegotiate" \ |
| 3495 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3496 | -C "error" \ |
| 3497 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3498 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3499 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3500 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3501 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3502 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3503 | 0 \ |
| 3504 | -c "client hello, adding renegotiation extension" \ |
| 3505 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3506 | -s "found renegotiation extension" \ |
| 3507 | -s "server hello, secure renegotiation extension" \ |
| 3508 | -c "found renegotiation extension" \ |
| 3509 | -c "=> renegotiate" \ |
| 3510 | -s "=> renegotiate" \ |
| 3511 | -S "write hello request" |
| 3512 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3513 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3514 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3515 | "$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] | 3516 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3517 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3518 | 0 \ |
| 3519 | -c "client hello, adding renegotiation extension" \ |
| 3520 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3521 | -s "found renegotiation extension" \ |
| 3522 | -s "server hello, secure renegotiation extension" \ |
| 3523 | -c "found renegotiation extension" \ |
| 3524 | -c "=> renegotiate" \ |
| 3525 | -s "=> renegotiate" \ |
| 3526 | -s "write hello request" |
| 3527 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3528 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3529 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3530 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3531 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3532 | 0 \ |
| 3533 | -c "client hello, adding renegotiation extension" \ |
| 3534 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3535 | -s "found renegotiation extension" \ |
| 3536 | -s "server hello, secure renegotiation extension" \ |
| 3537 | -s "record counter limit reached: renegotiate" \ |
| 3538 | -c "=> renegotiate" \ |
| 3539 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3540 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3541 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3542 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3543 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3544 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3545 | "$G_SRV -u --mtu 4096" \ |
| 3546 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3547 | 0 \ |
| 3548 | -c "client hello, adding renegotiation extension" \ |
| 3549 | -c "found renegotiation extension" \ |
| 3550 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3551 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3552 | -C "error" \ |
| 3553 | -s "Extra-header:" |
| 3554 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3555 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3556 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3557 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3558 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3559 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3560 | "$P_CLI debug_level=3" \ |
| 3561 | 0 \ |
| 3562 | -c "found renegotiation extension" \ |
| 3563 | -C "error" \ |
| 3564 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3565 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3566 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3567 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3568 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3569 | "$P_CLI debug_level=3" \ |
| 3570 | 0 \ |
| 3571 | -C "found renegotiation extension" \ |
| 3572 | -C "error" \ |
| 3573 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3574 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3575 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3576 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3577 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3578 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3579 | 1 \ |
| 3580 | -C "found renegotiation extension" \ |
| 3581 | -c "error" \ |
| 3582 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3583 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3584 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3585 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3586 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3587 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3588 | 0 \ |
| 3589 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3590 | -s "server hello, secure renegotiation extension" |
| 3591 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3592 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3593 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3594 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3595 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3596 | 0 \ |
| 3597 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3598 | -S "server hello, secure renegotiation extension" |
| 3599 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3600 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3601 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3602 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3603 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3604 | 1 \ |
| 3605 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3606 | -S "server hello, secure renegotiation extension" |
| 3607 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3608 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3609 | |
| 3610 | requires_gnutls |
| 3611 | run_test "DER format: no trailing bytes" \ |
| 3612 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3613 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3614 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3615 | 0 \ |
| 3616 | -c "Handshake was completed" \ |
| 3617 | |
| 3618 | requires_gnutls |
| 3619 | run_test "DER format: with a trailing zero byte" \ |
| 3620 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3621 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3622 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3623 | 0 \ |
| 3624 | -c "Handshake was completed" \ |
| 3625 | |
| 3626 | requires_gnutls |
| 3627 | run_test "DER format: with a trailing random byte" \ |
| 3628 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3629 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3630 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3631 | 0 \ |
| 3632 | -c "Handshake was completed" \ |
| 3633 | |
| 3634 | requires_gnutls |
| 3635 | run_test "DER format: with 2 trailing random bytes" \ |
| 3636 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3637 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3638 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3639 | 0 \ |
| 3640 | -c "Handshake was completed" \ |
| 3641 | |
| 3642 | requires_gnutls |
| 3643 | run_test "DER format: with 4 trailing random bytes" \ |
| 3644 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3645 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3646 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3647 | 0 \ |
| 3648 | -c "Handshake was completed" \ |
| 3649 | |
| 3650 | requires_gnutls |
| 3651 | run_test "DER format: with 8 trailing random bytes" \ |
| 3652 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3653 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3654 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3655 | 0 \ |
| 3656 | -c "Handshake was completed" \ |
| 3657 | |
| 3658 | requires_gnutls |
| 3659 | run_test "DER format: with 9 trailing random bytes" \ |
| 3660 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3661 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3662 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3663 | 0 \ |
| 3664 | -c "Handshake was completed" \ |
| 3665 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3666 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3667 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3668 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3669 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3670 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3671 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3672 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3673 | 1 \ |
| 3674 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3675 | -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] | 3676 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3677 | -c "X509 - Certificate verification failed" |
| 3678 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3679 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3680 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3681 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3682 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3683 | 0 \ |
| 3684 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3685 | -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] | 3686 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3687 | -C "X509 - Certificate verification failed" |
| 3688 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3689 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3690 | "$P_SRV" \ |
| 3691 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3692 | 0 \ |
| 3693 | -c "x509_verify_cert() returned" \ |
| 3694 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3695 | -c "! Certificate verification flags"\ |
| 3696 | -C "! mbedtls_ssl_handshake returned" \ |
| 3697 | -C "X509 - Certificate verification failed" \ |
| 3698 | -C "SSL - No CA Chain is set, but required to operate" |
| 3699 | |
| 3700 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3701 | "$P_SRV" \ |
| 3702 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3703 | 1 \ |
| 3704 | -c "x509_verify_cert() returned" \ |
| 3705 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3706 | -c "! Certificate verification flags"\ |
| 3707 | -c "! mbedtls_ssl_handshake returned" \ |
| 3708 | -c "SSL - No CA Chain is set, but required to operate" |
| 3709 | |
| 3710 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3711 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3712 | # the client informs the server about the supported curves - it does, though, in the |
| 3713 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3714 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3715 | # different means to have the server ignoring the client's supported curve list. |
| 3716 | |
| 3717 | requires_config_enabled MBEDTLS_ECP_C |
| 3718 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3719 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3720 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3721 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3722 | 1 \ |
| 3723 | -c "bad certificate (EC key curve)"\ |
| 3724 | -c "! Certificate verification flags"\ |
| 3725 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3726 | |
| 3727 | requires_config_enabled MBEDTLS_ECP_C |
| 3728 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3729 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3730 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3731 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3732 | 1 \ |
| 3733 | -c "bad certificate (EC key curve)"\ |
| 3734 | -c "! Certificate verification flags"\ |
| 3735 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3736 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3737 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3738 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3739 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3740 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3741 | 0 \ |
| 3742 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3743 | -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] | 3744 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3745 | -C "X509 - Certificate verification failed" |
| 3746 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3747 | run_test "Authentication: client SHA256, server required" \ |
| 3748 | "$P_SRV auth_mode=required" \ |
| 3749 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3750 | key_file=data_files/server6.key \ |
| 3751 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3752 | 0 \ |
| 3753 | -c "Supported Signature Algorithm found: 4," \ |
| 3754 | -c "Supported Signature Algorithm found: 5," |
| 3755 | |
| 3756 | run_test "Authentication: client SHA384, server required" \ |
| 3757 | "$P_SRV auth_mode=required" \ |
| 3758 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3759 | key_file=data_files/server6.key \ |
| 3760 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3761 | 0 \ |
| 3762 | -c "Supported Signature Algorithm found: 4," \ |
| 3763 | -c "Supported Signature Algorithm found: 5," |
| 3764 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3765 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3766 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3767 | "$P_CLI debug_level=3 crt_file=none \ |
| 3768 | key_file=data_files/server5.key" \ |
| 3769 | 1 \ |
| 3770 | -S "skip write certificate request" \ |
| 3771 | -C "skip parse certificate request" \ |
| 3772 | -c "got a certificate request" \ |
| 3773 | -c "= write certificate$" \ |
| 3774 | -C "skip write certificate$" \ |
| 3775 | -S "x509_verify_cert() returned" \ |
| 3776 | -s "client has no certificate" \ |
| 3777 | -s "! mbedtls_ssl_handshake returned" \ |
| 3778 | -c "! mbedtls_ssl_handshake returned" \ |
| 3779 | -s "No client certification received from the client, but required by the authentication mode" |
| 3780 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3781 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3782 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3783 | "$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] | 3784 | key_file=data_files/server5.key" \ |
| 3785 | 1 \ |
| 3786 | -S "skip write certificate request" \ |
| 3787 | -C "skip parse certificate request" \ |
| 3788 | -c "got a certificate request" \ |
| 3789 | -C "skip write certificate" \ |
| 3790 | -C "skip write certificate verify" \ |
| 3791 | -S "skip parse certificate verify" \ |
| 3792 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3793 | -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] | 3794 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3795 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3796 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3797 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3798 | # We don't check that the client receives the alert because it might |
| 3799 | # detect that its write end of the connection is closed and abort |
| 3800 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3801 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3802 | run_test "Authentication: client cert not trusted, server required" \ |
| 3803 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3804 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3805 | key_file=data_files/server5.key" \ |
| 3806 | 1 \ |
| 3807 | -S "skip write certificate request" \ |
| 3808 | -C "skip parse certificate request" \ |
| 3809 | -c "got a certificate request" \ |
| 3810 | -C "skip write certificate" \ |
| 3811 | -C "skip write certificate verify" \ |
| 3812 | -S "skip parse certificate verify" \ |
| 3813 | -s "x509_verify_cert() returned" \ |
| 3814 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3815 | -s "! mbedtls_ssl_handshake returned" \ |
| 3816 | -c "! mbedtls_ssl_handshake returned" \ |
| 3817 | -s "X509 - Certificate verification failed" |
| 3818 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3819 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3820 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3821 | "$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] | 3822 | key_file=data_files/server5.key" \ |
| 3823 | 0 \ |
| 3824 | -S "skip write certificate request" \ |
| 3825 | -C "skip parse certificate request" \ |
| 3826 | -c "got a certificate request" \ |
| 3827 | -C "skip write certificate" \ |
| 3828 | -C "skip write certificate verify" \ |
| 3829 | -S "skip parse certificate verify" \ |
| 3830 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3831 | -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] | 3832 | -S "! mbedtls_ssl_handshake returned" \ |
| 3833 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3834 | -S "X509 - Certificate verification failed" |
| 3835 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3836 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3837 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3838 | "$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] | 3839 | key_file=data_files/server5.key" \ |
| 3840 | 0 \ |
| 3841 | -s "skip write certificate request" \ |
| 3842 | -C "skip parse certificate request" \ |
| 3843 | -c "got no certificate request" \ |
| 3844 | -c "skip write certificate" \ |
| 3845 | -c "skip write certificate verify" \ |
| 3846 | -s "skip parse certificate verify" \ |
| 3847 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3848 | -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] | 3849 | -S "! mbedtls_ssl_handshake returned" \ |
| 3850 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3851 | -S "X509 - Certificate verification failed" |
| 3852 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3853 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3854 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3855 | "$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] | 3856 | 0 \ |
| 3857 | -S "skip write certificate request" \ |
| 3858 | -C "skip parse certificate request" \ |
| 3859 | -c "got a certificate request" \ |
| 3860 | -C "skip write certificate$" \ |
| 3861 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3862 | -c "skip write certificate verify" \ |
| 3863 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3864 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3865 | -S "! mbedtls_ssl_handshake returned" \ |
| 3866 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3867 | -S "X509 - Certificate verification failed" |
| 3868 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3869 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3870 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3871 | "$O_CLI" \ |
| 3872 | 0 \ |
| 3873 | -S "skip write certificate request" \ |
| 3874 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3875 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3876 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3877 | -S "X509 - Certificate verification failed" |
| 3878 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3879 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3880 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3881 | "$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] | 3882 | 0 \ |
| 3883 | -C "skip parse certificate request" \ |
| 3884 | -c "got a certificate request" \ |
| 3885 | -C "skip write certificate$" \ |
| 3886 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3887 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 3888 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3889 | run_test "Authentication: client no cert, openssl server required" \ |
| 3890 | "$O_SRV -Verify 10" \ |
| 3891 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 3892 | 1 \ |
| 3893 | -C "skip parse certificate request" \ |
| 3894 | -c "got a certificate request" \ |
| 3895 | -C "skip write certificate$" \ |
| 3896 | -c "skip write certificate verify" \ |
| 3897 | -c "! mbedtls_ssl_handshake returned" |
| 3898 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 3899 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 3900 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 3901 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3902 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 3903 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 3904 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 3905 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 3906 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 3907 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 3908 | # are in place so that the semantics are consistent with the test description. |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3909 | requires_config_value_equals "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 | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3918 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3919 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3920 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 3921 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3922 | key_file=data_files/dir-maxpath/10.key" \ |
| 3923 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 3924 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3925 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3926 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3927 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3928 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3929 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 3930 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3931 | key_file=data_files/dir-maxpath/10.key" \ |
| 3932 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3933 | auth_mode=optional" \ |
| 3934 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3935 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3936 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3937 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3938 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3939 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 3940 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 3941 | key_file=data_files/dir-maxpath/10.key" \ |
| 3942 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 3943 | auth_mode=none" \ |
| 3944 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3945 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3946 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3947 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3948 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3949 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 3950 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 3951 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3952 | key_file=data_files/dir-maxpath/10.key" \ |
| 3953 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3954 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3955 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3956 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3957 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3958 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 3959 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 3960 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3961 | key_file=data_files/dir-maxpath/10.key" \ |
| 3962 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3963 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3964 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3965 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3966 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3967 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 3968 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3969 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 3970 | key_file=data_files/dir-maxpath/10.key" \ |
| 3971 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3972 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3973 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 3974 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3975 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3976 | run_test "Authentication: client max_int chain, server required" \ |
| 3977 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 3978 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 3979 | key_file=data_files/dir-maxpath/09.key" \ |
| 3980 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 3981 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 3982 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3983 | # Tests for CA list in CertificateRequest messages |
| 3984 | |
| 3985 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 3986 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3987 | "$P_CLI crt_file=data_files/server6.crt \ |
| 3988 | key_file=data_files/server6.key" \ |
| 3989 | 0 \ |
| 3990 | -s "requested DN" |
| 3991 | |
| 3992 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 3993 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 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: send CA list in CertificateRequest, client self signed" \ |
| 4000 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4001 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4002 | key_file=data_files/server5.key" \ |
| 4003 | 1 \ |
| 4004 | -S "requested DN" \ |
| 4005 | -s "x509_verify_cert() returned" \ |
| 4006 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4007 | -s "! mbedtls_ssl_handshake returned" \ |
| 4008 | -c "! mbedtls_ssl_handshake returned" \ |
| 4009 | -s "X509 - Certificate verification failed" |
| 4010 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4011 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4012 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4013 | |
| 4014 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4015 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4016 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4017 | key_file=data_files/server5.key" \ |
| 4018 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4019 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4020 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4021 | -c "x509_verify_cert() returned" \ |
| 4022 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4023 | -c "! mbedtls_ssl_handshake returned" \ |
| 4024 | -c "X509 - Certificate verification failed" |
| 4025 | |
| 4026 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4027 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4028 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4029 | key_file=data_files/server5.key" \ |
| 4030 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4031 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4032 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4033 | -c "x509_verify_cert() returned" \ |
| 4034 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4035 | -C "! mbedtls_ssl_handshake returned" \ |
| 4036 | -C "X509 - Certificate verification failed" |
| 4037 | |
| 4038 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4039 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4040 | # the client informs the server about the supported curves - it does, though, in the |
| 4041 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4042 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4043 | # different means to have the server ignoring the client's supported curve list. |
| 4044 | |
| 4045 | requires_config_enabled MBEDTLS_ECP_C |
| 4046 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4047 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4048 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4049 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4050 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4051 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4052 | -c "use CA callback for X.509 CRT verification" \ |
| 4053 | -c "bad certificate (EC key curve)" \ |
| 4054 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4055 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4056 | |
| 4057 | requires_config_enabled MBEDTLS_ECP_C |
| 4058 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4059 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4060 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4061 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4062 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4063 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4064 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4065 | -c "bad certificate (EC key curve)"\ |
| 4066 | -c "! Certificate verification flags"\ |
| 4067 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4068 | |
| 4069 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4070 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4071 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4072 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4073 | key_file=data_files/server6.key \ |
| 4074 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4075 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4076 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4077 | -c "Supported Signature Algorithm found: 4," \ |
| 4078 | -c "Supported Signature Algorithm found: 5," |
| 4079 | |
| 4080 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4081 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4082 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4083 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4084 | key_file=data_files/server6.key \ |
| 4085 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4086 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4087 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4088 | -c "Supported Signature Algorithm found: 4," \ |
| 4089 | -c "Supported Signature Algorithm found: 5," |
| 4090 | |
| 4091 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4092 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4093 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4094 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4095 | key_file=data_files/server5.key" \ |
| 4096 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4097 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4098 | -S "skip write certificate request" \ |
| 4099 | -C "skip parse certificate request" \ |
| 4100 | -c "got a certificate request" \ |
| 4101 | -C "skip write certificate" \ |
| 4102 | -C "skip write certificate verify" \ |
| 4103 | -S "skip parse certificate verify" \ |
| 4104 | -s "x509_verify_cert() returned" \ |
| 4105 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4106 | -s "! mbedtls_ssl_handshake returned" \ |
| 4107 | -s "send alert level=2 message=48" \ |
| 4108 | -c "! mbedtls_ssl_handshake returned" \ |
| 4109 | -s "X509 - Certificate verification failed" |
| 4110 | # We don't check that the client receives the alert because it might |
| 4111 | # detect that its write end of the connection is closed and abort |
| 4112 | # before reading the alert message. |
| 4113 | |
| 4114 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4115 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4116 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4117 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4118 | key_file=data_files/server5.key" \ |
| 4119 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4120 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4121 | -S "skip write certificate request" \ |
| 4122 | -C "skip parse certificate request" \ |
| 4123 | -c "got a certificate request" \ |
| 4124 | -C "skip write certificate" \ |
| 4125 | -C "skip write certificate verify" \ |
| 4126 | -S "skip parse certificate verify" \ |
| 4127 | -s "x509_verify_cert() returned" \ |
| 4128 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4129 | -s "! mbedtls_ssl_handshake returned" \ |
| 4130 | -c "! mbedtls_ssl_handshake returned" \ |
| 4131 | -s "X509 - Certificate verification failed" |
| 4132 | |
| 4133 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4134 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4135 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4136 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4137 | key_file=data_files/server5.key" \ |
| 4138 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4139 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4140 | -S "skip write certificate request" \ |
| 4141 | -C "skip parse certificate request" \ |
| 4142 | -c "got a certificate request" \ |
| 4143 | -C "skip write certificate" \ |
| 4144 | -C "skip write certificate verify" \ |
| 4145 | -S "skip parse certificate verify" \ |
| 4146 | -s "x509_verify_cert() returned" \ |
| 4147 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4148 | -S "! mbedtls_ssl_handshake returned" \ |
| 4149 | -C "! mbedtls_ssl_handshake returned" \ |
| 4150 | -S "X509 - Certificate verification failed" |
| 4151 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4152 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4153 | requires_full_size_output_buffer |
| 4154 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4155 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4156 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4157 | key_file=data_files/dir-maxpath/09.key" \ |
| 4158 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4159 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4160 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4161 | -C "X509 - A fatal error occurred" |
| 4162 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4163 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4164 | requires_full_size_output_buffer |
| 4165 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4166 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4167 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4168 | key_file=data_files/dir-maxpath/10.key" \ |
| 4169 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4170 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4171 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4172 | -c "X509 - A fatal error occurred" |
| 4173 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4174 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4175 | requires_full_size_output_buffer |
| 4176 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4177 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4178 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4179 | key_file=data_files/dir-maxpath/10.key" \ |
| 4180 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4181 | debug_level=3 auth_mode=optional" \ |
| 4182 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4183 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4184 | -c "X509 - A fatal error occurred" |
| 4185 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4186 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4187 | requires_full_size_output_buffer |
| 4188 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4189 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4190 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4191 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4192 | key_file=data_files/dir-maxpath/10.key" \ |
| 4193 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4194 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4195 | -s "X509 - A fatal error occurred" |
| 4196 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4197 | requires_config_value_equals "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 required" \ |
| 4201 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 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 | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4208 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4209 | requires_full_size_output_buffer |
| 4210 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4211 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4212 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4213 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4214 | key_file=data_files/dir-maxpath/09.key" \ |
| 4215 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4216 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4217 | -S "X509 - A fatal error occurred" |
| 4218 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4219 | # Tests for certificate selection based on SHA verson |
| 4220 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4221 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4222 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4223 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4224 | key_file=data_files/server5.key \ |
| 4225 | crt_file2=data_files/server5-sha1.crt \ |
| 4226 | key_file2=data_files/server5.key" \ |
| 4227 | "$P_CLI force_version=tls1_2" \ |
| 4228 | 0 \ |
| 4229 | -c "signed using.*ECDSA with SHA256" \ |
| 4230 | -C "signed using.*ECDSA with SHA1" |
| 4231 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4232 | # tests for SNI |
| 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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4235 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4236 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4237 | 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] | 4238 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4239 | 0 \ |
| 4240 | -S "parse ServerName extension" \ |
| 4241 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4242 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4243 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4244 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4245 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4246 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4247 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 4d6f178 | 2015-06-19 14:40:39 +0200 | [diff] [blame] | 4248 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4249 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4250 | 0 \ |
| 4251 | -s "parse ServerName extension" \ |
| 4252 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4253 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4254 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4255 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4256 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4257 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4258 | 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] | 4259 | 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] | 4260 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4261 | 0 \ |
| 4262 | -s "parse ServerName extension" \ |
| 4263 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4264 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4265 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4266 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4267 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4268 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4269 | 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] | 4270 | 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] | 4271 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4272 | 1 \ |
| 4273 | -s "parse ServerName extension" \ |
| 4274 | -s "ssl_sni_wrapper() returned" \ |
| 4275 | -s "mbedtls_ssl_handshake returned" \ |
| 4276 | -c "mbedtls_ssl_handshake returned" \ |
| 4277 | -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] | 4278 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4279 | run_test "SNI: client auth no override: optional" \ |
| 4280 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4281 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4282 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4283 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4284 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4285 | -S "skip write certificate request" \ |
| 4286 | -C "skip parse certificate request" \ |
| 4287 | -c "got a certificate request" \ |
| 4288 | -C "skip write certificate" \ |
| 4289 | -C "skip write certificate verify" \ |
| 4290 | -S "skip parse certificate verify" |
| 4291 | |
| 4292 | run_test "SNI: client auth override: none -> optional" \ |
| 4293 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4294 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4295 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 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: optional -> none" \ |
| 4306 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4307 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4308 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 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 no certificate request" \ |
| 4314 | -c "skip write certificate" \ |
| 4315 | -c "skip write certificate verify" \ |
| 4316 | -s "skip parse certificate verify" |
| 4317 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4318 | run_test "SNI: CA no override" \ |
| 4319 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4320 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4321 | ca_file=data_files/test-ca.crt \ |
| 4322 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4323 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4324 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4325 | 1 \ |
| 4326 | -S "skip write certificate request" \ |
| 4327 | -C "skip parse certificate request" \ |
| 4328 | -c "got a certificate request" \ |
| 4329 | -C "skip write certificate" \ |
| 4330 | -C "skip write certificate verify" \ |
| 4331 | -S "skip parse certificate verify" \ |
| 4332 | -s "x509_verify_cert() returned" \ |
| 4333 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4334 | -S "The certificate has been revoked (is on a CRL)" |
| 4335 | |
| 4336 | run_test "SNI: CA override" \ |
| 4337 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4338 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4339 | ca_file=data_files/test-ca.crt \ |
| 4340 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4341 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4342 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4343 | 0 \ |
| 4344 | -S "skip write certificate request" \ |
| 4345 | -C "skip parse certificate request" \ |
| 4346 | -c "got a certificate request" \ |
| 4347 | -C "skip write certificate" \ |
| 4348 | -C "skip write certificate verify" \ |
| 4349 | -S "skip parse certificate verify" \ |
| 4350 | -S "x509_verify_cert() returned" \ |
| 4351 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4352 | -S "The certificate has been revoked (is on a CRL)" |
| 4353 | |
| 4354 | run_test "SNI: CA override with CRL" \ |
| 4355 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4356 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4357 | ca_file=data_files/test-ca.crt \ |
| 4358 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4359 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4360 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4361 | 1 \ |
| 4362 | -S "skip write certificate request" \ |
| 4363 | -C "skip parse certificate request" \ |
| 4364 | -c "got a certificate request" \ |
| 4365 | -C "skip write certificate" \ |
| 4366 | -C "skip write certificate verify" \ |
| 4367 | -S "skip parse certificate verify" \ |
| 4368 | -s "x509_verify_cert() returned" \ |
| 4369 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4370 | -s "The certificate has been revoked (is on a CRL)" |
| 4371 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4372 | # Tests for SNI and DTLS |
| 4373 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4374 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4375 | run_test "SNI: DTLS, no SNI callback" \ |
| 4376 | "$P_SRV debug_level=3 dtls=1 \ |
| 4377 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4378 | "$P_CLI server_name=localhost dtls=1" \ |
| 4379 | 0 \ |
| 4380 | -S "parse ServerName extension" \ |
| 4381 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4382 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4383 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4384 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4385 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4386 | "$P_SRV debug_level=3 dtls=1 \ |
| 4387 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4388 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4389 | "$P_CLI server_name=localhost dtls=1" \ |
| 4390 | 0 \ |
| 4391 | -s "parse ServerName extension" \ |
| 4392 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4393 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4394 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4395 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4396 | run_test "SNI: DTLS, matching cert 2" \ |
| 4397 | "$P_SRV debug_level=3 dtls=1 \ |
| 4398 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4399 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4400 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4401 | 0 \ |
| 4402 | -s "parse ServerName extension" \ |
| 4403 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4404 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4405 | |
| 4406 | run_test "SNI: DTLS, no matching cert" \ |
| 4407 | "$P_SRV debug_level=3 dtls=1 \ |
| 4408 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4409 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4410 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4411 | 1 \ |
| 4412 | -s "parse ServerName extension" \ |
| 4413 | -s "ssl_sni_wrapper() returned" \ |
| 4414 | -s "mbedtls_ssl_handshake returned" \ |
| 4415 | -c "mbedtls_ssl_handshake returned" \ |
| 4416 | -c "SSL - A fatal alert message was received from our peer" |
| 4417 | |
| 4418 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4419 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4420 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4421 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4422 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4423 | 0 \ |
| 4424 | -S "skip write certificate request" \ |
| 4425 | -C "skip parse certificate request" \ |
| 4426 | -c "got a certificate request" \ |
| 4427 | -C "skip write certificate" \ |
| 4428 | -C "skip write certificate verify" \ |
| 4429 | -S "skip parse certificate verify" |
| 4430 | |
| 4431 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4432 | "$P_SRV debug_level=3 auth_mode=none 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,-,-,optional" \ |
| 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: optional -> none" \ |
| 4445 | "$P_SRV debug_level=3 auth_mode=optional 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,-,-,none" \ |
| 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 no 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, CA no override" \ |
| 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 | ca_file=data_files/test-ca.crt \ |
| 4461 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4462 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4463 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4464 | 1 \ |
| 4465 | -S "skip write certificate request" \ |
| 4466 | -C "skip parse certificate request" \ |
| 4467 | -c "got a certificate request" \ |
| 4468 | -C "skip write certificate" \ |
| 4469 | -C "skip write certificate verify" \ |
| 4470 | -S "skip parse certificate verify" \ |
| 4471 | -s "x509_verify_cert() returned" \ |
| 4472 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4473 | -S "The certificate has been revoked (is on a CRL)" |
| 4474 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4475 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4476 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4477 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4478 | ca_file=data_files/test-ca.crt \ |
| 4479 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4480 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4481 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4482 | 0 \ |
| 4483 | -S "skip write certificate request" \ |
| 4484 | -C "skip parse certificate request" \ |
| 4485 | -c "got a certificate request" \ |
| 4486 | -C "skip write certificate" \ |
| 4487 | -C "skip write certificate verify" \ |
| 4488 | -S "skip parse certificate verify" \ |
| 4489 | -S "x509_verify_cert() returned" \ |
| 4490 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4491 | -S "The certificate has been revoked (is on a CRL)" |
| 4492 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4493 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4494 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4495 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4496 | ca_file=data_files/test-ca.crt \ |
| 4497 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4498 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4499 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4500 | 1 \ |
| 4501 | -S "skip write certificate request" \ |
| 4502 | -C "skip parse certificate request" \ |
| 4503 | -c "got a certificate request" \ |
| 4504 | -C "skip write certificate" \ |
| 4505 | -C "skip write certificate verify" \ |
| 4506 | -S "skip parse certificate verify" \ |
| 4507 | -s "x509_verify_cert() returned" \ |
| 4508 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4509 | -s "The certificate has been revoked (is on a CRL)" |
| 4510 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4511 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4512 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4513 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4514 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4515 | "$P_CLI nbio=2 tickets=0" \ |
| 4516 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4517 | -S "mbedtls_ssl_handshake returned" \ |
| 4518 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4519 | -c "Read from server: .* bytes read" |
| 4520 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4521 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4522 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4523 | "$P_CLI nbio=2 tickets=0" \ |
| 4524 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4525 | -S "mbedtls_ssl_handshake returned" \ |
| 4526 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4527 | -c "Read from server: .* bytes read" |
| 4528 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4529 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4530 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4531 | "$P_CLI nbio=2 tickets=1" \ |
| 4532 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4533 | -S "mbedtls_ssl_handshake returned" \ |
| 4534 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4535 | -c "Read from server: .* bytes read" |
| 4536 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4537 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4538 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4539 | "$P_CLI nbio=2 tickets=1" \ |
| 4540 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4541 | -S "mbedtls_ssl_handshake returned" \ |
| 4542 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4543 | -c "Read from server: .* bytes read" |
| 4544 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4545 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4546 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4547 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4548 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4549 | -S "mbedtls_ssl_handshake returned" \ |
| 4550 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4551 | -c "Read from server: .* bytes read" |
| 4552 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4553 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4554 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4555 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4556 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4557 | -S "mbedtls_ssl_handshake returned" \ |
| 4558 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4559 | -c "Read from server: .* bytes read" |
| 4560 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4561 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4562 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4563 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4564 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4565 | -S "mbedtls_ssl_handshake returned" \ |
| 4566 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4567 | -c "Read from server: .* bytes read" |
| 4568 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4569 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4570 | |
| 4571 | run_test "Event-driven I/O: basic handshake" \ |
| 4572 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4573 | "$P_CLI event=1 tickets=0" \ |
| 4574 | 0 \ |
| 4575 | -S "mbedtls_ssl_handshake returned" \ |
| 4576 | -C "mbedtls_ssl_handshake returned" \ |
| 4577 | -c "Read from server: .* bytes read" |
| 4578 | |
| 4579 | run_test "Event-driven I/O: client auth" \ |
| 4580 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4581 | "$P_CLI event=1 tickets=0" \ |
| 4582 | 0 \ |
| 4583 | -S "mbedtls_ssl_handshake returned" \ |
| 4584 | -C "mbedtls_ssl_handshake returned" \ |
| 4585 | -c "Read from server: .* bytes read" |
| 4586 | |
| 4587 | run_test "Event-driven I/O: ticket" \ |
| 4588 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4589 | "$P_CLI event=1 tickets=1" \ |
| 4590 | 0 \ |
| 4591 | -S "mbedtls_ssl_handshake returned" \ |
| 4592 | -C "mbedtls_ssl_handshake returned" \ |
| 4593 | -c "Read from server: .* bytes read" |
| 4594 | |
| 4595 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4596 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4597 | "$P_CLI event=1 tickets=1" \ |
| 4598 | 0 \ |
| 4599 | -S "mbedtls_ssl_handshake returned" \ |
| 4600 | -C "mbedtls_ssl_handshake returned" \ |
| 4601 | -c "Read from server: .* bytes read" |
| 4602 | |
| 4603 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4604 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4605 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4606 | 0 \ |
| 4607 | -S "mbedtls_ssl_handshake returned" \ |
| 4608 | -C "mbedtls_ssl_handshake returned" \ |
| 4609 | -c "Read from server: .* bytes read" |
| 4610 | |
| 4611 | run_test "Event-driven I/O: ticket + resume" \ |
| 4612 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4613 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4614 | 0 \ |
| 4615 | -S "mbedtls_ssl_handshake returned" \ |
| 4616 | -C "mbedtls_ssl_handshake returned" \ |
| 4617 | -c "Read from server: .* bytes read" |
| 4618 | |
| 4619 | run_test "Event-driven I/O: session-id resume" \ |
| 4620 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4621 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4622 | 0 \ |
| 4623 | -S "mbedtls_ssl_handshake returned" \ |
| 4624 | -C "mbedtls_ssl_handshake returned" \ |
| 4625 | -c "Read from server: .* bytes read" |
| 4626 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4627 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4628 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4629 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4630 | 0 \ |
| 4631 | -c "Read from server: .* bytes read" |
| 4632 | |
| 4633 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4634 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4635 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4636 | 0 \ |
| 4637 | -c "Read from server: .* bytes read" |
| 4638 | |
| 4639 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4640 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4641 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4642 | 0 \ |
| 4643 | -c "Read from server: .* bytes read" |
| 4644 | |
| 4645 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4646 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4647 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4648 | 0 \ |
| 4649 | -c "Read from server: .* bytes read" |
| 4650 | |
| 4651 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4652 | "$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] | 4653 | "$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] | 4654 | 0 \ |
| 4655 | -c "Read from server: .* bytes read" |
| 4656 | |
| 4657 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4658 | "$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] | 4659 | "$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] | 4660 | 0 \ |
| 4661 | -c "Read from server: .* bytes read" |
| 4662 | |
| 4663 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4664 | "$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] | 4665 | "$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] | 4666 | 0 \ |
| 4667 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4668 | |
| 4669 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4670 | # During session resumption, the client will send its ApplicationData record |
| 4671 | # within the same datagram as the Finished messages. In this situation, the |
| 4672 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4673 | # because the ApplicationData request has already been queued internally. |
| 4674 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4675 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4676 | "$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] | 4677 | "$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] | 4678 | 0 \ |
| 4679 | -c "Read from server: .* bytes read" |
| 4680 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4681 | # Tests for version negotiation |
| 4682 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4683 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4684 | "$P_SRV" \ |
| 4685 | "$P_CLI" \ |
| 4686 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4687 | -S "mbedtls_ssl_handshake returned" \ |
| 4688 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4689 | -s "Protocol is TLSv1.2" \ |
| 4690 | -c "Protocol is TLSv1.2" |
| 4691 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4692 | # Tests for ALPN extension |
| 4693 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4694 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4695 | "$P_SRV debug_level=3" \ |
| 4696 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4697 | 0 \ |
| 4698 | -C "client hello, adding alpn extension" \ |
| 4699 | -S "found alpn extension" \ |
| 4700 | -C "got an alert message, type: \\[2:120]" \ |
| 4701 | -S "server hello, adding alpn extension" \ |
| 4702 | -C "found alpn extension " \ |
| 4703 | -C "Application Layer Protocol is" \ |
| 4704 | -S "Application Layer Protocol is" |
| 4705 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4706 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4707 | "$P_SRV debug_level=3" \ |
| 4708 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4709 | 0 \ |
| 4710 | -c "client hello, adding alpn extension" \ |
| 4711 | -s "found alpn extension" \ |
| 4712 | -C "got an alert message, type: \\[2:120]" \ |
| 4713 | -S "server hello, adding alpn extension" \ |
| 4714 | -C "found alpn extension " \ |
| 4715 | -c "Application Layer Protocol is (none)" \ |
| 4716 | -S "Application Layer Protocol is" |
| 4717 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4718 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4719 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4720 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4721 | 0 \ |
| 4722 | -C "client hello, adding alpn extension" \ |
| 4723 | -S "found alpn extension" \ |
| 4724 | -C "got an alert message, type: \\[2:120]" \ |
| 4725 | -S "server hello, adding alpn extension" \ |
| 4726 | -C "found alpn extension " \ |
| 4727 | -C "Application Layer Protocol is" \ |
| 4728 | -s "Application Layer Protocol is (none)" |
| 4729 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4730 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4731 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4732 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4733 | 0 \ |
| 4734 | -c "client hello, adding alpn extension" \ |
| 4735 | -s "found alpn extension" \ |
| 4736 | -C "got an alert message, type: \\[2:120]" \ |
| 4737 | -s "server hello, adding alpn extension" \ |
| 4738 | -c "found alpn extension" \ |
| 4739 | -c "Application Layer Protocol is abc" \ |
| 4740 | -s "Application Layer Protocol is abc" |
| 4741 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4742 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4743 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4744 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4745 | 0 \ |
| 4746 | -c "client hello, adding alpn extension" \ |
| 4747 | -s "found alpn extension" \ |
| 4748 | -C "got an alert message, type: \\[2:120]" \ |
| 4749 | -s "server hello, adding alpn extension" \ |
| 4750 | -c "found alpn extension" \ |
| 4751 | -c "Application Layer Protocol is abc" \ |
| 4752 | -s "Application Layer Protocol is abc" |
| 4753 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4754 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4755 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4756 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4757 | 0 \ |
| 4758 | -c "client hello, adding alpn extension" \ |
| 4759 | -s "found alpn extension" \ |
| 4760 | -C "got an alert message, type: \\[2:120]" \ |
| 4761 | -s "server hello, adding alpn extension" \ |
| 4762 | -c "found alpn extension" \ |
| 4763 | -c "Application Layer Protocol is 1234" \ |
| 4764 | -s "Application Layer Protocol is 1234" |
| 4765 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4766 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4767 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4768 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4769 | 1 \ |
| 4770 | -c "client hello, adding alpn extension" \ |
| 4771 | -s "found alpn extension" \ |
| 4772 | -c "got an alert message, type: \\[2:120]" \ |
| 4773 | -S "server hello, adding alpn extension" \ |
| 4774 | -C "found alpn extension" \ |
| 4775 | -C "Application Layer Protocol is 1234" \ |
| 4776 | -S "Application Layer Protocol is 1234" |
| 4777 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4778 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4779 | # Tests for keyUsage in leaf certificates, part 1: |
| 4780 | # server-side certificate/suite selection |
| 4781 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4782 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4783 | "$P_SRV key_file=data_files/server2.key \ |
| 4784 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4785 | "$P_CLI" \ |
| 4786 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4787 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4788 | |
| 4789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4790 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4791 | "$P_SRV key_file=data_files/server2.key \ |
| 4792 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4793 | "$P_CLI" \ |
| 4794 | 0 \ |
| 4795 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4796 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4797 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4798 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4799 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4800 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4801 | 1 \ |
| 4802 | -C "Ciphersuite is " |
| 4803 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4804 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4805 | "$P_SRV key_file=data_files/server5.key \ |
| 4806 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4807 | "$P_CLI" \ |
| 4808 | 0 \ |
| 4809 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4810 | |
| 4811 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4812 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4813 | "$P_SRV key_file=data_files/server5.key \ |
| 4814 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4815 | "$P_CLI" \ |
| 4816 | 0 \ |
| 4817 | -c "Ciphersuite is TLS-ECDH-" |
| 4818 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4819 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4820 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4821 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4822 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4823 | 1 \ |
| 4824 | -C "Ciphersuite is " |
| 4825 | |
| 4826 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4827 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4828 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4829 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4830 | "$O_SRV -key data_files/server2.key \ |
| 4831 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4832 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4833 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4834 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4835 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4836 | -C "Processing of the Certificate handshake message failed" \ |
| 4837 | -c "Ciphersuite is TLS-" |
| 4838 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4839 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4840 | "$O_SRV -key data_files/server2.key \ |
| 4841 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4842 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4843 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4844 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4845 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4846 | -C "Processing of the Certificate handshake message failed" \ |
| 4847 | -c "Ciphersuite is TLS-" |
| 4848 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4849 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4850 | "$O_SRV -key data_files/server2.key \ |
| 4851 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4852 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4853 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4854 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4855 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4856 | -C "Processing of the Certificate handshake message failed" \ |
| 4857 | -c "Ciphersuite is TLS-" |
| 4858 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4859 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4860 | "$O_SRV -key data_files/server2.key \ |
| 4861 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4862 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4863 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4864 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4865 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4866 | -c "Processing of the Certificate handshake message failed" \ |
| 4867 | -C "Ciphersuite is TLS-" |
| 4868 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4869 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 4870 | "$O_SRV -key data_files/server2.key \ |
| 4871 | -cert data_files/server2.ku-ke.crt" \ |
| 4872 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4873 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4874 | 0 \ |
| 4875 | -c "bad certificate (usage extensions)" \ |
| 4876 | -C "Processing of the Certificate handshake message failed" \ |
| 4877 | -c "Ciphersuite is TLS-" \ |
| 4878 | -c "! Usage does not match the keyUsage extension" |
| 4879 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4880 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4881 | "$O_SRV -key data_files/server2.key \ |
| 4882 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4883 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4884 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 4885 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4886 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4887 | -C "Processing of the Certificate handshake message failed" \ |
| 4888 | -c "Ciphersuite is TLS-" |
| 4889 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4890 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4891 | "$O_SRV -key data_files/server2.key \ |
| 4892 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4893 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4894 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4895 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4896 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4897 | -c "Processing of the Certificate handshake message failed" \ |
| 4898 | -C "Ciphersuite is TLS-" |
| 4899 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 4900 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 4901 | "$O_SRV -key data_files/server2.key \ |
| 4902 | -cert data_files/server2.ku-ds.crt" \ |
| 4903 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 4904 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 4905 | 0 \ |
| 4906 | -c "bad certificate (usage extensions)" \ |
| 4907 | -C "Processing of the Certificate handshake message failed" \ |
| 4908 | -c "Ciphersuite is TLS-" \ |
| 4909 | -c "! Usage does not match the keyUsage extension" |
| 4910 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4911 | # Tests for keyUsage in leaf certificates, part 3: |
| 4912 | # server-side checking of client cert |
| 4913 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4914 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4915 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4916 | "$O_CLI -key data_files/server2.key \ |
| 4917 | -cert data_files/server2.ku-ds.crt" \ |
| 4918 | 0 \ |
| 4919 | -S "bad certificate (usage extensions)" \ |
| 4920 | -S "Processing of the Certificate handshake message failed" |
| 4921 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4922 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4923 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4924 | "$O_CLI -key data_files/server2.key \ |
| 4925 | -cert data_files/server2.ku-ke.crt" \ |
| 4926 | 0 \ |
| 4927 | -s "bad certificate (usage extensions)" \ |
| 4928 | -S "Processing of the Certificate handshake message failed" |
| 4929 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4930 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4931 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4932 | "$O_CLI -key data_files/server2.key \ |
| 4933 | -cert data_files/server2.ku-ke.crt" \ |
| 4934 | 1 \ |
| 4935 | -s "bad certificate (usage extensions)" \ |
| 4936 | -s "Processing of the Certificate handshake message failed" |
| 4937 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4938 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4939 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4940 | "$O_CLI -key data_files/server5.key \ |
| 4941 | -cert data_files/server5.ku-ds.crt" \ |
| 4942 | 0 \ |
| 4943 | -S "bad certificate (usage extensions)" \ |
| 4944 | -S "Processing of the Certificate handshake message failed" |
| 4945 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4946 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4947 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 4948 | "$O_CLI -key data_files/server5.key \ |
| 4949 | -cert data_files/server5.ku-ka.crt" \ |
| 4950 | 0 \ |
| 4951 | -s "bad certificate (usage extensions)" \ |
| 4952 | -S "Processing of the Certificate handshake message failed" |
| 4953 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4954 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 4955 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4956 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4957 | "$P_SRV key_file=data_files/server5.key \ |
| 4958 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4959 | "$P_CLI" \ |
| 4960 | 0 |
| 4961 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4962 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4963 | "$P_SRV key_file=data_files/server5.key \ |
| 4964 | crt_file=data_files/server5.eku-srv.crt" \ |
| 4965 | "$P_CLI" \ |
| 4966 | 0 |
| 4967 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4968 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4969 | "$P_SRV key_file=data_files/server5.key \ |
| 4970 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 4971 | "$P_CLI" \ |
| 4972 | 0 |
| 4973 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4974 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4975 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4976 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 4977 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4978 | 1 |
| 4979 | |
| 4980 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 4981 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4982 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4983 | "$O_SRV -key data_files/server5.key \ |
| 4984 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4985 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4986 | 0 \ |
| 4987 | -C "bad certificate (usage extensions)" \ |
| 4988 | -C "Processing of the Certificate handshake message failed" \ |
| 4989 | -c "Ciphersuite is TLS-" |
| 4990 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4991 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4992 | "$O_SRV -key data_files/server5.key \ |
| 4993 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4994 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 4995 | 0 \ |
| 4996 | -C "bad certificate (usage extensions)" \ |
| 4997 | -C "Processing of the Certificate handshake message failed" \ |
| 4998 | -c "Ciphersuite is TLS-" |
| 4999 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5000 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5001 | "$O_SRV -key data_files/server5.key \ |
| 5002 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5003 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5004 | 0 \ |
| 5005 | -C "bad certificate (usage extensions)" \ |
| 5006 | -C "Processing of the Certificate handshake message failed" \ |
| 5007 | -c "Ciphersuite is TLS-" |
| 5008 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5009 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5010 | "$O_SRV -key data_files/server5.key \ |
| 5011 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5012 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5013 | 1 \ |
| 5014 | -c "bad certificate (usage extensions)" \ |
| 5015 | -c "Processing of the Certificate handshake message failed" \ |
| 5016 | -C "Ciphersuite is TLS-" |
| 5017 | |
| 5018 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5019 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5020 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5021 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5022 | "$O_CLI -key data_files/server5.key \ |
| 5023 | -cert data_files/server5.eku-cli.crt" \ |
| 5024 | 0 \ |
| 5025 | -S "bad certificate (usage extensions)" \ |
| 5026 | -S "Processing of the Certificate handshake message failed" |
| 5027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5028 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5029 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5030 | "$O_CLI -key data_files/server5.key \ |
| 5031 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5032 | 0 \ |
| 5033 | -S "bad certificate (usage extensions)" \ |
| 5034 | -S "Processing of the Certificate handshake message failed" |
| 5035 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5036 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5037 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5038 | "$O_CLI -key data_files/server5.key \ |
| 5039 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5040 | 0 \ |
| 5041 | -S "bad certificate (usage extensions)" \ |
| 5042 | -S "Processing of the Certificate handshake message failed" |
| 5043 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5044 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5045 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5046 | "$O_CLI -key data_files/server5.key \ |
| 5047 | -cert data_files/server5.eku-cs.crt" \ |
| 5048 | 0 \ |
| 5049 | -s "bad certificate (usage extensions)" \ |
| 5050 | -S "Processing of the Certificate handshake message failed" |
| 5051 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5052 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5053 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5054 | "$O_CLI -key data_files/server5.key \ |
| 5055 | -cert data_files/server5.eku-cs.crt" \ |
| 5056 | 1 \ |
| 5057 | -s "bad certificate (usage extensions)" \ |
| 5058 | -s "Processing of the Certificate handshake message failed" |
| 5059 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5060 | # Tests for DHM parameters loading |
| 5061 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5062 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5063 | "$P_SRV" \ |
| 5064 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5065 | debug_level=3" \ |
| 5066 | 0 \ |
| 5067 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5068 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5069 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5070 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5071 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5072 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5073 | debug_level=3" \ |
| 5074 | 0 \ |
| 5075 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5076 | -c "value of 'DHM: G ' (2 bits)" |
| 5077 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5078 | # Tests for DHM client-side size checking |
| 5079 | |
| 5080 | run_test "DHM size: server default, client default, OK" \ |
| 5081 | "$P_SRV" \ |
| 5082 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5083 | debug_level=1" \ |
| 5084 | 0 \ |
| 5085 | -C "DHM prime too short:" |
| 5086 | |
| 5087 | run_test "DHM size: server default, client 2048, OK" \ |
| 5088 | "$P_SRV" \ |
| 5089 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5090 | debug_level=1 dhmlen=2048" \ |
| 5091 | 0 \ |
| 5092 | -C "DHM prime too short:" |
| 5093 | |
| 5094 | run_test "DHM size: server 1024, client default, OK" \ |
| 5095 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5096 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5097 | debug_level=1" \ |
| 5098 | 0 \ |
| 5099 | -C "DHM prime too short:" |
| 5100 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5101 | run_test "DHM size: server 999, client 999, OK" \ |
| 5102 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5103 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5104 | debug_level=1 dhmlen=999" \ |
| 5105 | 0 \ |
| 5106 | -C "DHM prime too short:" |
| 5107 | |
| 5108 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5109 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5110 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5111 | debug_level=1 dhmlen=1000" \ |
| 5112 | 0 \ |
| 5113 | -C "DHM prime too short:" |
| 5114 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5115 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5116 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5117 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5118 | debug_level=1" \ |
| 5119 | 1 \ |
| 5120 | -c "DHM prime too short:" |
| 5121 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5122 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5123 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5124 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5125 | debug_level=1 dhmlen=1001" \ |
| 5126 | 1 \ |
| 5127 | -c "DHM prime too short:" |
| 5128 | |
| 5129 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5130 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5131 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5132 | debug_level=1 dhmlen=1000" \ |
| 5133 | 1 \ |
| 5134 | -c "DHM prime too short:" |
| 5135 | |
| 5136 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5137 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5138 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5139 | debug_level=1 dhmlen=999" \ |
| 5140 | 1 \ |
| 5141 | -c "DHM prime too short:" |
| 5142 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5143 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5144 | "$P_SRV" \ |
| 5145 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5146 | debug_level=1 dhmlen=2049" \ |
| 5147 | 1 \ |
| 5148 | -c "DHM prime too short:" |
| 5149 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5150 | # Tests for PSK callback |
| 5151 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5152 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5153 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5154 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5155 | psk_identity=foo psk=abc123" \ |
| 5156 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5157 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5158 | -S "SSL - Unknown identity received" \ |
| 5159 | -S "SSL - Verification of the message MAC failed" |
| 5160 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5161 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5162 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5163 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5164 | "$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] | 5165 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5166 | 0 \ |
| 5167 | -c "skip PMS generation for opaque PSK"\ |
| 5168 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5169 | -C "session hash for extended master secret"\ |
| 5170 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5171 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5172 | -S "SSL - Unknown identity received" \ |
| 5173 | -S "SSL - Verification of the message MAC failed" |
| 5174 | |
| 5175 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5176 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5177 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5178 | "$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] | 5179 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5180 | 0 \ |
| 5181 | -c "skip PMS generation for opaque PSK"\ |
| 5182 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5183 | -C "session hash for extended master secret"\ |
| 5184 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5185 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5186 | -S "SSL - Unknown identity received" \ |
| 5187 | -S "SSL - Verification of the message MAC failed" |
| 5188 | |
| 5189 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5190 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5191 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5192 | "$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] | 5193 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5194 | 0 \ |
| 5195 | -c "skip PMS generation for opaque PSK"\ |
| 5196 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5197 | -c "session hash for extended master secret"\ |
| 5198 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5199 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5200 | -S "SSL - Unknown identity received" \ |
| 5201 | -S "SSL - Verification of the message MAC failed" |
| 5202 | |
| 5203 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5204 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5205 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5206 | "$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] | 5207 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5208 | 0 \ |
| 5209 | -c "skip PMS generation for opaque PSK"\ |
| 5210 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5211 | -c "session hash for extended master secret"\ |
| 5212 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5213 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5214 | -S "SSL - Unknown identity received" \ |
| 5215 | -S "SSL - Verification of the message MAC failed" |
| 5216 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5217 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5218 | 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] | 5219 | "$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] | 5220 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5221 | psk_identity=foo psk=abc123" \ |
| 5222 | 0 \ |
| 5223 | -C "skip PMS generation for opaque PSK"\ |
| 5224 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5225 | -C "session hash for extended master secret"\ |
| 5226 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5227 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5228 | -S "SSL - Unknown identity received" \ |
| 5229 | -S "SSL - Verification of the message MAC failed" |
| 5230 | |
| 5231 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5232 | 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] | 5233 | "$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] | 5234 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5235 | psk_identity=foo psk=abc123" \ |
| 5236 | 0 \ |
| 5237 | -C "skip PMS generation for opaque PSK"\ |
| 5238 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5239 | -C "session hash for extended master secret"\ |
| 5240 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5241 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5242 | -S "SSL - Unknown identity received" \ |
| 5243 | -S "SSL - Verification of the message MAC failed" |
| 5244 | |
| 5245 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5246 | 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] | 5247 | "$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] | 5248 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5249 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5250 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5251 | 0 \ |
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"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5254 | -C "skip PMS generation for opaque PSK"\ |
| 5255 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5256 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5257 | -S "SSL - Unknown identity received" \ |
| 5258 | -S "SSL - Verification of the message MAC failed" |
| 5259 | |
| 5260 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5261 | 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] | 5262 | "$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] | 5263 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5264 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5265 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5266 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5267 | -c "session hash for extended master secret"\ |
| 5268 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5269 | -C "skip PMS generation for opaque PSK"\ |
| 5270 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5271 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5272 | -S "SSL - Unknown identity received" \ |
| 5273 | -S "SSL - Verification of the message MAC failed" |
| 5274 | |
| 5275 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5276 | 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] | 5277 | "$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] | 5278 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5279 | psk_identity=def psk=beef" \ |
| 5280 | 0 \ |
| 5281 | -C "skip PMS generation for opaque PSK"\ |
| 5282 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5283 | -C "session hash for extended master secret"\ |
| 5284 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5285 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5286 | -S "SSL - Unknown identity received" \ |
| 5287 | -S "SSL - Verification of the message MAC failed" |
| 5288 | |
| 5289 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5290 | 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] | 5291 | "$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] | 5292 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5293 | psk_identity=def psk=beef" \ |
| 5294 | 0 \ |
| 5295 | -C "skip PMS generation for opaque PSK"\ |
| 5296 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5297 | -C "session hash for extended master secret"\ |
| 5298 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5299 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5300 | -S "SSL - Unknown identity received" \ |
| 5301 | -S "SSL - Verification of the message MAC failed" |
| 5302 | |
| 5303 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5304 | 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] | 5305 | "$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] | 5306 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5307 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5308 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5309 | 0 \ |
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"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5312 | -C "skip PMS generation for opaque PSK"\ |
| 5313 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5314 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5315 | -S "SSL - Unknown identity received" \ |
| 5316 | -S "SSL - Verification of the message MAC failed" |
| 5317 | |
| 5318 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5319 | 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] | 5320 | "$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] | 5321 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5322 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5323 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5324 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5325 | -c "session hash for extended master secret"\ |
| 5326 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5327 | -C "skip PMS generation for opaque PSK"\ |
| 5328 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5329 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5330 | -S "SSL - Unknown identity received" \ |
| 5331 | -S "SSL - Verification of the message MAC failed" |
| 5332 | |
| 5333 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5334 | 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] | 5335 | "$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] | 5336 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5337 | psk_identity=def psk=beef" \ |
| 5338 | 0 \ |
| 5339 | -C "skip PMS generation for opaque PSK"\ |
| 5340 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5341 | -C "session hash for extended master secret"\ |
| 5342 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5343 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5344 | -S "SSL - Unknown identity received" \ |
| 5345 | -S "SSL - Verification of the message MAC failed" |
| 5346 | |
| 5347 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5348 | 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] | 5349 | "$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] | 5350 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5351 | psk_identity=def psk=beef" \ |
| 5352 | 0 \ |
| 5353 | -C "skip PMS generation for opaque PSK"\ |
| 5354 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5355 | -C "session hash for extended master secret"\ |
| 5356 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5357 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5358 | -S "SSL - Unknown identity received" \ |
| 5359 | -S "SSL - Verification of the message MAC failed" |
| 5360 | |
| 5361 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5362 | 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] | 5363 | "$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] | 5364 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5365 | psk_identity=def psk=beef" \ |
| 5366 | 0 \ |
| 5367 | -C "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, id-matching but wrong raw PSK on server, opaque 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=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] | 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, matching opaque PSK on server, wrong 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=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] | 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 | 1 \ |
| 5393 | -s "SSL - Verification of the message MAC failed" |
| 5394 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5395 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5396 | "$P_SRV" \ |
| 5397 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5398 | psk_identity=foo psk=abc123" \ |
| 5399 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5400 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5401 | -S "SSL - Unknown identity received" \ |
| 5402 | -S "SSL - Verification of the message MAC failed" |
| 5403 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5404 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5405 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5406 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5407 | psk_identity=foo psk=abc123" \ |
| 5408 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5409 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5410 | -s "SSL - Unknown identity received" \ |
| 5411 | -S "SSL - Verification of the message MAC failed" |
| 5412 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5413 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5414 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5415 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5416 | psk_identity=abc psk=dead" \ |
| 5417 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5418 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5419 | -S "SSL - Unknown identity received" \ |
| 5420 | -S "SSL - Verification of the message MAC failed" |
| 5421 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5422 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5423 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5424 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5425 | psk_identity=def psk=beef" \ |
| 5426 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5427 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5428 | -S "SSL - Unknown identity received" \ |
| 5429 | -S "SSL - Verification of the message MAC failed" |
| 5430 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5431 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5432 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5433 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5434 | psk_identity=ghi psk=beef" \ |
| 5435 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5436 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5437 | -s "SSL - Unknown identity received" \ |
| 5438 | -S "SSL - Verification of the message MAC failed" |
| 5439 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5440 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5441 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5442 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5443 | psk_identity=abc psk=beef" \ |
| 5444 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5445 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5446 | -S "SSL - Unknown identity received" \ |
| 5447 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5448 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5449 | # Tests for EC J-PAKE |
| 5450 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5451 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5452 | run_test "ECJPAKE: client not configured" \ |
| 5453 | "$P_SRV debug_level=3" \ |
| 5454 | "$P_CLI debug_level=3" \ |
| 5455 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5456 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5457 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5458 | -S "found ecjpake kkpp extension" \ |
| 5459 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5460 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5461 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5462 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5463 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5464 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5465 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5466 | run_test "ECJPAKE: server not configured" \ |
| 5467 | "$P_SRV debug_level=3" \ |
| 5468 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5469 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5470 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5471 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5472 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5473 | -s "found ecjpake kkpp extension" \ |
| 5474 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5475 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5476 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5477 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5478 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5479 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5480 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5481 | run_test "ECJPAKE: working, TLS" \ |
| 5482 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5483 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5484 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5485 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5486 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5487 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5488 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5489 | -s "found ecjpake kkpp extension" \ |
| 5490 | -S "skip ecjpake kkpp extension" \ |
| 5491 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5492 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5493 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5494 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5495 | -S "SSL - Verification of the message MAC failed" |
| 5496 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5497 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5498 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5499 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5500 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5501 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5502 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5503 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5504 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5505 | -s "SSL - Verification of the message MAC failed" |
| 5506 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5507 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5508 | run_test "ECJPAKE: working, DTLS" \ |
| 5509 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5510 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5511 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5512 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5513 | -c "re-using cached ecjpake parameters" \ |
| 5514 | -S "SSL - Verification of the message MAC failed" |
| 5515 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5516 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5517 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5518 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5519 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5520 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5521 | 0 \ |
| 5522 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5523 | -S "SSL - Verification of the message MAC failed" |
| 5524 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5525 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5526 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5527 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5528 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5529 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5530 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5531 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5532 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5533 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5534 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5535 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5536 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5537 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5538 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5539 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5540 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5541 | 0 |
| 5542 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5543 | # Test for ClientHello without extensions |
| 5544 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5545 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5546 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5547 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5548 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5549 | 0 \ |
| 5550 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5551 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5552 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5553 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5554 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5555 | "$P_SRV" \ |
| 5556 | "$P_CLI request_size=100" \ |
| 5557 | 0 \ |
| 5558 | -s "Read from client: 100 bytes read$" |
| 5559 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5560 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5561 | "$P_SRV" \ |
| 5562 | "$P_CLI request_size=500" \ |
| 5563 | 0 \ |
| 5564 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5565 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5566 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5567 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5568 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5569 | "$P_SRV" \ |
| 5570 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5571 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5572 | 0 \ |
| 5573 | -s "Read from client: 1 bytes read" |
| 5574 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5575 | 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] | 5576 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5577 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5578 | 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] | 5579 | 0 \ |
| 5580 | -s "Read from client: 1 bytes read" |
| 5581 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5582 | 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] | 5583 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5584 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5585 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5586 | 0 \ |
| 5587 | -s "Read from client: 1 bytes read" |
| 5588 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5589 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5590 | "$P_SRV" \ |
| 5591 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5592 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5593 | 0 \ |
| 5594 | -s "Read from client: 1 bytes read" |
| 5595 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5596 | 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] | 5597 | "$P_SRV" \ |
| 5598 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5599 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5600 | 0 \ |
| 5601 | -s "Read from client: 1 bytes read" |
| 5602 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5603 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5604 | |
| 5605 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5606 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5607 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5608 | "$P_CLI dtls=1 request_size=1 \ |
| 5609 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5610 | 0 \ |
| 5611 | -s "Read from client: 1 bytes read" |
| 5612 | |
| 5613 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5614 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5615 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5616 | "$P_CLI dtls=1 request_size=1 \ |
| 5617 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5618 | 0 \ |
| 5619 | -s "Read from client: 1 bytes read" |
| 5620 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5621 | # Tests for small server packets |
| 5622 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5623 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5624 | "$P_SRV response_size=1" \ |
| 5625 | "$P_CLI force_version=tls1_2 \ |
| 5626 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5627 | 0 \ |
| 5628 | -c "Read from server: 1 bytes read" |
| 5629 | |
| 5630 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5631 | "$P_SRV response_size=1" \ |
| 5632 | "$P_CLI force_version=tls1_2 \ |
| 5633 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5634 | 0 \ |
| 5635 | -c "Read from server: 1 bytes read" |
| 5636 | |
| 5637 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5638 | "$P_SRV response_size=1" \ |
| 5639 | "$P_CLI force_version=tls1_2 \ |
| 5640 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5641 | 0 \ |
| 5642 | -c "Read from server: 1 bytes read" |
| 5643 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5644 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5645 | "$P_SRV response_size=1" \ |
| 5646 | "$P_CLI force_version=tls1_2 \ |
| 5647 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5648 | 0 \ |
| 5649 | -c "Read from server: 1 bytes read" |
| 5650 | |
| 5651 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5652 | "$P_SRV response_size=1" \ |
| 5653 | "$P_CLI force_version=tls1_2 \ |
| 5654 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5655 | 0 \ |
| 5656 | -c "Read from server: 1 bytes read" |
| 5657 | |
| 5658 | # Tests for small server packets in DTLS |
| 5659 | |
| 5660 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5661 | run_test "Small server packet DTLS 1.2" \ |
| 5662 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5663 | "$P_CLI dtls=1 \ |
| 5664 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5665 | 0 \ |
| 5666 | -c "Read from server: 1 bytes read" |
| 5667 | |
| 5668 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5669 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5670 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5671 | "$P_CLI dtls=1 \ |
| 5672 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5673 | 0 \ |
| 5674 | -c "Read from server: 1 bytes read" |
| 5675 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5676 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5677 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5678 | # How many fragments do we expect to write $1 bytes? |
| 5679 | fragments_for_write() { |
| 5680 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5681 | } |
| 5682 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5683 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5684 | "$P_SRV" \ |
| 5685 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5686 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5687 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5688 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5689 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5690 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5691 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5692 | "$P_SRV" \ |
| 5693 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5694 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5695 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5696 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5697 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5698 | 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] | 5699 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5700 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5701 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5702 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5703 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5704 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5705 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5706 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5707 | "$P_SRV" \ |
| 5708 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5709 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5710 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5711 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5712 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5713 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5714 | 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] | 5715 | "$P_SRV" \ |
| 5716 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5717 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5718 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5719 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5720 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5721 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 5722 | # The tests below fail when the server's OUT_CONTENT_LEN is less than 16384. |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5723 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5724 | "$P_SRV response_size=16384" \ |
| 5725 | "$P_CLI force_version=tls1_2 \ |
| 5726 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5727 | 0 \ |
| 5728 | -c "Read from server: 16384 bytes read" |
| 5729 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5730 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5731 | "$P_SRV response_size=16384" \ |
| 5732 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5733 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5734 | 0 \ |
| 5735 | -s "16384 bytes written in 1 fragments" \ |
| 5736 | -c "Read from server: 16384 bytes read" |
| 5737 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5738 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5739 | "$P_SRV response_size=16384" \ |
| 5740 | "$P_CLI force_version=tls1_2 \ |
| 5741 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5742 | 0 \ |
| 5743 | -c "Read from server: 16384 bytes read" |
| 5744 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5745 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5746 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5747 | "$P_CLI force_version=tls1_2 \ |
| 5748 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5749 | 0 \ |
| 5750 | -s "16384 bytes written in 1 fragments" \ |
| 5751 | -c "Read from server: 16384 bytes read" |
| 5752 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5753 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5754 | "$P_SRV response_size=16384" \ |
| 5755 | "$P_CLI force_version=tls1_2 \ |
| 5756 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5757 | 0 \ |
| 5758 | -c "Read from server: 16384 bytes read" |
| 5759 | |
| 5760 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5761 | "$P_SRV response_size=16384" \ |
| 5762 | "$P_CLI force_version=tls1_2 \ |
| 5763 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5764 | 0 \ |
| 5765 | -c "Read from server: 16384 bytes read" |
| 5766 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5767 | # Tests for restartable ECC |
| 5768 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5769 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 5770 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5771 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5772 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5773 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5774 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5775 | "$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] | 5776 | 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] | 5777 | debug_level=1" \ |
| 5778 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5779 | -C "x509_verify_cert.*4b00" \ |
| 5780 | -C "mbedtls_pk_verify.*4b00" \ |
| 5781 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5782 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5783 | |
| 5784 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5785 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5786 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5787 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5788 | "$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] | 5789 | 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] | 5790 | debug_level=1 ec_max_ops=0" \ |
| 5791 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5792 | -C "x509_verify_cert.*4b00" \ |
| 5793 | -C "mbedtls_pk_verify.*4b00" \ |
| 5794 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5795 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5796 | |
| 5797 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5798 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5799 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5800 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5801 | "$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] | 5802 | 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] | 5803 | debug_level=1 ec_max_ops=65535" \ |
| 5804 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5805 | -C "x509_verify_cert.*4b00" \ |
| 5806 | -C "mbedtls_pk_verify.*4b00" \ |
| 5807 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5808 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5809 | |
| 5810 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5811 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5812 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5813 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5814 | "$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] | 5815 | 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] | 5816 | debug_level=1 ec_max_ops=1000" \ |
| 5817 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5818 | -c "x509_verify_cert.*4b00" \ |
| 5819 | -c "mbedtls_pk_verify.*4b00" \ |
| 5820 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5821 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5822 | |
| 5823 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5824 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5825 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5826 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5827 | crt_file=data_files/server5-badsign.crt \ |
| 5828 | key_file=data_files/server5.key" \ |
| 5829 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5830 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5831 | debug_level=1 ec_max_ops=1000" \ |
| 5832 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5833 | -c "x509_verify_cert.*4b00" \ |
| 5834 | -C "mbedtls_pk_verify.*4b00" \ |
| 5835 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5836 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5837 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5838 | -c "! mbedtls_ssl_handshake returned" \ |
| 5839 | -c "X509 - Certificate verification failed" |
| 5840 | |
| 5841 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5842 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5843 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5844 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5845 | crt_file=data_files/server5-badsign.crt \ |
| 5846 | key_file=data_files/server5.key" \ |
| 5847 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5848 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5849 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 5850 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5851 | -c "x509_verify_cert.*4b00" \ |
| 5852 | -c "mbedtls_pk_verify.*4b00" \ |
| 5853 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5854 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5855 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 5856 | -C "! mbedtls_ssl_handshake returned" \ |
| 5857 | -C "X509 - Certificate verification failed" |
| 5858 | |
| 5859 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5860 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5861 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5862 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5863 | crt_file=data_files/server5-badsign.crt \ |
| 5864 | key_file=data_files/server5.key" \ |
| 5865 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5866 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 5867 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 5868 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5869 | -C "x509_verify_cert.*4b00" \ |
| 5870 | -c "mbedtls_pk_verify.*4b00" \ |
| 5871 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5872 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 5873 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 5874 | -C "! mbedtls_ssl_handshake returned" \ |
| 5875 | -C "X509 - Certificate verification failed" |
| 5876 | |
| 5877 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5878 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5879 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5880 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5881 | "$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] | 5882 | 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] | 5883 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 5884 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5885 | -c "x509_verify_cert.*4b00" \ |
| 5886 | -c "mbedtls_pk_verify.*4b00" \ |
| 5887 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 5888 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5889 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5890 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5891 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5892 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5893 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5894 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 5895 | 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 | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5901 | |
| 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, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5905 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 5906 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 5907 | psk=abc123 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 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5914 | # Tests of asynchronous private key support in SSL |
| 5915 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5916 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5917 | run_test "SSL async private: sign, delay=0" \ |
| 5918 | "$P_SRV \ |
| 5919 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5920 | "$P_CLI" \ |
| 5921 | 0 \ |
| 5922 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5923 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5924 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5925 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5926 | run_test "SSL async private: sign, delay=1" \ |
| 5927 | "$P_SRV \ |
| 5928 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 5929 | "$P_CLI" \ |
| 5930 | 0 \ |
| 5931 | -s "Async sign callback: using key slot " \ |
| 5932 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5933 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5934 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 5935 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 5936 | run_test "SSL async private: sign, delay=2" \ |
| 5937 | "$P_SRV \ |
| 5938 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 5939 | "$P_CLI" \ |
| 5940 | 0 \ |
| 5941 | -s "Async sign callback: using key slot " \ |
| 5942 | -U "Async sign callback: using key slot " \ |
| 5943 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 5944 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5945 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 5946 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5947 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 5948 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 5949 | run_test "SSL async private: sign, SNI" \ |
| 5950 | "$P_SRV debug_level=3 \ |
| 5951 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 5952 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 5953 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 5954 | "$P_CLI server_name=polarssl.example" \ |
| 5955 | 0 \ |
| 5956 | -s "Async sign callback: using key slot " \ |
| 5957 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 5958 | -s "parse ServerName extension" \ |
| 5959 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 5960 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 5961 | |
| 5962 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5963 | run_test "SSL async private: decrypt, delay=0" \ |
| 5964 | "$P_SRV \ |
| 5965 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5966 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5967 | 0 \ |
| 5968 | -s "Async decrypt callback: using key slot " \ |
| 5969 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5970 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5971 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5972 | run_test "SSL async private: decrypt, delay=1" \ |
| 5973 | "$P_SRV \ |
| 5974 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5975 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5976 | 0 \ |
| 5977 | -s "Async decrypt callback: using key slot " \ |
| 5978 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 5979 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5980 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5981 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5982 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 5983 | "$P_SRV psk=abc123 \ |
| 5984 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 5985 | "$P_CLI psk=abc123 \ |
| 5986 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5987 | 0 \ |
| 5988 | -s "Async decrypt callback: using key slot " \ |
| 5989 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 5990 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 5991 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 5992 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 5993 | "$P_SRV psk=abc123 \ |
| 5994 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 5995 | "$P_CLI psk=abc123 \ |
| 5996 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 5997 | 0 \ |
| 5998 | -s "Async decrypt callback: using key slot " \ |
| 5999 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6000 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6001 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6002 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6003 | run_test "SSL async private: sign callback not present" \ |
| 6004 | "$P_SRV \ |
| 6005 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6006 | "$P_CLI; [ \$? -eq 1 ] && |
| 6007 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6008 | 0 \ |
| 6009 | -S "Async sign callback" \ |
| 6010 | -s "! mbedtls_ssl_handshake returned" \ |
| 6011 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6012 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6013 | -s "Successful connection" |
| 6014 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6015 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6016 | run_test "SSL async private: decrypt callback not present" \ |
| 6017 | "$P_SRV debug_level=1 \ |
| 6018 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6019 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6020 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6021 | 0 \ |
| 6022 | -S "Async decrypt callback" \ |
| 6023 | -s "! mbedtls_ssl_handshake returned" \ |
| 6024 | -s "got no RSA private key" \ |
| 6025 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6026 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6027 | |
| 6028 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6029 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6030 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6031 | "$P_SRV \ |
| 6032 | async_operations=s async_private_delay1=1 \ |
| 6033 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6034 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6035 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6036 | 0 \ |
| 6037 | -s "Async sign callback: using key slot 0," \ |
| 6038 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6039 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6040 | |
| 6041 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6042 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6043 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6044 | "$P_SRV \ |
| 6045 | async_operations=s async_private_delay2=1 \ |
| 6046 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6047 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6048 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6049 | 0 \ |
| 6050 | -s "Async sign callback: using key slot 0," \ |
| 6051 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6052 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6053 | |
| 6054 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6055 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6056 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6057 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6058 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6059 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6060 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6061 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6062 | 0 \ |
| 6063 | -s "Async sign callback: using key slot 1," \ |
| 6064 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6065 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6066 | |
| 6067 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6068 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6069 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6070 | "$P_SRV \ |
| 6071 | async_operations=s async_private_delay1=1 \ |
| 6072 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6073 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6074 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6075 | 0 \ |
| 6076 | -s "Async sign callback: no key matches this certificate." |
| 6077 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6078 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6079 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6080 | "$P_SRV \ |
| 6081 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6082 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6083 | "$P_CLI" \ |
| 6084 | 1 \ |
| 6085 | -s "Async sign callback: injected error" \ |
| 6086 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6087 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6088 | -s "! mbedtls_ssl_handshake returned" |
| 6089 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6090 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6091 | run_test "SSL async private: sign, cancel after 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=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6095 | "$P_CLI" \ |
| 6096 | 1 \ |
| 6097 | -s "Async sign callback: using key slot " \ |
| 6098 | -S "Async resume" \ |
| 6099 | -s "Async cancel" |
| 6100 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6101 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6102 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6103 | "$P_SRV \ |
| 6104 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6105 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6106 | "$P_CLI" \ |
| 6107 | 1 \ |
| 6108 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6109 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6110 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6111 | -s "! mbedtls_ssl_handshake returned" |
| 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: decrypt, error in start" \ |
| 6115 | "$P_SRV \ |
| 6116 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6117 | async_private_error=1" \ |
| 6118 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6119 | 1 \ |
| 6120 | -s "Async decrypt callback: injected error" \ |
| 6121 | -S "Async resume" \ |
| 6122 | -S "Async cancel" \ |
| 6123 | -s "! mbedtls_ssl_handshake returned" |
| 6124 | |
| 6125 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6126 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6127 | "$P_SRV \ |
| 6128 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6129 | async_private_error=2" \ |
| 6130 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6131 | 1 \ |
| 6132 | -s "Async decrypt callback: using key slot " \ |
| 6133 | -S "Async resume" \ |
| 6134 | -s "Async cancel" |
| 6135 | |
| 6136 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6137 | run_test "SSL async private: decrypt, error in resume" \ |
| 6138 | "$P_SRV \ |
| 6139 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6140 | async_private_error=3" \ |
| 6141 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6142 | 1 \ |
| 6143 | -s "Async decrypt callback: using key slot " \ |
| 6144 | -s "Async resume callback: decrypt done but injected error" \ |
| 6145 | -S "Async cancel" \ |
| 6146 | -s "! mbedtls_ssl_handshake returned" |
| 6147 | |
| 6148 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6149 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6150 | "$P_SRV \ |
| 6151 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6152 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6153 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6154 | 0 \ |
| 6155 | -s "Async cancel" \ |
| 6156 | -s "! mbedtls_ssl_handshake returned" \ |
| 6157 | -s "Async resume" \ |
| 6158 | -s "Successful connection" |
| 6159 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 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: error in resume 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=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6165 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6166 | 0 \ |
| 6167 | -s "! mbedtls_ssl_handshake returned" \ |
| 6168 | -s "Async resume" \ |
| 6169 | -s "Successful connection" |
| 6170 | |
| 6171 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
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: cancel after start then fall back to transparent key" \ |
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_error=-2 \ |
| 6176 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6177 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6178 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6179 | [ \$? -eq 1 ] && |
| 6180 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6181 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6182 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6183 | -S "Async resume" \ |
| 6184 | -s "Async cancel" \ |
| 6185 | -s "! mbedtls_ssl_handshake returned" \ |
| 6186 | -s "Async sign callback: no key matches this certificate." \ |
| 6187 | -s "Successful connection" |
| 6188 | |
| 6189 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6190 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6191 | 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] | 6192 | "$P_SRV \ |
| 6193 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6194 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6195 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6196 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6197 | [ \$? -eq 1 ] && |
| 6198 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6199 | 0 \ |
| 6200 | -s "Async resume" \ |
| 6201 | -s "! mbedtls_ssl_handshake returned" \ |
| 6202 | -s "Async sign callback: no key matches this certificate." \ |
| 6203 | -s "Successful connection" |
| 6204 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6205 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6206 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6207 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6208 | "$P_SRV \ |
| 6209 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6210 | exchanges=2 renegotiation=1" \ |
| 6211 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6212 | 0 \ |
| 6213 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6214 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6215 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6216 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6217 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6218 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6219 | "$P_SRV \ |
| 6220 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6221 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6222 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6223 | 0 \ |
| 6224 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6225 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6226 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6227 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6228 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6229 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6230 | "$P_SRV \ |
| 6231 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6232 | exchanges=2 renegotiation=1" \ |
| 6233 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6234 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6235 | 0 \ |
| 6236 | -s "Async decrypt callback: using key slot " \ |
| 6237 | -s "Async resume (slot [0-9]): decrypt 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: server-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 renegotiate=1" \ |
| 6245 | "$P_CLI exchanges=2 renegotiation=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" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6250 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6251 | # Tests for ECC extensions (rfc 4492) |
| 6252 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6253 | requires_config_enabled MBEDTLS_AES_C |
| 6254 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6255 | requires_config_enabled MBEDTLS_SHA256_C |
| 6256 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6257 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6258 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6259 | "$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] | 6260 | 0 \ |
| 6261 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6262 | -C "client hello, adding supported_point_formats extension" \ |
| 6263 | -S "found supported elliptic curves extension" \ |
| 6264 | -S "found supported point formats extension" |
| 6265 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6266 | requires_config_enabled MBEDTLS_AES_C |
| 6267 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6268 | requires_config_enabled MBEDTLS_SHA256_C |
| 6269 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6270 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6271 | "$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] | 6272 | "$P_CLI debug_level=3" \ |
| 6273 | 0 \ |
| 6274 | -C "found supported_point_formats extension" \ |
| 6275 | -S "server hello, supported_point_formats extension" |
| 6276 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6277 | requires_config_enabled MBEDTLS_AES_C |
| 6278 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6279 | requires_config_enabled MBEDTLS_SHA256_C |
| 6280 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6281 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6282 | "$P_SRV debug_level=3" \ |
| 6283 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6284 | 0 \ |
| 6285 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6286 | -c "client hello, adding supported_point_formats extension" \ |
| 6287 | -s "found supported elliptic curves extension" \ |
| 6288 | -s "found supported point formats extension" |
| 6289 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6290 | requires_config_enabled MBEDTLS_AES_C |
| 6291 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6292 | requires_config_enabled MBEDTLS_SHA256_C |
| 6293 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6294 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6295 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6296 | "$P_CLI debug_level=3" \ |
| 6297 | 0 \ |
| 6298 | -c "found supported_point_formats extension" \ |
| 6299 | -s "server hello, supported_point_formats extension" |
| 6300 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6301 | # Tests for DTLS HelloVerifyRequest |
| 6302 | |
| 6303 | run_test "DTLS cookie: enabled" \ |
| 6304 | "$P_SRV dtls=1 debug_level=2" \ |
| 6305 | "$P_CLI dtls=1 debug_level=2" \ |
| 6306 | 0 \ |
| 6307 | -s "cookie verification failed" \ |
| 6308 | -s "cookie verification passed" \ |
| 6309 | -S "cookie verification skipped" \ |
| 6310 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6311 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6312 | -S "SSL - The requested feature is not available" |
| 6313 | |
| 6314 | run_test "DTLS cookie: disabled" \ |
| 6315 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6316 | "$P_CLI dtls=1 debug_level=2" \ |
| 6317 | 0 \ |
| 6318 | -S "cookie verification failed" \ |
| 6319 | -S "cookie verification passed" \ |
| 6320 | -s "cookie verification skipped" \ |
| 6321 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6322 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6323 | -S "SSL - The requested feature is not available" |
| 6324 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6325 | run_test "DTLS cookie: default (failing)" \ |
| 6326 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6327 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6328 | 1 \ |
| 6329 | -s "cookie verification failed" \ |
| 6330 | -S "cookie verification passed" \ |
| 6331 | -S "cookie verification skipped" \ |
| 6332 | -C "received hello verify request" \ |
| 6333 | -S "hello verification requested" \ |
| 6334 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6335 | |
| 6336 | requires_ipv6 |
| 6337 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6338 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6339 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6340 | 0 \ |
| 6341 | -s "cookie verification failed" \ |
| 6342 | -s "cookie verification passed" \ |
| 6343 | -S "cookie verification skipped" \ |
| 6344 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6345 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6346 | -S "SSL - The requested feature is not available" |
| 6347 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6348 | run_test "DTLS cookie: enabled, nbio" \ |
| 6349 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6350 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6351 | 0 \ |
| 6352 | -s "cookie verification failed" \ |
| 6353 | -s "cookie verification passed" \ |
| 6354 | -S "cookie verification skipped" \ |
| 6355 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6356 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6357 | -S "SSL - The requested feature is not available" |
| 6358 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6359 | # Tests for client reconnecting from the same port with DTLS |
| 6360 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6361 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6362 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6363 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6364 | "$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] | 6365 | 0 \ |
| 6366 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6367 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6368 | -S "Client initiated reconnection from same port" |
| 6369 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6370 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6371 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6372 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6373 | "$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] | 6374 | 0 \ |
| 6375 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6376 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6377 | -s "Client initiated reconnection from same port" |
| 6378 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6379 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6380 | 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] | 6381 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6382 | "$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] | 6383 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6384 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6385 | -s "Client initiated reconnection from same port" |
| 6386 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6387 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6388 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6389 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6390 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6391 | 0 \ |
| 6392 | -S "The operation timed out" \ |
| 6393 | -s "Client initiated reconnection from same port" |
| 6394 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6395 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6396 | "$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] | 6397 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6398 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6399 | -s "The operation timed out" \ |
| 6400 | -S "Client initiated reconnection from same port" |
| 6401 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6402 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6403 | -p "$P_PXY inject_clihlo=1" \ |
| 6404 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6405 | "$P_CLI dtls=1 exchanges=2" \ |
| 6406 | 0 \ |
| 6407 | -s "possible client reconnect from the same port" \ |
| 6408 | -S "Client initiated reconnection from same port" |
| 6409 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6410 | # Tests for various cases of client authentication with DTLS |
| 6411 | # (focused on handshake flows and message parsing) |
| 6412 | |
| 6413 | run_test "DTLS client auth: required" \ |
| 6414 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6415 | "$P_CLI dtls=1" \ |
| 6416 | 0 \ |
| 6417 | -s "Verifying peer X.509 certificate... ok" |
| 6418 | |
| 6419 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6420 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6421 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6422 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6423 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6424 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6425 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6426 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6427 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6428 | 0 \ |
| 6429 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6430 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6431 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6432 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6433 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6434 | "$P_CLI dtls=1 psk=abc124" \ |
| 6435 | 1 \ |
| 6436 | -s "SSL - Verification of the message MAC failed" \ |
| 6437 | -c "SSL - A fatal alert message was received from our peer" |
| 6438 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6439 | # Tests for receiving fragmented handshake messages with DTLS |
| 6440 | |
| 6441 | requires_gnutls |
| 6442 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6443 | "$G_SRV -u --mtu 2048 -a" \ |
| 6444 | "$P_CLI dtls=1 debug_level=2" \ |
| 6445 | 0 \ |
| 6446 | -C "found fragmented DTLS handshake message" \ |
| 6447 | -C "error" |
| 6448 | |
| 6449 | requires_gnutls |
| 6450 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6451 | "$G_SRV -u --mtu 512" \ |
| 6452 | "$P_CLI dtls=1 debug_level=2" \ |
| 6453 | 0 \ |
| 6454 | -c "found fragmented DTLS handshake message" \ |
| 6455 | -C "error" |
| 6456 | |
| 6457 | requires_gnutls |
| 6458 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6459 | "$G_SRV -u --mtu 128" \ |
| 6460 | "$P_CLI dtls=1 debug_level=2" \ |
| 6461 | 0 \ |
| 6462 | -c "found fragmented DTLS handshake message" \ |
| 6463 | -C "error" |
| 6464 | |
| 6465 | requires_gnutls |
| 6466 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6467 | "$G_SRV -u --mtu 128" \ |
| 6468 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6469 | 0 \ |
| 6470 | -c "found fragmented DTLS handshake message" \ |
| 6471 | -C "error" |
| 6472 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6473 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6474 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6475 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6476 | "$G_SRV -u --mtu 256" \ |
| 6477 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6478 | 0 \ |
| 6479 | -c "found fragmented DTLS handshake message" \ |
| 6480 | -c "client hello, adding renegotiation extension" \ |
| 6481 | -c "found renegotiation extension" \ |
| 6482 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6483 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6484 | -C "error" \ |
| 6485 | -s "Extra-header:" |
| 6486 | |
| 6487 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6488 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6489 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6490 | "$G_SRV -u --mtu 256" \ |
| 6491 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6492 | 0 \ |
| 6493 | -c "found fragmented DTLS handshake message" \ |
| 6494 | -c "client hello, adding renegotiation extension" \ |
| 6495 | -c "found renegotiation extension" \ |
| 6496 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6497 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6498 | -C "error" \ |
| 6499 | -s "Extra-header:" |
| 6500 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6501 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6502 | "$O_SRV -dtls -mtu 2048" \ |
| 6503 | "$P_CLI dtls=1 debug_level=2" \ |
| 6504 | 0 \ |
| 6505 | -C "found fragmented DTLS handshake message" \ |
| 6506 | -C "error" |
| 6507 | |
| 6508 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6509 | "$O_SRV -dtls -mtu 768" \ |
| 6510 | "$P_CLI dtls=1 debug_level=2" \ |
| 6511 | 0 \ |
| 6512 | -c "found fragmented DTLS handshake message" \ |
| 6513 | -C "error" |
| 6514 | |
| 6515 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6516 | "$O_SRV -dtls -mtu 256" \ |
| 6517 | "$P_CLI dtls=1 debug_level=2" \ |
| 6518 | 0 \ |
| 6519 | -c "found fragmented DTLS handshake message" \ |
| 6520 | -C "error" |
| 6521 | |
| 6522 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6523 | "$O_SRV -dtls -mtu 256" \ |
| 6524 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6525 | 0 \ |
| 6526 | -c "found fragmented DTLS handshake message" \ |
| 6527 | -C "error" |
| 6528 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6529 | # Tests for sending fragmented handshake messages with DTLS |
| 6530 | # |
| 6531 | # Use client auth when we need the client to send large messages, |
| 6532 | # and use large cert chains on both sides too (the long chains we have all use |
| 6533 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6534 | # Sizes reached (UDP payload): |
| 6535 | # - 2037B for server certificate |
| 6536 | # - 1542B for client certificate |
| 6537 | # - 1013B for newsessionticket |
| 6538 | # - all others below 512B |
| 6539 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6540 | |
| 6541 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6542 | requires_config_enabled MBEDTLS_RSA_C |
| 6543 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6544 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6545 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6546 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6547 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6548 | crt_file=data_files/server7_int-ca.crt \ |
| 6549 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6550 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6551 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6552 | "$P_CLI dtls=1 debug_level=2 \ |
| 6553 | crt_file=data_files/server8_int-ca2.crt \ |
| 6554 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6555 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6556 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6557 | 0 \ |
| 6558 | -S "found fragmented DTLS handshake message" \ |
| 6559 | -C "found fragmented DTLS handshake message" \ |
| 6560 | -C "error" |
| 6561 | |
| 6562 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6563 | requires_config_enabled MBEDTLS_RSA_C |
| 6564 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6565 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6566 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6567 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6568 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6569 | crt_file=data_files/server7_int-ca.crt \ |
| 6570 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6571 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6572 | max_frag_len=1024" \ |
| 6573 | "$P_CLI dtls=1 debug_level=2 \ |
| 6574 | crt_file=data_files/server8_int-ca2.crt \ |
| 6575 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6576 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6577 | max_frag_len=2048" \ |
| 6578 | 0 \ |
| 6579 | -S "found fragmented DTLS handshake message" \ |
| 6580 | -c "found fragmented DTLS handshake message" \ |
| 6581 | -C "error" |
| 6582 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6583 | # With the MFL extension, the server has no way of forcing |
| 6584 | # the client to not exceed a certain MTU; hence, the following |
| 6585 | # test can't be replicated with an MTU proxy such as the one |
| 6586 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6587 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6588 | requires_config_enabled MBEDTLS_RSA_C |
| 6589 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6590 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6591 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6592 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6593 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6594 | crt_file=data_files/server7_int-ca.crt \ |
| 6595 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6596 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6597 | max_frag_len=512" \ |
| 6598 | "$P_CLI dtls=1 debug_level=2 \ |
| 6599 | crt_file=data_files/server8_int-ca2.crt \ |
| 6600 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6601 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6602 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6603 | 0 \ |
| 6604 | -S "found fragmented DTLS handshake message" \ |
| 6605 | -c "found fragmented DTLS handshake message" \ |
| 6606 | -C "error" |
| 6607 | |
| 6608 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6609 | requires_config_enabled MBEDTLS_RSA_C |
| 6610 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6611 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6612 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6613 | 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] | 6614 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6615 | crt_file=data_files/server7_int-ca.crt \ |
| 6616 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6617 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6618 | max_frag_len=2048" \ |
| 6619 | "$P_CLI dtls=1 debug_level=2 \ |
| 6620 | crt_file=data_files/server8_int-ca2.crt \ |
| 6621 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6622 | hs_timeout=2500-60000 \ |
| 6623 | max_frag_len=1024" \ |
| 6624 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6625 | -S "found fragmented DTLS handshake message" \ |
| 6626 | -c "found fragmented DTLS handshake message" \ |
| 6627 | -C "error" |
| 6628 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6629 | # While not required by the standard defining the MFL extension |
| 6630 | # (according to which it only applies to records, not to datagrams), |
| 6631 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6632 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6633 | # to the peer. |
| 6634 | # The next test checks that no datagrams significantly larger than the |
| 6635 | # negotiated MFL are sent. |
| 6636 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6637 | requires_config_enabled MBEDTLS_RSA_C |
| 6638 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6639 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6640 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6641 | 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] | 6642 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6643 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6644 | crt_file=data_files/server7_int-ca.crt \ |
| 6645 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6646 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6647 | max_frag_len=2048" \ |
| 6648 | "$P_CLI dtls=1 debug_level=2 \ |
| 6649 | crt_file=data_files/server8_int-ca2.crt \ |
| 6650 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6651 | hs_timeout=2500-60000 \ |
| 6652 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6653 | 0 \ |
| 6654 | -S "found fragmented DTLS handshake message" \ |
| 6655 | -c "found fragmented DTLS handshake message" \ |
| 6656 | -C "error" |
| 6657 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6658 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6659 | requires_config_enabled MBEDTLS_RSA_C |
| 6660 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6661 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6662 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6663 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6664 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6665 | crt_file=data_files/server7_int-ca.crt \ |
| 6666 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6667 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6668 | max_frag_len=2048" \ |
| 6669 | "$P_CLI dtls=1 debug_level=2 \ |
| 6670 | crt_file=data_files/server8_int-ca2.crt \ |
| 6671 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6672 | hs_timeout=2500-60000 \ |
| 6673 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6674 | 0 \ |
| 6675 | -s "found fragmented DTLS handshake message" \ |
| 6676 | -c "found fragmented DTLS handshake message" \ |
| 6677 | -C "error" |
| 6678 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6679 | # While not required by the standard defining the MFL extension |
| 6680 | # (according to which it only applies to records, not to datagrams), |
| 6681 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6682 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6683 | # to the peer. |
| 6684 | # The next test checks that no datagrams significantly larger than the |
| 6685 | # negotiated MFL are sent. |
| 6686 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6687 | requires_config_enabled MBEDTLS_RSA_C |
| 6688 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6689 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6690 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6691 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6692 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6693 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6694 | crt_file=data_files/server7_int-ca.crt \ |
| 6695 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6696 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6697 | max_frag_len=2048" \ |
| 6698 | "$P_CLI dtls=1 debug_level=2 \ |
| 6699 | crt_file=data_files/server8_int-ca2.crt \ |
| 6700 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6701 | hs_timeout=2500-60000 \ |
| 6702 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6703 | 0 \ |
| 6704 | -s "found fragmented DTLS handshake message" \ |
| 6705 | -c "found fragmented DTLS handshake message" \ |
| 6706 | -C "error" |
| 6707 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6708 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6709 | requires_config_enabled MBEDTLS_RSA_C |
| 6710 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6711 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6712 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6713 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6714 | crt_file=data_files/server7_int-ca.crt \ |
| 6715 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6716 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6717 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6718 | "$P_CLI dtls=1 debug_level=2 \ |
| 6719 | crt_file=data_files/server8_int-ca2.crt \ |
| 6720 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6721 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6722 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6723 | 0 \ |
| 6724 | -S "found fragmented DTLS handshake message" \ |
| 6725 | -C "found fragmented DTLS handshake message" \ |
| 6726 | -C "error" |
| 6727 | |
| 6728 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6729 | requires_config_enabled MBEDTLS_RSA_C |
| 6730 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6731 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6732 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6733 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6734 | crt_file=data_files/server7_int-ca.crt \ |
| 6735 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6736 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6737 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6738 | "$P_CLI dtls=1 debug_level=2 \ |
| 6739 | crt_file=data_files/server8_int-ca2.crt \ |
| 6740 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6741 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6742 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6743 | 0 \ |
| 6744 | -s "found fragmented DTLS handshake message" \ |
| 6745 | -C "found fragmented DTLS handshake message" \ |
| 6746 | -C "error" |
| 6747 | |
| 6748 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6749 | requires_config_enabled MBEDTLS_RSA_C |
| 6750 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6751 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6752 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6753 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6754 | crt_file=data_files/server7_int-ca.crt \ |
| 6755 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6756 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6757 | mtu=512" \ |
| 6758 | "$P_CLI dtls=1 debug_level=2 \ |
| 6759 | crt_file=data_files/server8_int-ca2.crt \ |
| 6760 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6761 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6762 | mtu=2048" \ |
| 6763 | 0 \ |
| 6764 | -S "found fragmented DTLS handshake message" \ |
| 6765 | -c "found fragmented DTLS handshake message" \ |
| 6766 | -C "error" |
| 6767 | |
| 6768 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6769 | requires_config_enabled MBEDTLS_RSA_C |
| 6770 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6771 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6772 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6773 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6774 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6775 | crt_file=data_files/server7_int-ca.crt \ |
| 6776 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6777 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6778 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6779 | "$P_CLI dtls=1 debug_level=2 \ |
| 6780 | crt_file=data_files/server8_int-ca2.crt \ |
| 6781 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6782 | hs_timeout=2500-60000 \ |
| 6783 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6784 | 0 \ |
| 6785 | -s "found fragmented DTLS handshake message" \ |
| 6786 | -c "found fragmented DTLS handshake message" \ |
| 6787 | -C "error" |
| 6788 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6789 | # 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] | 6790 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6791 | requires_config_enabled MBEDTLS_RSA_C |
| 6792 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6793 | requires_config_enabled MBEDTLS_SHA256_C |
| 6794 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6795 | requires_config_enabled MBEDTLS_AES_C |
| 6796 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6797 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 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 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6829 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 6830 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6831 | -p "$P_PXY mtu=508" \ |
| 6832 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6833 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6834 | key_file=data_files/server7.key \ |
| 6835 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6836 | "$P_CLI dtls=1 debug_level=2 \ |
| 6837 | crt_file=data_files/server8_int-ca2.crt \ |
| 6838 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6839 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6840 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 6841 | 0 \ |
| 6842 | -s "found fragmented DTLS handshake message" \ |
| 6843 | -c "found fragmented DTLS handshake message" \ |
| 6844 | -C "error" |
| 6845 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6846 | # 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] | 6847 | only_with_valgrind |
| 6848 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6849 | requires_config_enabled MBEDTLS_RSA_C |
| 6850 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6851 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6852 | requires_config_enabled MBEDTLS_AES_C |
| 6853 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6854 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 6855 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6856 | -p "$P_PXY mtu=508" \ |
| 6857 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6858 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6859 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6860 | hs_timeout=250-10000" \ |
| 6861 | "$P_CLI dtls=1 debug_level=2 \ |
| 6862 | crt_file=data_files/server8_int-ca2.crt \ |
| 6863 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6864 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 6865 | hs_timeout=250-10000" \ |
| 6866 | 0 \ |
| 6867 | -s "found fragmented DTLS handshake message" \ |
| 6868 | -c "found fragmented DTLS handshake message" \ |
| 6869 | -C "error" |
| 6870 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6871 | # 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] | 6872 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6873 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6874 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6875 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6876 | requires_config_enabled MBEDTLS_RSA_C |
| 6877 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6878 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6879 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6880 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6881 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6882 | crt_file=data_files/server7_int-ca.crt \ |
| 6883 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6884 | hs_timeout=10000-60000 \ |
| 6885 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6886 | "$P_CLI dtls=1 debug_level=2 \ |
| 6887 | crt_file=data_files/server8_int-ca2.crt \ |
| 6888 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6889 | hs_timeout=10000-60000 \ |
| 6890 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6891 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6892 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6893 | -s "found fragmented DTLS handshake message" \ |
| 6894 | -c "found fragmented DTLS handshake message" \ |
| 6895 | -C "error" |
| 6896 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6897 | # 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] | 6898 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 6899 | # OTOH the client might resend if the server is to slow to reset after sending |
| 6900 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6901 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6902 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6903 | requires_config_enabled MBEDTLS_RSA_C |
| 6904 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6905 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6906 | requires_config_enabled MBEDTLS_AES_C |
| 6907 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6908 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6909 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6910 | -p "$P_PXY mtu=512" \ |
| 6911 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6912 | crt_file=data_files/server7_int-ca.crt \ |
| 6913 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6914 | hs_timeout=10000-60000 \ |
| 6915 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6916 | "$P_CLI dtls=1 debug_level=2 \ |
| 6917 | crt_file=data_files/server8_int-ca2.crt \ |
| 6918 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6919 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6920 | hs_timeout=10000-60000 \ |
| 6921 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6922 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6923 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 6924 | -s "found fragmented DTLS handshake message" \ |
| 6925 | -c "found fragmented DTLS handshake message" \ |
| 6926 | -C "error" |
| 6927 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6928 | not_with_valgrind # spurious autoreduction due to timeout |
| 6929 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6930 | requires_config_enabled MBEDTLS_RSA_C |
| 6931 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6932 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6933 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6934 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6935 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6936 | crt_file=data_files/server7_int-ca.crt \ |
| 6937 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6938 | hs_timeout=10000-60000 \ |
| 6939 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6940 | "$P_CLI dtls=1 debug_level=2 \ |
| 6941 | crt_file=data_files/server8_int-ca2.crt \ |
| 6942 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6943 | hs_timeout=10000-60000 \ |
| 6944 | mtu=1024 nbio=2" \ |
| 6945 | 0 \ |
| 6946 | -S "autoreduction" \ |
| 6947 | -s "found fragmented DTLS handshake message" \ |
| 6948 | -c "found fragmented DTLS handshake message" \ |
| 6949 | -C "error" |
| 6950 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6951 | # 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] | 6952 | not_with_valgrind # spurious autoreduction due to timeout |
| 6953 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6954 | requires_config_enabled MBEDTLS_RSA_C |
| 6955 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6956 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6957 | requires_config_enabled MBEDTLS_AES_C |
| 6958 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6959 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6960 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 6961 | -p "$P_PXY mtu=512" \ |
| 6962 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6963 | crt_file=data_files/server7_int-ca.crt \ |
| 6964 | key_file=data_files/server7.key \ |
| 6965 | hs_timeout=10000-60000 \ |
| 6966 | mtu=512 nbio=2" \ |
| 6967 | "$P_CLI dtls=1 debug_level=2 \ |
| 6968 | crt_file=data_files/server8_int-ca2.crt \ |
| 6969 | key_file=data_files/server8.key \ |
| 6970 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6971 | hs_timeout=10000-60000 \ |
| 6972 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6973 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6974 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 6975 | -s "found fragmented DTLS handshake message" \ |
| 6976 | -c "found fragmented DTLS handshake message" \ |
| 6977 | -C "error" |
| 6978 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6979 | # 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] | 6980 | # This ensures things still work after session_reset(). |
| 6981 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6982 | # Since we don't support reading fragmented ClientHello yet, |
| 6983 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 6984 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6985 | # An autoreduction on the client-side might happen if the server is |
| 6986 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 6987 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 6988 | # resumed listening, which would result in a spurious autoreduction. |
| 6989 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6990 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6991 | requires_config_enabled MBEDTLS_RSA_C |
| 6992 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6993 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 6994 | requires_config_enabled MBEDTLS_AES_C |
| 6995 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 6996 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 6997 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 6998 | -p "$P_PXY mtu=1450" \ |
| 6999 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7000 | crt_file=data_files/server7_int-ca.crt \ |
| 7001 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7002 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7003 | mtu=1450" \ |
| 7004 | "$P_CLI dtls=1 debug_level=2 \ |
| 7005 | crt_file=data_files/server8_int-ca2.crt \ |
| 7006 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7007 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7008 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7009 | 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] | 7010 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7011 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7012 | -s "found fragmented DTLS handshake message" \ |
| 7013 | -c "found fragmented DTLS handshake message" \ |
| 7014 | -C "error" |
| 7015 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7016 | # An autoreduction on the client-side might happen if the server is |
| 7017 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7018 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7019 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7020 | requires_config_enabled MBEDTLS_RSA_C |
| 7021 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7022 | requires_config_enabled MBEDTLS_SHA256_C |
| 7023 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7024 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7025 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7026 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7027 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7028 | -p "$P_PXY mtu=512" \ |
| 7029 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7030 | crt_file=data_files/server7_int-ca.crt \ |
| 7031 | key_file=data_files/server7.key \ |
| 7032 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7033 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7034 | mtu=512" \ |
| 7035 | "$P_CLI dtls=1 debug_level=2 \ |
| 7036 | crt_file=data_files/server8_int-ca2.crt \ |
| 7037 | key_file=data_files/server8.key \ |
| 7038 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7039 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7040 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7041 | mtu=512" \ |
| 7042 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7043 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7044 | -s "found fragmented DTLS handshake message" \ |
| 7045 | -c "found fragmented DTLS handshake message" \ |
| 7046 | -C "error" |
| 7047 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7048 | # An autoreduction on the client-side might happen if the server is |
| 7049 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7050 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7051 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7052 | requires_config_enabled MBEDTLS_RSA_C |
| 7053 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7054 | requires_config_enabled MBEDTLS_SHA256_C |
| 7055 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7056 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7057 | requires_config_enabled MBEDTLS_AES_C |
| 7058 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7059 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7060 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7061 | -p "$P_PXY mtu=512" \ |
| 7062 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7063 | crt_file=data_files/server7_int-ca.crt \ |
| 7064 | key_file=data_files/server7.key \ |
| 7065 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7066 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7067 | mtu=512" \ |
| 7068 | "$P_CLI dtls=1 debug_level=2 \ |
| 7069 | crt_file=data_files/server8_int-ca2.crt \ |
| 7070 | key_file=data_files/server8.key \ |
| 7071 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7072 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7073 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7074 | mtu=512" \ |
| 7075 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7076 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7077 | -s "found fragmented DTLS handshake message" \ |
| 7078 | -c "found fragmented DTLS handshake message" \ |
| 7079 | -C "error" |
| 7080 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7081 | # An autoreduction on the client-side might happen if the server is |
| 7082 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7083 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7084 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7085 | requires_config_enabled MBEDTLS_RSA_C |
| 7086 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7087 | requires_config_enabled MBEDTLS_SHA256_C |
| 7088 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7089 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7090 | requires_config_enabled MBEDTLS_AES_C |
| 7091 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7092 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7093 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7094 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7095 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7096 | crt_file=data_files/server7_int-ca.crt \ |
| 7097 | key_file=data_files/server7.key \ |
| 7098 | exchanges=2 renegotiation=1 \ |
| 7099 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7100 | hs_timeout=10000-60000 \ |
| 7101 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7102 | "$P_CLI dtls=1 debug_level=2 \ |
| 7103 | crt_file=data_files/server8_int-ca2.crt \ |
| 7104 | key_file=data_files/server8.key \ |
| 7105 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7106 | hs_timeout=10000-60000 \ |
| 7107 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7108 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7109 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7110 | -s "found fragmented DTLS handshake message" \ |
| 7111 | -c "found fragmented DTLS handshake message" \ |
| 7112 | -C "error" |
| 7113 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7114 | # An autoreduction on the client-side might happen if the server is |
| 7115 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7116 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7117 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7118 | requires_config_enabled MBEDTLS_RSA_C |
| 7119 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7120 | requires_config_enabled MBEDTLS_SHA256_C |
| 7121 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7122 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7123 | requires_config_enabled MBEDTLS_AES_C |
| 7124 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7125 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7126 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7127 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7128 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7129 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7130 | crt_file=data_files/server7_int-ca.crt \ |
| 7131 | key_file=data_files/server7.key \ |
| 7132 | exchanges=2 renegotiation=1 \ |
| 7133 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7134 | hs_timeout=10000-60000 \ |
| 7135 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7136 | "$P_CLI dtls=1 debug_level=2 \ |
| 7137 | crt_file=data_files/server8_int-ca2.crt \ |
| 7138 | key_file=data_files/server8.key \ |
| 7139 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7140 | hs_timeout=10000-60000 \ |
| 7141 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7142 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7143 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7144 | -s "found fragmented DTLS handshake message" \ |
| 7145 | -c "found fragmented DTLS handshake message" \ |
| 7146 | -C "error" |
| 7147 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7148 | # An autoreduction on the client-side might happen if the server is |
| 7149 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7150 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7151 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7152 | requires_config_enabled MBEDTLS_RSA_C |
| 7153 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7154 | requires_config_enabled MBEDTLS_SHA256_C |
| 7155 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7156 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7157 | requires_config_enabled MBEDTLS_AES_C |
| 7158 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7159 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7160 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7161 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7162 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7163 | crt_file=data_files/server7_int-ca.crt \ |
| 7164 | key_file=data_files/server7.key \ |
| 7165 | exchanges=2 renegotiation=1 \ |
| 7166 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7167 | hs_timeout=10000-60000 \ |
| 7168 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7169 | "$P_CLI dtls=1 debug_level=2 \ |
| 7170 | crt_file=data_files/server8_int-ca2.crt \ |
| 7171 | key_file=data_files/server8.key \ |
| 7172 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7173 | hs_timeout=10000-60000 \ |
| 7174 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7175 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7176 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7177 | -s "found fragmented DTLS handshake message" \ |
| 7178 | -c "found fragmented DTLS handshake message" \ |
| 7179 | -C "error" |
| 7180 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7181 | # 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] | 7182 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7183 | requires_config_enabled MBEDTLS_RSA_C |
| 7184 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7185 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7186 | requires_config_enabled MBEDTLS_AES_C |
| 7187 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7188 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7189 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7190 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7191 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7192 | "$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] | 7193 | crt_file=data_files/server7_int-ca.crt \ |
| 7194 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7195 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7196 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7197 | crt_file=data_files/server8_int-ca2.crt \ |
| 7198 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7199 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7200 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7201 | 0 \ |
| 7202 | -s "found fragmented DTLS handshake message" \ |
| 7203 | -c "found fragmented DTLS handshake message" \ |
| 7204 | -C "error" |
| 7205 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7206 | # 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] | 7207 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7208 | requires_config_enabled MBEDTLS_RSA_C |
| 7209 | requires_config_enabled MBEDTLS_ECDSA_C |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7210 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA |
| 7211 | requires_config_enabled MBEDTLS_AES_C |
| 7212 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7213 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7214 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7215 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7216 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7217 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7218 | crt_file=data_files/server7_int-ca.crt \ |
| 7219 | key_file=data_files/server7.key \ |
| 7220 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7221 | "$P_CLI dtls=1 debug_level=2 \ |
| 7222 | crt_file=data_files/server8_int-ca2.crt \ |
| 7223 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7224 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7225 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7226 | 0 \ |
| 7227 | -s "found fragmented DTLS handshake message" \ |
| 7228 | -c "found fragmented DTLS handshake message" \ |
| 7229 | -C "error" |
| 7230 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7231 | # interop tests for DTLS fragmentating with reliable connection |
| 7232 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7233 | # here and below we just want to test that the we fragment in a way that |
| 7234 | # pleases other implementations, so we don't need the peer to fragment |
| 7235 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7236 | requires_config_enabled MBEDTLS_RSA_C |
| 7237 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7238 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7239 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7240 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7241 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7242 | "$G_SRV -u" \ |
| 7243 | "$P_CLI dtls=1 debug_level=2 \ |
| 7244 | crt_file=data_files/server8_int-ca2.crt \ |
| 7245 | key_file=data_files/server8.key \ |
| 7246 | mtu=512 force_version=dtls1_2" \ |
| 7247 | 0 \ |
| 7248 | -c "fragmenting handshake message" \ |
| 7249 | -C "error" |
| 7250 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7251 | # We use --insecure for the GnuTLS client because it expects |
| 7252 | # the hostname / IP it connects to to be the name used in the |
| 7253 | # certificate obtained from the server. Here, however, it |
| 7254 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7255 | # as the server name in the certificate. This will make the |
| 7256 | # certifiate validation fail, but passing --insecure makes |
| 7257 | # GnuTLS continue the connection nonetheless. |
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 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7262 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7263 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7264 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7265 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7266 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7267 | crt_file=data_files/server7_int-ca.crt \ |
| 7268 | key_file=data_files/server7.key \ |
| 7269 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7270 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7271 | 0 \ |
| 7272 | -s "fragmenting handshake message" |
| 7273 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7274 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7275 | requires_config_enabled MBEDTLS_RSA_C |
| 7276 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7277 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7278 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7279 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7280 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7281 | "$P_CLI dtls=1 debug_level=2 \ |
| 7282 | crt_file=data_files/server8_int-ca2.crt \ |
| 7283 | key_file=data_files/server8.key \ |
| 7284 | mtu=512 force_version=dtls1_2" \ |
| 7285 | 0 \ |
| 7286 | -c "fragmenting handshake message" \ |
| 7287 | -C "error" |
| 7288 | |
| 7289 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7290 | requires_config_enabled MBEDTLS_RSA_C |
| 7291 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7292 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7293 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7294 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7295 | "$P_SRV dtls=1 debug_level=2 \ |
| 7296 | crt_file=data_files/server7_int-ca.crt \ |
| 7297 | key_file=data_files/server7.key \ |
| 7298 | mtu=512 force_version=dtls1_2" \ |
| 7299 | "$O_CLI -dtls1_2" \ |
| 7300 | 0 \ |
| 7301 | -s "fragmenting handshake message" |
| 7302 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7303 | # interop tests for DTLS fragmentating with unreliable connection |
| 7304 | # |
| 7305 | # again we just want to test that the we fragment in a way that |
| 7306 | # pleases other implementations, so we don't need the peer to fragment |
| 7307 | requires_gnutls_next |
| 7308 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7309 | requires_config_enabled MBEDTLS_RSA_C |
| 7310 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7311 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7312 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7313 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7314 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7315 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7316 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7317 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7318 | crt_file=data_files/server8_int-ca2.crt \ |
| 7319 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7320 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7321 | 0 \ |
| 7322 | -c "fragmenting handshake message" \ |
| 7323 | -C "error" |
| 7324 | |
| 7325 | requires_gnutls_next |
| 7326 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7327 | requires_config_enabled MBEDTLS_RSA_C |
| 7328 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7329 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7330 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7331 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7332 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7333 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7334 | "$P_SRV dtls=1 debug_level=2 \ |
| 7335 | crt_file=data_files/server7_int-ca.crt \ |
| 7336 | key_file=data_files/server7.key \ |
| 7337 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7338 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7339 | 0 \ |
| 7340 | -s "fragmenting handshake message" |
| 7341 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7342 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7343 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7344 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7345 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7346 | ## (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] | 7347 | skip_next_test |
| 7348 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7349 | requires_config_enabled MBEDTLS_RSA_C |
| 7350 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7351 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7352 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7353 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7354 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7355 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7356 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7357 | "$P_CLI dtls=1 debug_level=2 \ |
| 7358 | crt_file=data_files/server8_int-ca2.crt \ |
| 7359 | key_file=data_files/server8.key \ |
| 7360 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7361 | 0 \ |
| 7362 | -c "fragmenting handshake message" \ |
| 7363 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7364 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7365 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7366 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7367 | requires_config_enabled MBEDTLS_RSA_C |
| 7368 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7369 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7370 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 7371 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7372 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7373 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7374 | "$P_SRV dtls=1 debug_level=2 \ |
| 7375 | crt_file=data_files/server7_int-ca.crt \ |
| 7376 | key_file=data_files/server7.key \ |
| 7377 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7378 | "$O_CLI -dtls1_2" \ |
| 7379 | 0 \ |
| 7380 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7381 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7382 | # Tests for DTLS-SRTP (RFC 5764) |
| 7383 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7384 | run_test "DTLS-SRTP all profiles supported" \ |
| 7385 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7386 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7387 | 0 \ |
| 7388 | -s "found use_srtp extension" \ |
| 7389 | -s "found srtp profile" \ |
| 7390 | -s "selected srtp profile" \ |
| 7391 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7392 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7393 | -c "client hello, adding use_srtp extension" \ |
| 7394 | -c "found use_srtp extension" \ |
| 7395 | -c "found srtp profile" \ |
| 7396 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7397 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7398 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7399 | -C "error" |
| 7400 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7401 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7402 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7403 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7404 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7405 | "$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] | 7406 | 0 \ |
| 7407 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7408 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7409 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7410 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7411 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7412 | -c "client hello, adding use_srtp extension" \ |
| 7413 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7414 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7415 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7416 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7417 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7418 | -C "error" |
| 7419 | |
| 7420 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7421 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7422 | "$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] | 7423 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7424 | 0 \ |
| 7425 | -s "found use_srtp extension" \ |
| 7426 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7427 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7428 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7429 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7430 | -c "client hello, adding use_srtp extension" \ |
| 7431 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7432 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7433 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7434 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7435 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7436 | -C "error" |
| 7437 | |
| 7438 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7439 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7440 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7441 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7442 | 0 \ |
| 7443 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7444 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7445 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7446 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7447 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7448 | -c "client hello, adding use_srtp extension" \ |
| 7449 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7450 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7451 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7452 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7453 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7454 | -C "error" |
| 7455 | |
| 7456 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7457 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7458 | "$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] | 7459 | "$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] | 7460 | 0 \ |
| 7461 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7462 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7463 | -S "selected srtp profile" \ |
| 7464 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7465 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7466 | -c "client hello, adding use_srtp extension" \ |
| 7467 | -C "found use_srtp extension" \ |
| 7468 | -C "found srtp profile" \ |
| 7469 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7470 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7471 | -C "error" |
| 7472 | |
| 7473 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7474 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7475 | "$P_SRV dtls=1 debug_level=3" \ |
| 7476 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7477 | 0 \ |
| 7478 | -s "found use_srtp extension" \ |
| 7479 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7480 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7481 | -c "client hello, adding use_srtp extension" \ |
| 7482 | -C "found use_srtp extension" \ |
| 7483 | -C "found srtp profile" \ |
| 7484 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7485 | -C "DTLS-SRTP key material is"\ |
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. mki used" \ |
| 7490 | "$P_SRV dtls=1 use_srtp=1 support_mki=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" \ |
| 7497 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7498 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7499 | -c "client hello, adding use_srtp extension" \ |
| 7500 | -c "found use_srtp extension" \ |
| 7501 | -c "found srtp profile" \ |
| 7502 | -c "selected srtp profile" \ |
| 7503 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7504 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7505 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7506 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7507 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7508 | -C "error" |
| 7509 | |
| 7510 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7511 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7512 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7513 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7514 | 0 \ |
| 7515 | -s "found use_srtp extension" \ |
| 7516 | -s "found srtp profile" \ |
| 7517 | -s "selected srtp profile" \ |
| 7518 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7519 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7520 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7521 | -S "dumping 'using mki' (8 bytes)" \ |
| 7522 | -c "client hello, adding use_srtp extension" \ |
| 7523 | -c "found use_srtp extension" \ |
| 7524 | -c "found srtp profile" \ |
| 7525 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7526 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7527 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7528 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7529 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7530 | -C "dumping 'received mki' (8 bytes)" \ |
| 7531 | -C "error" |
| 7532 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7533 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7534 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7535 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7536 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7537 | 0 \ |
| 7538 | -s "found use_srtp extension" \ |
| 7539 | -s "found srtp profile" \ |
| 7540 | -s "selected srtp profile" \ |
| 7541 | -s "server hello, adding use_srtp extension" \ |
| 7542 | -s "DTLS-SRTP key material is"\ |
| 7543 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7544 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7545 | |
| 7546 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7547 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7548 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7549 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7550 | 0 \ |
| 7551 | -s "found use_srtp extension" \ |
| 7552 | -s "found srtp profile" \ |
| 7553 | -s "selected srtp profile" \ |
| 7554 | -s "server hello, adding use_srtp extension" \ |
| 7555 | -s "DTLS-SRTP key material is"\ |
| 7556 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7557 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7558 | |
| 7559 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7560 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7561 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7562 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7563 | 0 \ |
| 7564 | -s "found use_srtp extension" \ |
| 7565 | -s "found srtp profile" \ |
| 7566 | -s "selected srtp profile" \ |
| 7567 | -s "server hello, adding use_srtp extension" \ |
| 7568 | -s "DTLS-SRTP key material is"\ |
| 7569 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7570 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7571 | |
| 7572 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7573 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7574 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7575 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7576 | 0 \ |
| 7577 | -s "found use_srtp extension" \ |
| 7578 | -s "found srtp profile" \ |
| 7579 | -s "selected srtp profile" \ |
| 7580 | -s "server hello, adding use_srtp extension" \ |
| 7581 | -s "DTLS-SRTP key material is"\ |
| 7582 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7583 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7584 | |
| 7585 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7586 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7587 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7588 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7589 | 0 \ |
| 7590 | -s "found use_srtp extension" \ |
| 7591 | -s "found srtp profile" \ |
| 7592 | -s "selected srtp profile" \ |
| 7593 | -s "server hello, adding use_srtp extension" \ |
| 7594 | -s "DTLS-SRTP key material is"\ |
| 7595 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7596 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7597 | |
| 7598 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7599 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7600 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7601 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7602 | 0 \ |
| 7603 | -s "found use_srtp extension" \ |
| 7604 | -s "found srtp profile" \ |
| 7605 | -S "selected srtp profile" \ |
| 7606 | -S "server hello, adding use_srtp extension" \ |
| 7607 | -S "DTLS-SRTP key material is"\ |
| 7608 | -C "SRTP Extension negotiated, profile" |
| 7609 | |
| 7610 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7611 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7612 | "$P_SRV dtls=1 debug_level=3" \ |
| 7613 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7614 | 0 \ |
| 7615 | -s "found use_srtp extension" \ |
| 7616 | -S "server hello, adding use_srtp extension" \ |
| 7617 | -S "DTLS-SRTP key material is"\ |
| 7618 | -C "SRTP Extension negotiated, profile" |
| 7619 | |
| 7620 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7621 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7622 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7623 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7624 | 0 \ |
| 7625 | -c "client hello, adding use_srtp extension" \ |
| 7626 | -c "found use_srtp extension" \ |
| 7627 | -c "found srtp profile" \ |
| 7628 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7629 | -c "DTLS-SRTP key material is"\ |
| 7630 | -C "error" |
| 7631 | |
| 7632 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7633 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7634 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7635 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7636 | 0 \ |
| 7637 | -c "client hello, adding use_srtp extension" \ |
| 7638 | -c "found use_srtp extension" \ |
| 7639 | -c "found srtp profile" \ |
| 7640 | -c "selected srtp profile" \ |
| 7641 | -c "DTLS-SRTP key material is"\ |
| 7642 | -C "error" |
| 7643 | |
| 7644 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7645 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7646 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7647 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7648 | 0 \ |
| 7649 | -c "client hello, adding use_srtp extension" \ |
| 7650 | -c "found use_srtp extension" \ |
| 7651 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7652 | -c "selected srtp profile" \ |
| 7653 | -c "DTLS-SRTP key material is"\ |
| 7654 | -C "error" |
| 7655 | |
| 7656 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7657 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7658 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7659 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7660 | 0 \ |
| 7661 | -c "client hello, adding use_srtp extension" \ |
| 7662 | -c "found use_srtp extension" \ |
| 7663 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7664 | -c "selected srtp profile" \ |
| 7665 | -c "DTLS-SRTP key material is"\ |
| 7666 | -C "error" |
| 7667 | |
| 7668 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7669 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7670 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7671 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7672 | 0 \ |
| 7673 | -c "client hello, adding use_srtp extension" \ |
| 7674 | -c "found use_srtp extension" \ |
| 7675 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7676 | -c "selected srtp profile" \ |
| 7677 | -c "DTLS-SRTP key material is"\ |
| 7678 | -C "error" |
| 7679 | |
| 7680 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7681 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 7682 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7683 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 7684 | 0 \ |
| 7685 | -c "client hello, adding use_srtp extension" \ |
| 7686 | -C "found use_srtp extension" \ |
| 7687 | -C "found srtp profile" \ |
| 7688 | -C "selected srtp profile" \ |
| 7689 | -C "DTLS-SRTP key material is"\ |
| 7690 | -C "error" |
| 7691 | |
| 7692 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7693 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 7694 | "$O_SRV -dtls" \ |
| 7695 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7696 | 0 \ |
| 7697 | -c "client hello, adding use_srtp extension" \ |
| 7698 | -C "found use_srtp extension" \ |
| 7699 | -C "found srtp profile" \ |
| 7700 | -C "selected srtp profile" \ |
| 7701 | -C "DTLS-SRTP key material is"\ |
| 7702 | -C "error" |
| 7703 | |
| 7704 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7705 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 7706 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7707 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7708 | 0 \ |
| 7709 | -c "client hello, adding use_srtp extension" \ |
| 7710 | -c "found use_srtp extension" \ |
| 7711 | -c "found srtp profile" \ |
| 7712 | -c "selected srtp profile" \ |
| 7713 | -c "DTLS-SRTP key material is"\ |
| 7714 | -c "DTLS-SRTP no mki value negotiated"\ |
| 7715 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7716 | -C "dumping 'received mki' (8 bytes)" \ |
| 7717 | -C "error" |
| 7718 | |
| 7719 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7720 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7721 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7722 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7723 | "$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] | 7724 | 0 \ |
| 7725 | -s "found use_srtp extension" \ |
| 7726 | -s "found srtp profile" \ |
| 7727 | -s "selected srtp profile" \ |
| 7728 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7729 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7730 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 7731 | |
| 7732 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7733 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7734 | 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] | 7735 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7736 | "$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] | 7737 | 0 \ |
| 7738 | -s "found use_srtp extension" \ |
| 7739 | -s "found srtp profile" \ |
| 7740 | -s "selected srtp profile" \ |
| 7741 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7742 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7743 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 7744 | |
| 7745 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7746 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7747 | 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] | 7748 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7749 | "$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] | 7750 | 0 \ |
| 7751 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7752 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7753 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7754 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7755 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7756 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7757 | |
| 7758 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7759 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7760 | 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] | 7761 | "$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] | 7762 | "$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] | 7763 | 0 \ |
| 7764 | -s "found use_srtp extension" \ |
| 7765 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7766 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7767 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7768 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7769 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 7770 | |
| 7771 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7772 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7773 | 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] | 7774 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7775 | "$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] | 7776 | 0 \ |
| 7777 | -s "found use_srtp extension" \ |
| 7778 | -s "found srtp profile" \ |
| 7779 | -s "selected srtp profile" \ |
| 7780 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7781 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7782 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7783 | |
| 7784 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7785 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7786 | 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] | 7787 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7788 | "$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] | 7789 | 0 \ |
| 7790 | -s "found use_srtp extension" \ |
| 7791 | -s "found srtp profile" \ |
| 7792 | -S "selected srtp profile" \ |
| 7793 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7794 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7795 | -C "SRTP profile:" |
| 7796 | |
| 7797 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7798 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7799 | 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] | 7800 | "$P_SRV dtls=1 debug_level=3" \ |
| 7801 | "$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] | 7802 | 0 \ |
| 7803 | -s "found use_srtp extension" \ |
| 7804 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7805 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7806 | -C "SRTP profile:" |
| 7807 | |
| 7808 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7809 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7810 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 7811 | "$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" \ |
| 7812 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7813 | 0 \ |
| 7814 | -c "client hello, adding use_srtp extension" \ |
| 7815 | -c "found use_srtp extension" \ |
| 7816 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7817 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7818 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7819 | -C "error" |
| 7820 | |
| 7821 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7822 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7823 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 7824 | "$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" \ |
| 7825 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7826 | 0 \ |
| 7827 | -c "client hello, adding use_srtp extension" \ |
| 7828 | -c "found use_srtp extension" \ |
| 7829 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7830 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7831 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7832 | -C "error" |
| 7833 | |
| 7834 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7835 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7836 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 7837 | "$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" \ |
| 7838 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7839 | 0 \ |
| 7840 | -c "client hello, adding use_srtp extension" \ |
| 7841 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7842 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7843 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7844 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7845 | -C "error" |
| 7846 | |
| 7847 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7848 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7849 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 7850 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7851 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7852 | 0 \ |
| 7853 | -c "client hello, adding use_srtp extension" \ |
| 7854 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7855 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7856 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7857 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7858 | -C "error" |
| 7859 | |
| 7860 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7861 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7862 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 7863 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7864 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7865 | 0 \ |
| 7866 | -c "client hello, adding use_srtp extension" \ |
| 7867 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7868 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7869 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7870 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7871 | -C "error" |
| 7872 | |
| 7873 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7874 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7875 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 7876 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7877 | "$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] | 7878 | 0 \ |
| 7879 | -c "client hello, adding use_srtp extension" \ |
| 7880 | -C "found use_srtp extension" \ |
| 7881 | -C "found srtp profile" \ |
| 7882 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7883 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7884 | -C "error" |
| 7885 | |
| 7886 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7887 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7888 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 7889 | "$G_SRV -u" \ |
| 7890 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7891 | 0 \ |
| 7892 | -c "client hello, adding use_srtp extension" \ |
| 7893 | -C "found use_srtp extension" \ |
| 7894 | -C "found srtp profile" \ |
| 7895 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7896 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7897 | -C "error" |
| 7898 | |
| 7899 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7900 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7901 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 7902 | "$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" \ |
| 7903 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7904 | 0 \ |
| 7905 | -c "client hello, adding use_srtp extension" \ |
| 7906 | -c "found use_srtp extension" \ |
| 7907 | -c "found srtp profile" \ |
| 7908 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7909 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7910 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7911 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7912 | -c "dumping 'received mki' (8 bytes)" \ |
| 7913 | -C "error" |
| 7914 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 7915 | # Tests for specific things with "unreliable" UDP connection |
| 7916 | |
| 7917 | not_with_valgrind # spurious resend due to timeout |
| 7918 | run_test "DTLS proxy: reference" \ |
| 7919 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7920 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 7921 | "$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] | 7922 | 0 \ |
| 7923 | -C "replayed record" \ |
| 7924 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 7925 | -C "Buffer record from epoch" \ |
| 7926 | -S "Buffer record from epoch" \ |
| 7927 | -C "ssl_buffer_message" \ |
| 7928 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 7929 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7930 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7931 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7932 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 7933 | -c "HTTP/1.0 200 OK" |
| 7934 | |
| 7935 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 7936 | run_test "DTLS proxy: duplicate every packet" \ |
| 7937 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 7938 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 7939 | "$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] | 7940 | 0 \ |
| 7941 | -c "replayed record" \ |
| 7942 | -s "replayed record" \ |
| 7943 | -c "record from another epoch" \ |
| 7944 | -s "record from another epoch" \ |
| 7945 | -S "resend" \ |
| 7946 | -s "Extra-header:" \ |
| 7947 | -c "HTTP/1.0 200 OK" |
| 7948 | |
| 7949 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 7950 | -p "$P_PXY 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 anti_replay=0" \ |
| 7952 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7953 | 0 \ |
| 7954 | -c "replayed record" \ |
| 7955 | -S "replayed record" \ |
| 7956 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7957 | -s "record from another epoch" \ |
| 7958 | -c "resend" \ |
| 7959 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7960 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7961 | -c "HTTP/1.0 200 OK" |
| 7962 | |
| 7963 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 7964 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7965 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7966 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7967 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7968 | -c "next record in same datagram" \ |
| 7969 | -s "next record in same datagram" |
| 7970 | |
| 7971 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 7972 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7973 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 7974 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7975 | 0 \ |
| 7976 | -c "next record in same datagram" \ |
| 7977 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7978 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7979 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 7980 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7981 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 7982 | "$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] | 7983 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7984 | -c "discarding invalid record (mac)" \ |
| 7985 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7986 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7987 | -c "HTTP/1.0 200 OK" \ |
| 7988 | -S "too many records with bad MAC" \ |
| 7989 | -S "Verification of the message MAC failed" |
| 7990 | |
| 7991 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 7992 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7993 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 7994 | "$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] | 7995 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7996 | -C "discarding invalid record (mac)" \ |
| 7997 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7998 | -S "Extra-header:" \ |
| 7999 | -C "HTTP/1.0 200 OK" \ |
| 8000 | -s "too many records with bad MAC" \ |
| 8001 | -s "Verification of the message MAC failed" |
| 8002 | |
| 8003 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8004 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8005 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8006 | "$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] | 8007 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8008 | -c "discarding invalid record (mac)" \ |
| 8009 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8010 | -s "Extra-header:" \ |
| 8011 | -c "HTTP/1.0 200 OK" \ |
| 8012 | -S "too many records with bad MAC" \ |
| 8013 | -S "Verification of the message MAC failed" |
| 8014 | |
| 8015 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8016 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8017 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8018 | "$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] | 8019 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8020 | -c "discarding invalid record (mac)" \ |
| 8021 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8022 | -s "Extra-header:" \ |
| 8023 | -c "HTTP/1.0 200 OK" \ |
| 8024 | -s "too many records with bad MAC" \ |
| 8025 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8026 | |
| 8027 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8028 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8029 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8030 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8031 | 0 \ |
| 8032 | -c "record from another epoch" \ |
| 8033 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8034 | -s "Extra-header:" \ |
| 8035 | -c "HTTP/1.0 200 OK" |
| 8036 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8037 | # Tests for reordering support with DTLS |
| 8038 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8039 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8040 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8041 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8042 | hs_timeout=2500-60000" \ |
| 8043 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8044 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8045 | 0 \ |
| 8046 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8047 | -c "Next handshake message has been buffered - load"\ |
| 8048 | -S "Buffering HS message" \ |
| 8049 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8050 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8051 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8052 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8053 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8054 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8055 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8056 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8057 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8058 | hs_timeout=2500-60000" \ |
| 8059 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8060 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8061 | 0 \ |
| 8062 | -c "Buffering HS message" \ |
| 8063 | -c "found fragmented DTLS handshake message"\ |
| 8064 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8065 | -c "Next handshake message has been buffered - load"\ |
| 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 | dc1e950 | 2018-08-28 16:02:33 +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 | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8071 | -S "Remember CCS message" |
| 8072 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8073 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8074 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8075 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8076 | # while keeping the ServerKeyExchange. |
| 8077 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8078 | 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] | 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 | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8084 | 0 \ |
| 8085 | -c "Buffering HS message" \ |
| 8086 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8087 | -C "attempt to make space by freeing buffered messages" \ |
| 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 | a1adcca | 2018-08-24 14:41:07 +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 | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8093 | -S "Remember CCS message" |
| 8094 | |
| 8095 | # The size constraints ensure that the delayed certificate message can't |
| 8096 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8097 | # when dropping it first. |
| 8098 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8099 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8100 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8101 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8102 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8103 | hs_timeout=2500-60000" \ |
| 8104 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8105 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8106 | 0 \ |
| 8107 | -c "Buffering HS message" \ |
| 8108 | -c "attempt to make space by freeing buffered future messages" \ |
| 8109 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8110 | -S "Buffering HS message" \ |
| 8111 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8112 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8113 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8114 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8115 | -S "Remember CCS message" |
| 8116 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8117 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8118 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8119 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8120 | hs_timeout=2500-60000" \ |
| 8121 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8122 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8123 | 0 \ |
| 8124 | -C "Buffering HS message" \ |
| 8125 | -C "Next handshake message has been buffered - load"\ |
| 8126 | -s "Buffering HS message" \ |
| 8127 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8128 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8129 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8130 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8131 | -S "Remember CCS message" |
| 8132 | |
| 8133 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8134 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8135 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8136 | hs_timeout=2500-60000" \ |
| 8137 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8138 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8139 | 0 \ |
| 8140 | -C "Buffering HS message" \ |
| 8141 | -C "Next handshake message has been buffered - load"\ |
| 8142 | -S "Buffering HS message" \ |
| 8143 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8144 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8145 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8146 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8147 | -S "Remember CCS message" |
| 8148 | |
| 8149 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8150 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8151 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8152 | hs_timeout=2500-60000" \ |
| 8153 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8154 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8155 | 0 \ |
| 8156 | -C "Buffering HS message" \ |
| 8157 | -C "Next handshake message has been buffered - load"\ |
| 8158 | -S "Buffering HS message" \ |
| 8159 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8160 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8161 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8162 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8163 | -s "Remember CCS message" |
| 8164 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8165 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8166 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8167 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8168 | hs_timeout=2500-60000" \ |
| 8169 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8170 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8171 | 0 \ |
| 8172 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8173 | -s "Found buffered record from current epoch - load" \ |
| 8174 | -c "Buffer record from epoch 1" \ |
| 8175 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8176 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8177 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8178 | # from the server are delayed, so that the encrypted Finished message |
| 8179 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8180 | # in afterwards, the encrypted Finished message must be freed in order |
| 8181 | # to make space for the NewSessionTicket to be reassembled. |
| 8182 | # This works only in very particular circumstances: |
| 8183 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8184 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8185 | # the encrypted Finished message. |
| 8186 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8187 | # needs to be fragmented. |
| 8188 | # - All messages sent by the server must be small enough to be either sent |
| 8189 | # without fragmentation or be reassembled within the bounds of |
| 8190 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8191 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8192 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8193 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8194 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8195 | -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] | 8196 | "$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] | 8197 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8198 | 0 \ |
| 8199 | -s "Buffer record from epoch 1" \ |
| 8200 | -s "Found buffered record from current epoch - load" \ |
| 8201 | -c "Buffer record from epoch 1" \ |
| 8202 | -C "Found buffered record from current epoch - load" \ |
| 8203 | -c "Enough space available after freeing future epoch record" |
| 8204 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8205 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8206 | |
| 8207 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8208 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8209 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8210 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8211 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8212 | "$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] | 8213 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8214 | 0 \ |
| 8215 | -s "Extra-header:" \ |
| 8216 | -c "HTTP/1.0 200 OK" |
| 8217 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8218 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8219 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8220 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8221 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8222 | "$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] | 8223 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8224 | 0 \ |
| 8225 | -s "Extra-header:" \ |
| 8226 | -c "HTTP/1.0 200 OK" |
| 8227 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8228 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8229 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8230 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8231 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8232 | "$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] | 8233 | 0 \ |
| 8234 | -s "Extra-header:" \ |
| 8235 | -c "HTTP/1.0 200 OK" |
| 8236 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8237 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8238 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8239 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8240 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8241 | "$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] | 8242 | 0 \ |
| 8243 | -s "Extra-header:" \ |
| 8244 | -c "HTTP/1.0 200 OK" |
| 8245 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8246 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8247 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8248 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8249 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8250 | "$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] | 8251 | 0 \ |
| 8252 | -s "Extra-header:" \ |
| 8253 | -c "HTTP/1.0 200 OK" |
| 8254 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8255 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8256 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8257 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8258 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8259 | "$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] | 8260 | 0 \ |
| 8261 | -s "Extra-header:" \ |
| 8262 | -c "HTTP/1.0 200 OK" |
| 8263 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8264 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8265 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8266 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8267 | "$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] | 8268 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8269 | "$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] | 8270 | 0 \ |
| 8271 | -s "Extra-header:" \ |
| 8272 | -c "HTTP/1.0 200 OK" |
| 8273 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8274 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8275 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8276 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8277 | "$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] | 8278 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8279 | "$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] | 8280 | 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] | 8281 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8282 | 0 \ |
| 8283 | -s "a session has been resumed" \ |
| 8284 | -c "a session has been resumed" \ |
| 8285 | -s "Extra-header:" \ |
| 8286 | -c "HTTP/1.0 200 OK" |
| 8287 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8288 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8289 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8290 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8291 | "$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] | 8292 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8293 | "$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] | 8294 | 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] | 8295 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8296 | 0 \ |
| 8297 | -s "a session has been resumed" \ |
| 8298 | -c "a session has been resumed" \ |
| 8299 | -s "Extra-header:" \ |
| 8300 | -c "HTTP/1.0 200 OK" |
| 8301 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8302 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8303 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8304 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8305 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8306 | "$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] | 8307 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8308 | "$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] | 8309 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8310 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8311 | 0 \ |
| 8312 | -c "=> renegotiate" \ |
| 8313 | -s "=> renegotiate" \ |
| 8314 | -s "Extra-header:" \ |
| 8315 | -c "HTTP/1.0 200 OK" |
| 8316 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8317 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8318 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8319 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8320 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8321 | "$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] | 8322 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8323 | "$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] | 8324 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8325 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8326 | 0 \ |
| 8327 | -c "=> renegotiate" \ |
| 8328 | -s "=> renegotiate" \ |
| 8329 | -s "Extra-header:" \ |
| 8330 | -c "HTTP/1.0 200 OK" |
| 8331 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8332 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8333 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8334 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8335 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8336 | "$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] | 8337 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8338 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8339 | "$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] | 8340 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8341 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8342 | 0 \ |
| 8343 | -c "=> renegotiate" \ |
| 8344 | -s "=> renegotiate" \ |
| 8345 | -s "Extra-header:" \ |
| 8346 | -c "HTTP/1.0 200 OK" |
| 8347 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8348 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8349 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8350 | 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] | 8351 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8352 | "$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] | 8353 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8354 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8355 | "$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] | 8356 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8357 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8358 | 0 \ |
| 8359 | -c "=> renegotiate" \ |
| 8360 | -s "=> renegotiate" \ |
| 8361 | -s "Extra-header:" \ |
| 8362 | -c "HTTP/1.0 200 OK" |
| 8363 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8364 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8365 | ## all versions installed on the CI machines), reported here: |
| 8366 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8367 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8368 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8369 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8370 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8371 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8372 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8373 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8374 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8375 | "$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] | 8376 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8377 | -c "HTTP/1.0 200 OK" |
| 8378 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8379 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8380 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8381 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8382 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8383 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8384 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8385 | "$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] | 8386 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8387 | -c "HTTP/1.0 200 OK" |
| 8388 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8389 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8390 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8391 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8392 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8393 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8394 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8395 | "$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] | 8396 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8397 | -c "HTTP/1.0 200 OK" |
| 8398 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8399 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8400 | client_needs_more_time 6 |
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 | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8402 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8403 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8404 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8405 | "$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] | 8406 | 0 \ |
| 8407 | -s "Extra-header:" \ |
| 8408 | -c "Extra-header:" |
| 8409 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8410 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8411 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8412 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8413 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8414 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8415 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8416 | "$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] | 8417 | 0 \ |
| 8418 | -s "Extra-header:" \ |
| 8419 | -c "Extra-header:" |
| 8420 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8421 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8422 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8423 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8424 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8425 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8426 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8427 | "$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] | 8428 | 0 \ |
| 8429 | -s "Extra-header:" \ |
| 8430 | -c "Extra-header:" |
| 8431 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8432 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8433 | run_test "export keys functionality" \ |
| 8434 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8435 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8436 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8437 | -c "EAP-TLS key material is:"\ |
| 8438 | -s "EAP-TLS key material is:"\ |
| 8439 | -c "EAP-TLS IV is:" \ |
| 8440 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8441 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8442 | # Test heap memory usage after handshake |
| 8443 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8444 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8445 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame^] | 8446 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8447 | run_tests_memory_after_hanshake |
| 8448 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8449 | # Final report |
| 8450 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8451 | echo "------------------------------------------------------------------------" |
| 8452 | |
| 8453 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8454 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8455 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8456 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8457 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8458 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8459 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8460 | |
| 8461 | exit $FAILS |