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 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 80 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 81 | O_NEXT_SRV="$OPENSSL_NEXT s_server -www -cert data_files/server5.crt -key data_files/server5.key" |
| 82 | O_NEXT_CLI="echo 'GET / HTTP/1.0' | $OPENSSL_NEXT s_client" |
| 83 | else |
| 84 | O_NEXT_SRV=false |
| 85 | O_NEXT_CLI=false |
| 86 | fi |
| 87 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 88 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 89 | G_NEXT_SRV="$GNUTLS_NEXT_SERV --x509certfile data_files/server5.crt --x509keyfile data_files/server5.key" |
| 90 | else |
| 91 | G_NEXT_SRV=false |
| 92 | fi |
| 93 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 94 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 95 | G_NEXT_CLI="echo 'GET / HTTP/1.0' | $GNUTLS_NEXT_CLI --x509cafile data_files/test-ca_cat12.crt" |
| 96 | else |
| 97 | G_NEXT_CLI=false |
| 98 | fi |
| 99 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 100 | TESTS=0 |
| 101 | FAILS=0 |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 102 | SKIPS=0 |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 103 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 104 | CONFIG_H='../include/mbedtls/mbedtls_config.h' |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 105 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 106 | MEMCHECK=0 |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 107 | FILTER='.*' |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 108 | EXCLUDE='^$' |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 109 | |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 110 | SHOW_TEST_NUMBER=0 |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 111 | RUN_TEST_NUMBER='' |
| 112 | |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 113 | PRESERVE_LOGS=0 |
| 114 | |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 115 | # Pick a "unique" server port in the range 10000-19999, and a proxy |
| 116 | # port which is this plus 10000. Each port number may be independently |
| 117 | # overridden by a command line option. |
| 118 | SRV_PORT=$(($$ % 10000 + 10000)) |
| 119 | PXY_PORT=$((SRV_PORT + 10000)) |
| 120 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 121 | print_usage() { |
| 122 | echo "Usage: $0 [options]" |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 123 | printf " -h|--help\tPrint this help.\n" |
| 124 | printf " -m|--memcheck\tCheck memory leaks and errors.\n" |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 125 | printf " -f|--filter\tOnly matching tests are executed (substring or BRE)\n" |
| 126 | printf " -e|--exclude\tMatching tests are excluded (substring or BRE)\n" |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 127 | 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] | 128 | 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] | 129 | printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 130 | printf " --outcome-file\tFile where test outcomes are written\n" |
| 131 | printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n" |
| 132 | printf " --port \tTCP/UDP port (default: randomish 1xxxx)\n" |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 133 | printf " --proxy-port\tTCP/UDP proxy port (default: randomish 2xxxx)\n" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 134 | 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] | 135 | } |
| 136 | |
| 137 | get_options() { |
| 138 | while [ $# -gt 0 ]; do |
| 139 | case "$1" in |
Manuel Pégourié-Gonnard | 417d46c | 2014-03-13 19:17:53 +0100 | [diff] [blame] | 140 | -f|--filter) |
| 141 | shift; FILTER=$1 |
| 142 | ;; |
| 143 | -e|--exclude) |
| 144 | shift; EXCLUDE=$1 |
| 145 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 146 | -m|--memcheck) |
| 147 | MEMCHECK=1 |
| 148 | ;; |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 149 | -n|--number) |
| 150 | shift; RUN_TEST_NUMBER=$1 |
| 151 | ;; |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 152 | -s|--show-numbers) |
| 153 | SHOW_TEST_NUMBER=1 |
| 154 | ;; |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 155 | -p|--preserve-logs) |
| 156 | PRESERVE_LOGS=1 |
| 157 | ;; |
Gilles Peskine | f93c7d3 | 2017-04-14 17:55:28 +0200 | [diff] [blame] | 158 | --port) |
| 159 | shift; SRV_PORT=$1 |
| 160 | ;; |
| 161 | --proxy-port) |
| 162 | shift; PXY_PORT=$1 |
| 163 | ;; |
Andres AG | f04f54d | 2016-10-10 15:46:20 +0100 | [diff] [blame] | 164 | --seed) |
| 165 | shift; SEED="$1" |
| 166 | ;; |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 167 | -h|--help) |
| 168 | print_usage |
| 169 | exit 0 |
| 170 | ;; |
| 171 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 172 | echo "Unknown argument: '$1'" |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 173 | print_usage |
| 174 | exit 1 |
| 175 | ;; |
| 176 | esac |
| 177 | shift |
| 178 | done |
| 179 | } |
| 180 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 181 | # Make the outcome file path relative to the original directory, not |
| 182 | # to .../tests |
| 183 | case "$MBEDTLS_TEST_OUTCOME_FILE" in |
| 184 | [!/]*) |
| 185 | MBEDTLS_TEST_OUTCOME_FILE="$ORIGINAL_PWD/$MBEDTLS_TEST_OUTCOME_FILE" |
| 186 | ;; |
| 187 | esac |
| 188 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 189 | # Read boolean configuration options from mbedtls_config.h for easy and quick |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 190 | # testing. Skip non-boolean options (with something other than spaces |
| 191 | # and a comment after "#define SYMBOL"). The variable contains a |
| 192 | # space-separated list of symbols. |
| 193 | CONFIGS_ENABLED=" $(<"$CONFIG_H" \ |
| 194 | sed -n 's!^ *#define *\([A-Za-z][0-9A-Z_a-z]*\) *\(/*\)*!\1!p' | |
| 195 | tr '\n' ' ')" |
| 196 | |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 197 | # Skip next test; use this macro to skip tests which are legitimate |
| 198 | # in theory and expected to be re-introduced at some point, but |
| 199 | # aren't expected to succeed at the moment due to problems outside |
| 200 | # our control (such as bugs in other TLS implementations). |
| 201 | skip_next_test() { |
| 202 | SKIP_NEXT="YES" |
| 203 | } |
| 204 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 205 | # 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] | 206 | requires_config_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 207 | case $CONFIGS_ENABLED in |
| 208 | *" $1 "*) :;; |
| 209 | *) SKIP_NEXT="YES";; |
| 210 | esac |
Manuel Pégourié-Gonnard | 988209f | 2015-03-24 10:43:55 +0100 | [diff] [blame] | 211 | } |
| 212 | |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 213 | # 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] | 214 | requires_config_disabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 215 | case $CONFIGS_ENABLED in |
| 216 | *" $1 "*) SKIP_NEXT="YES";; |
| 217 | esac |
Manuel Pégourié-Gonnard | af63c21 | 2017-06-08 17:51:08 +0200 | [diff] [blame] | 218 | } |
| 219 | |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 220 | get_config_value_or_default() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 221 | # This function uses the query_config command line option to query the |
| 222 | # required Mbed TLS compile time configuration from the ssl_server2 |
| 223 | # program. The command will always return a success value if the |
| 224 | # configuration is defined and the value will be printed to stdout. |
| 225 | # |
| 226 | # Note that if the configuration is not defined or is defined to nothing, |
| 227 | # the output of this function will be an empty string. |
| 228 | ${P_SRV} "query_config=${1}" |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | requires_config_value_at_least() { |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 232 | VAL="$( get_config_value_or_default "$1" )" |
| 233 | if [ -z "$VAL" ]; then |
| 234 | # Should never happen |
| 235 | echo "Mbed TLS configuration $1 is not defined" |
| 236 | exit 1 |
| 237 | elif [ "$VAL" -lt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 238 | SKIP_NEXT="YES" |
| 239 | fi |
| 240 | } |
| 241 | |
| 242 | requires_config_value_at_most() { |
Hanno Becker | 7c48dd1 | 2018-08-28 16:09:22 +0100 | [diff] [blame] | 243 | VAL=$( get_config_value_or_default "$1" ) |
Andres Amaya Garcia | 3169dc0 | 2018-10-16 21:29:07 +0100 | [diff] [blame] | 244 | if [ -z "$VAL" ]; then |
| 245 | # Should never happen |
| 246 | echo "Mbed TLS configuration $1 is not defined" |
| 247 | exit 1 |
| 248 | elif [ "$VAL" -gt "$2" ]; then |
Hanno Becker | 5cd017f | 2018-08-24 14:40:12 +0100 | [diff] [blame] | 249 | SKIP_NEXT="YES" |
| 250 | fi |
| 251 | } |
| 252 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 253 | requires_config_value_equals() { |
| 254 | VAL=$( get_config_value_or_default "$1" ) |
| 255 | if [ -z "$VAL" ]; then |
| 256 | # Should never happen |
| 257 | echo "Mbed TLS configuration $1 is not defined" |
| 258 | exit 1 |
| 259 | elif [ "$VAL" -ne "$2" ]; then |
| 260 | SKIP_NEXT="YES" |
| 261 | fi |
| 262 | } |
| 263 | |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 264 | # Space-separated list of ciphersuites supported by this build of |
| 265 | # Mbed TLS. |
| 266 | P_CIPHERSUITES=" $($P_CLI --help 2>/dev/null | |
| 267 | grep TLS- | |
| 268 | tr -s ' \n' ' ')" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 269 | requires_ciphersuite_enabled() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 270 | case $P_CIPHERSUITES in |
| 271 | *" $1 "*) :;; |
| 272 | *) SKIP_NEXT="YES";; |
| 273 | esac |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 274 | } |
| 275 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 276 | # maybe_requires_ciphersuite_enabled CMD [RUN_TEST_OPTION...] |
| 277 | # If CMD (call to a TLS client or server program) requires a specific |
| 278 | # ciphersuite, arrange to only run the test case if this ciphersuite is |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 279 | # enabled. |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 280 | maybe_requires_ciphersuite_enabled() { |
| 281 | case "$1" in |
| 282 | *\ force_ciphersuite=*) :;; |
| 283 | *) return;; # No specific required ciphersuite |
| 284 | esac |
| 285 | ciphersuite="${1##*\ force_ciphersuite=}" |
| 286 | ciphersuite="${ciphersuite%%[!-0-9A-Z_a-z]*}" |
| 287 | shift |
| 288 | |
Dave Rodgman | c424098 | 2021-06-29 19:53:16 +0100 | [diff] [blame] | 289 | requires_ciphersuite_enabled "$ciphersuite" |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 290 | |
| 291 | unset ciphersuite |
| 292 | } |
| 293 | |
Manuel Pégourié-Gonnard | 1cbd39d | 2014-10-20 13:34:59 +0200 | [diff] [blame] | 294 | # skip next test if OpenSSL doesn't support FALLBACK_SCSV |
| 295 | requires_openssl_with_fallback_scsv() { |
| 296 | if [ -z "${OPENSSL_HAS_FBSCSV:-}" ]; then |
| 297 | if $OPENSSL_CMD s_client -help 2>&1 | grep fallback_scsv >/dev/null |
| 298 | then |
| 299 | OPENSSL_HAS_FBSCSV="YES" |
| 300 | else |
| 301 | OPENSSL_HAS_FBSCSV="NO" |
| 302 | fi |
| 303 | fi |
| 304 | if [ "$OPENSSL_HAS_FBSCSV" = "NO" ]; then |
| 305 | SKIP_NEXT="YES" |
| 306 | fi |
| 307 | } |
| 308 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 309 | # skip next test if either IN_CONTENT_LEN or MAX_CONTENT_LEN are below a value |
| 310 | requires_max_content_len() { |
| 311 | requires_config_value_at_least "MBEDTLS_SSL_IN_CONTENT_LEN" $1 |
| 312 | requires_config_value_at_least "MBEDTLS_SSL_OUT_CONTENT_LEN" $1 |
| 313 | } |
| 314 | |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 315 | # skip next test if GnuTLS isn't available |
| 316 | requires_gnutls() { |
| 317 | if [ -z "${GNUTLS_AVAILABLE:-}" ]; then |
Manuel Pégourié-Gonnard | 03db6b0 | 2015-06-26 15:45:30 +0200 | [diff] [blame] | 318 | 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] | 319 | GNUTLS_AVAILABLE="YES" |
| 320 | else |
| 321 | GNUTLS_AVAILABLE="NO" |
| 322 | fi |
| 323 | fi |
| 324 | if [ "$GNUTLS_AVAILABLE" = "NO" ]; then |
| 325 | SKIP_NEXT="YES" |
| 326 | fi |
| 327 | } |
| 328 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 329 | # skip next test if GnuTLS-next isn't available |
| 330 | requires_gnutls_next() { |
| 331 | if [ -z "${GNUTLS_NEXT_AVAILABLE:-}" ]; then |
| 332 | if ( which "${GNUTLS_NEXT_CLI:-}" && which "${GNUTLS_NEXT_SERV:-}" ) >/dev/null 2>&1; then |
| 333 | GNUTLS_NEXT_AVAILABLE="YES" |
| 334 | else |
| 335 | GNUTLS_NEXT_AVAILABLE="NO" |
| 336 | fi |
| 337 | fi |
| 338 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 339 | SKIP_NEXT="YES" |
| 340 | fi |
| 341 | } |
| 342 | |
| 343 | # skip next test if OpenSSL-legacy isn't available |
| 344 | requires_openssl_legacy() { |
| 345 | if [ -z "${OPENSSL_LEGACY_AVAILABLE:-}" ]; then |
| 346 | if which "${OPENSSL_LEGACY:-}" >/dev/null 2>&1; then |
| 347 | OPENSSL_LEGACY_AVAILABLE="YES" |
| 348 | else |
| 349 | OPENSSL_LEGACY_AVAILABLE="NO" |
| 350 | fi |
| 351 | fi |
| 352 | if [ "$OPENSSL_LEGACY_AVAILABLE" = "NO" ]; then |
| 353 | SKIP_NEXT="YES" |
| 354 | fi |
| 355 | } |
| 356 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 357 | requires_openssl_next() { |
| 358 | if [ -z "${OPENSSL_NEXT_AVAILABLE:-}" ]; then |
| 359 | if which "${OPENSSL_NEXT:-}" >/dev/null 2>&1; then |
| 360 | OPENSSL_NEXT_AVAILABLE="YES" |
| 361 | else |
| 362 | OPENSSL_NEXT_AVAILABLE="NO" |
| 363 | fi |
| 364 | fi |
| 365 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 366 | SKIP_NEXT="YES" |
| 367 | fi |
| 368 | } |
| 369 | |
| 370 | # skip next test if tls1_3 is not available |
| 371 | requires_openssl_tls1_3() { |
| 372 | requires_openssl_next |
| 373 | if [ "$OPENSSL_NEXT_AVAILABLE" = "NO" ]; then |
| 374 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 375 | fi |
| 376 | if [ -z "${OPENSSL_TLS1_3_AVAILABLE:-}" ]; then |
| 377 | if $OPENSSL_NEXT s_client -help 2>&1 | grep tls1_3 >/dev/null |
| 378 | then |
| 379 | OPENSSL_TLS1_3_AVAILABLE="YES" |
| 380 | else |
| 381 | OPENSSL_TLS1_3_AVAILABLE="NO" |
| 382 | fi |
| 383 | fi |
| 384 | if [ "$OPENSSL_TLS1_3_AVAILABLE" = "NO" ]; then |
| 385 | SKIP_NEXT="YES" |
| 386 | fi |
| 387 | } |
| 388 | |
| 389 | # skip next test if tls1_3 is not available |
| 390 | requires_gnutls_tls1_3() { |
| 391 | requires_gnutls_next |
| 392 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 393 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 394 | fi |
| 395 | if [ -z "${GNUTLS_TLS1_3_AVAILABLE:-}" ]; then |
| 396 | if $GNUTLS_NEXT_CLI -l 2>&1 | grep VERS-TLS1.3 >/dev/null |
| 397 | then |
| 398 | GNUTLS_TLS1_3_AVAILABLE="YES" |
| 399 | else |
| 400 | GNUTLS_TLS1_3_AVAILABLE="NO" |
| 401 | fi |
| 402 | fi |
| 403 | if [ "$GNUTLS_TLS1_3_AVAILABLE" = "NO" ]; then |
| 404 | SKIP_NEXT="YES" |
| 405 | fi |
| 406 | } |
| 407 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 408 | # Check %NO_TICKETS option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 409 | requires_gnutls_next_no_ticket() { |
| 410 | requires_gnutls_next |
| 411 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 412 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 413 | fi |
| 414 | if [ -z "${GNUTLS_NO_TICKETS_AVAILABLE:-}" ]; then |
| 415 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep NO_TICKETS >/dev/null |
| 416 | then |
| 417 | GNUTLS_NO_TICKETS_AVAILABLE="YES" |
| 418 | else |
| 419 | GNUTLS_NO_TICKETS_AVAILABLE="NO" |
| 420 | fi |
| 421 | fi |
| 422 | if [ "$GNUTLS_NO_TICKETS_AVAILABLE" = "NO" ]; then |
| 423 | SKIP_NEXT="YES" |
| 424 | fi |
| 425 | } |
| 426 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 427 | # Check %DISABLE_TLS13_COMPAT_MODE option |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 428 | requires_gnutls_next_disable_tls13_compat() { |
| 429 | requires_gnutls_next |
| 430 | if [ "$GNUTLS_NEXT_AVAILABLE" = "NO" ]; then |
| 431 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 432 | fi |
| 433 | if [ -z "${GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE:-}" ]; then |
| 434 | if $GNUTLS_NEXT_CLI --priority-list 2>&1 | grep DISABLE_TLS13_COMPAT_MODE >/dev/null |
| 435 | then |
| 436 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="YES" |
| 437 | else |
| 438 | GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE="NO" |
| 439 | fi |
| 440 | fi |
| 441 | if [ "$GNUTLS_DISABLE_TLS13_COMPAT_MODE_AVAILABLE" = "NO" ]; then |
| 442 | SKIP_NEXT="YES" |
| 443 | fi |
| 444 | } |
| 445 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 446 | # skip next test if IPv6 isn't available on this host |
| 447 | requires_ipv6() { |
| 448 | if [ -z "${HAS_IPV6:-}" ]; then |
| 449 | $P_SRV server_addr='::1' > $SRV_OUT 2>&1 & |
| 450 | SRV_PID=$! |
| 451 | sleep 1 |
| 452 | kill $SRV_PID >/dev/null 2>&1 |
| 453 | if grep "NET - Binding of the socket failed" $SRV_OUT >/dev/null; then |
| 454 | HAS_IPV6="NO" |
| 455 | else |
| 456 | HAS_IPV6="YES" |
| 457 | fi |
| 458 | rm -r $SRV_OUT |
| 459 | fi |
| 460 | |
| 461 | if [ "$HAS_IPV6" = "NO" ]; then |
| 462 | SKIP_NEXT="YES" |
| 463 | fi |
| 464 | } |
| 465 | |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 466 | # skip next test if it's i686 or uname is not available |
| 467 | requires_not_i686() { |
| 468 | if [ -z "${IS_I686:-}" ]; then |
| 469 | IS_I686="YES" |
| 470 | if which "uname" >/dev/null 2>&1; then |
| 471 | if [ -z "$(uname -a | grep i686)" ]; then |
| 472 | IS_I686="NO" |
| 473 | fi |
| 474 | fi |
| 475 | fi |
| 476 | if [ "$IS_I686" = "YES" ]; then |
| 477 | SKIP_NEXT="YES" |
| 478 | fi |
| 479 | } |
| 480 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 481 | # Calculate the input & output maximum content lengths set in the config |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 482 | MAX_CONTENT_LEN=16384 |
Yuto Takano | 2be6f1a | 2021-06-22 07:16:40 +0100 | [diff] [blame] | 483 | MAX_IN_LEN=$( get_config_value_or_default "MBEDTLS_SSL_IN_CONTENT_LEN" ) |
| 484 | 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] | 485 | |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 486 | # Calculate the maximum content length that fits both |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 487 | if [ "$MAX_IN_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 488 | MAX_CONTENT_LEN="$MAX_IN_LEN" |
| 489 | fi |
| 490 | if [ "$MAX_OUT_LEN" -lt "$MAX_CONTENT_LEN" ]; then |
| 491 | MAX_CONTENT_LEN="$MAX_OUT_LEN" |
| 492 | fi |
| 493 | |
| 494 | # skip the next test if the SSL output buffer is less than 16KB |
| 495 | requires_full_size_output_buffer() { |
| 496 | if [ "$MAX_OUT_LEN" -ne 16384 ]; then |
| 497 | SKIP_NEXT="YES" |
| 498 | fi |
| 499 | } |
| 500 | |
Manuel Pégourié-Gonnard | 76fe9e4 | 2014-09-24 15:17:31 +0200 | [diff] [blame] | 501 | # skip the next test if valgrind is in use |
| 502 | not_with_valgrind() { |
| 503 | if [ "$MEMCHECK" -gt 0 ]; then |
| 504 | SKIP_NEXT="YES" |
| 505 | fi |
| 506 | } |
| 507 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 508 | # skip the next test if valgrind is NOT in use |
| 509 | only_with_valgrind() { |
| 510 | if [ "$MEMCHECK" -eq 0 ]; then |
| 511 | SKIP_NEXT="YES" |
| 512 | fi |
| 513 | } |
| 514 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 515 | # 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] | 516 | client_needs_more_time() { |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 517 | CLI_DELAY_FACTOR=$1 |
| 518 | } |
| 519 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 520 | # wait for the given seconds after the client finished in the next test |
| 521 | server_needs_more_time() { |
| 522 | SRV_DELAY_SECONDS=$1 |
| 523 | } |
| 524 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 525 | # print_name <name> |
| 526 | print_name() { |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 527 | TESTS=$(( $TESTS + 1 )) |
| 528 | LINE="" |
| 529 | |
| 530 | if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then |
| 531 | LINE="$TESTS " |
| 532 | fi |
| 533 | |
| 534 | LINE="$LINE$1" |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 535 | printf "%s " "$LINE" |
Paul Bakker | e20310a | 2016-05-10 11:18:17 +0100 | [diff] [blame] | 536 | LEN=$(( 72 - `echo "$LINE" | wc -c` )) |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 537 | for i in `seq 1 $LEN`; do printf '.'; done |
| 538 | printf ' ' |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 539 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 540 | } |
| 541 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 542 | # record_outcome <outcome> [<failure-reason>] |
| 543 | # The test name must be in $NAME. |
| 544 | record_outcome() { |
| 545 | echo "$1" |
| 546 | if [ -n "$MBEDTLS_TEST_OUTCOME_FILE" ]; then |
| 547 | printf '%s;%s;%s;%s;%s;%s\n' \ |
| 548 | "$MBEDTLS_TEST_PLATFORM" "$MBEDTLS_TEST_CONFIGURATION" \ |
| 549 | "ssl-opt" "$NAME" \ |
| 550 | "$1" "${2-}" \ |
| 551 | >>"$MBEDTLS_TEST_OUTCOME_FILE" |
| 552 | fi |
| 553 | } |
| 554 | |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 555 | # fail <message> |
| 556 | fail() { |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 557 | record_outcome "FAIL" "$1" |
Manuel Pégourié-Gonnard | 3eec604 | 2014-02-27 15:37:24 +0100 | [diff] [blame] | 558 | echo " ! $1" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 559 | |
Manuel Pégourié-Gonnard | c2b0092 | 2014-08-31 16:46:04 +0200 | [diff] [blame] | 560 | mv $SRV_OUT o-srv-${TESTS}.log |
| 561 | mv $CLI_OUT o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 562 | if [ -n "$PXY_CMD" ]; then |
| 563 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 564 | fi |
| 565 | echo " ! outputs saved to o-XXX-${TESTS}.log" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 566 | |
Manuel Pégourié-Gonnard | 3f3302f | 2020-06-08 11:49:05 +0200 | [diff] [blame] | 567 | if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 568 | echo " ! server output:" |
| 569 | cat o-srv-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 570 | echo " ! ========================================================" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 571 | echo " ! client output:" |
| 572 | cat o-cli-${TESTS}.log |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 573 | if [ -n "$PXY_CMD" ]; then |
| 574 | echo " ! ========================================================" |
| 575 | echo " ! proxy output:" |
| 576 | cat o-pxy-${TESTS}.log |
| 577 | fi |
| 578 | echo "" |
Manuel Pégourié-Gonnard | 7fa6772 | 2014-08-31 17:42:53 +0200 | [diff] [blame] | 579 | fi |
| 580 | |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 581 | FAILS=$(( $FAILS + 1 )) |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 582 | } |
| 583 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 584 | # is_polar <cmd_line> |
| 585 | is_polar() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 586 | case "$1" in |
| 587 | *ssl_client2*) true;; |
| 588 | *ssl_server2*) true;; |
| 589 | *) false;; |
| 590 | esac |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 591 | } |
| 592 | |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 593 | # openssl s_server doesn't have -www with DTLS |
| 594 | check_osrv_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 595 | case "$SRV_CMD" in |
| 596 | *s_server*-dtls*) |
| 597 | NEEDS_INPUT=1 |
| 598 | SRV_CMD="$( echo $SRV_CMD | sed s/-www// )";; |
| 599 | *) NEEDS_INPUT=0;; |
| 600 | esac |
Manuel Pégourié-Gonnard | fa60f12 | 2014-09-26 16:07:29 +0200 | [diff] [blame] | 601 | } |
| 602 | |
| 603 | # provide input to commands that need it |
| 604 | provide_input() { |
| 605 | if [ $NEEDS_INPUT -eq 0 ]; then |
| 606 | return |
| 607 | fi |
| 608 | |
| 609 | while true; do |
| 610 | echo "HTTP/1.0 200 OK" |
| 611 | sleep 1 |
| 612 | done |
| 613 | } |
| 614 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 615 | # has_mem_err <log_file_name> |
| 616 | has_mem_err() { |
| 617 | if ( grep -F 'All heap blocks were freed -- no leaks are possible' "$1" && |
| 618 | grep -F 'ERROR SUMMARY: 0 errors from 0 contexts' "$1" ) > /dev/null |
| 619 | then |
| 620 | return 1 # false: does not have errors |
| 621 | else |
| 622 | return 0 # true: has errors |
| 623 | fi |
| 624 | } |
| 625 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 626 | # 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] | 627 | if type lsof >/dev/null 2>/dev/null; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 628 | wait_app_start() { |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 629 | START_TIME=$(date +%s) |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 630 | if [ "$DTLS" -eq 1 ]; then |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 631 | proto=UDP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 632 | else |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 633 | proto=TCP |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 634 | fi |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 635 | # Make a tight loop, server normally takes less than 1s to start. |
| 636 | while ! lsof -a -n -b -i "$proto:$1" -p "$2" >/dev/null 2>/dev/null; do |
| 637 | if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 638 | echo "$3 START TIMEOUT" |
| 639 | echo "$3 START TIMEOUT" >> $4 |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 640 | break |
| 641 | fi |
| 642 | # Linux and *BSD support decimal arguments to sleep. On other |
| 643 | # OSes this may be a tight loop. |
| 644 | sleep 0.1 2>/dev/null || true |
| 645 | done |
| 646 | } |
| 647 | else |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 648 | echo "Warning: lsof not available, wait_app_start = sleep" |
| 649 | wait_app_start() { |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 650 | sleep "$START_DELAY" |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 651 | } |
| 652 | fi |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 653 | |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 654 | # Wait for server process $2 to be listening on port $1. |
| 655 | wait_server_start() { |
| 656 | wait_app_start $1 $2 "SERVER" $SRV_OUT |
| 657 | } |
| 658 | |
| 659 | # Wait for proxy process $2 to be listening on port $1. |
| 660 | wait_proxy_start() { |
| 661 | wait_app_start $1 $2 "PROXY" $PXY_OUT |
| 662 | } |
| 663 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 664 | # 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] | 665 | # 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] | 666 | # acceptable bounds |
| 667 | check_server_hello_time() { |
| 668 | # 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] | 669 | 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] | 670 | # Get the Unix timestamp for now |
| 671 | CUR_TIME=$(date +'%s') |
| 672 | THRESHOLD_IN_SECS=300 |
| 673 | |
| 674 | # Check if the ServerHello time was printed |
| 675 | if [ -z "$SERVER_HELLO_TIME" ]; then |
| 676 | return 1 |
| 677 | fi |
| 678 | |
| 679 | # Check the time in ServerHello is within acceptable bounds |
| 680 | if [ $SERVER_HELLO_TIME -lt $(( $CUR_TIME - $THRESHOLD_IN_SECS )) ]; then |
| 681 | # The time in ServerHello is at least 5 minutes before now |
| 682 | return 1 |
| 683 | elif [ $SERVER_HELLO_TIME -gt $(( $CUR_TIME + $THRESHOLD_IN_SECS )) ]; then |
Andres Amaya Garcia | 3b1bdff | 2017-09-14 12:41:29 +0100 | [diff] [blame] | 684 | # 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] | 685 | return 1 |
| 686 | else |
| 687 | return 0 |
| 688 | fi |
| 689 | } |
| 690 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 691 | # Get handshake memory usage from server or client output and put it into the variable specified by the first argument |
| 692 | handshake_memory_get() { |
| 693 | OUTPUT_VARIABLE="$1" |
| 694 | OUTPUT_FILE="$2" |
| 695 | |
| 696 | # Get memory usage from a pattern like "Heap memory usage after handshake: 23112 bytes. Peak memory usage was 33112" |
| 697 | MEM_USAGE=$(sed -n 's/.*Heap memory usage after handshake: //p' < "$OUTPUT_FILE" | grep -o "[0-9]*" | head -1) |
| 698 | |
| 699 | # Check if memory usage was read |
| 700 | if [ -z "$MEM_USAGE" ]; then |
| 701 | echo "Error: Can not read the value of handshake memory usage" |
| 702 | return 1 |
| 703 | else |
| 704 | eval "$OUTPUT_VARIABLE=$MEM_USAGE" |
| 705 | return 0 |
| 706 | fi |
| 707 | } |
| 708 | |
| 709 | # Get handshake memory usage from server or client output and check if this value |
| 710 | # is not higher than the maximum given by the first argument |
| 711 | handshake_memory_check() { |
| 712 | MAX_MEMORY="$1" |
| 713 | OUTPUT_FILE="$2" |
| 714 | |
| 715 | # Get memory usage |
| 716 | if ! handshake_memory_get "MEMORY_USAGE" "$OUTPUT_FILE"; then |
| 717 | return 1 |
| 718 | fi |
| 719 | |
| 720 | # Check if memory usage is below max value |
| 721 | if [ "$MEMORY_USAGE" -gt "$MAX_MEMORY" ]; then |
| 722 | echo "\nFailed: Handshake memory usage was $MEMORY_USAGE bytes," \ |
| 723 | "but should be below $MAX_MEMORY bytes" |
| 724 | return 1 |
| 725 | else |
| 726 | return 0 |
| 727 | fi |
| 728 | } |
| 729 | |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 730 | # wait for client to terminate and set CLI_EXIT |
| 731 | # must be called right after starting the client |
| 732 | wait_client_done() { |
| 733 | CLI_PID=$! |
| 734 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 735 | CLI_DELAY=$(( $DOG_DELAY * $CLI_DELAY_FACTOR )) |
| 736 | CLI_DELAY_FACTOR=1 |
| 737 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 738 | ( 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] | 739 | DOG_PID=$! |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 740 | |
| 741 | wait $CLI_PID |
| 742 | CLI_EXIT=$? |
| 743 | |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 744 | kill $DOG_PID >/dev/null 2>&1 |
| 745 | wait $DOG_PID |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 746 | |
| 747 | echo "EXIT: $CLI_EXIT" >> $CLI_OUT |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 748 | |
| 749 | sleep $SRV_DELAY_SECONDS |
| 750 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 751 | } |
| 752 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 753 | # check if the given command uses dtls and sets global variable DTLS |
| 754 | detect_dtls() { |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 755 | case "$1" in |
| 756 | *dtls=1*|-dtls|-u) DTLS=1;; |
| 757 | *) DTLS=0;; |
| 758 | esac |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 759 | } |
| 760 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 761 | # check if the given command uses gnutls and sets global variable CMD_IS_GNUTLS |
| 762 | is_gnutls() { |
| 763 | case "$1" in |
| 764 | *gnutls-cli*) |
| 765 | CMD_IS_GNUTLS=1 |
| 766 | ;; |
| 767 | *gnutls-serv*) |
| 768 | CMD_IS_GNUTLS=1 |
| 769 | ;; |
| 770 | *) |
| 771 | CMD_IS_GNUTLS=0 |
| 772 | ;; |
| 773 | esac |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 774 | } |
| 775 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 776 | # Compare file content |
| 777 | # Usage: find_in_both pattern file1 file2 |
| 778 | # extract from file1 the first line matching the pattern |
| 779 | # check in file2 that the same line can be found |
| 780 | find_in_both() { |
| 781 | srv_pattern=$(grep -m 1 "$1" "$2"); |
| 782 | if [ -z "$srv_pattern" ]; then |
| 783 | return 1; |
| 784 | fi |
| 785 | |
| 786 | if grep "$srv_pattern" $3 >/dev/null; then : |
Johan Pascal | 1040315 | 2020-10-09 20:43:51 +0200 | [diff] [blame] | 787 | return 0; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 788 | else |
| 789 | return 1; |
| 790 | fi |
| 791 | } |
| 792 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 793 | SKIP_HANDSHAKE_CHECK="NO" |
| 794 | skip_handshake_stage_check() { |
| 795 | SKIP_HANDSHAKE_CHECK="YES" |
| 796 | } |
| 797 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 798 | # 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] | 799 | # Options: -s pattern pattern that must be present in server output |
| 800 | # -c pattern pattern that must be present in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 801 | # -u pattern lines after pattern must be unique in client output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 802 | # -f call shell function on client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 803 | # -S pattern pattern that must be absent in server output |
| 804 | # -C pattern pattern that must be absent in client output |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 805 | # -U pattern lines after pattern must be unique in server output |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 806 | # -F call shell function on server output |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 807 | # -g call shell function on server and client output |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 808 | run_test() { |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 809 | NAME="$1" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 810 | shift 1 |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 811 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 812 | if is_excluded "$NAME"; then |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 813 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 814 | # 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] | 815 | return |
| 816 | fi |
| 817 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 818 | print_name "$NAME" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 819 | |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 820 | # Do we only run numbered tests? |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 821 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 822 | case ",$RUN_TEST_NUMBER," in |
| 823 | *",$TESTS,"*) :;; |
| 824 | *) SKIP_NEXT="YES";; |
| 825 | esac |
Paul Bakker | b7584a5 | 2016-05-10 10:50:43 +0100 | [diff] [blame] | 826 | fi |
| 827 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 828 | # does this test use a proxy? |
| 829 | if [ "X$1" = "X-p" ]; then |
| 830 | PXY_CMD="$2" |
| 831 | shift 2 |
| 832 | else |
| 833 | PXY_CMD="" |
| 834 | fi |
| 835 | |
| 836 | # get commands and client output |
| 837 | SRV_CMD="$1" |
| 838 | CLI_CMD="$2" |
| 839 | CLI_EXPECT="$3" |
| 840 | shift 3 |
| 841 | |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 842 | # Check if test uses files |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 843 | case "$SRV_CMD $CLI_CMD" in |
| 844 | *data_files/*) |
| 845 | requires_config_enabled MBEDTLS_FS_IO;; |
| 846 | esac |
Hanno Becker | 91e72c3 | 2019-05-10 14:38:42 +0100 | [diff] [blame] | 847 | |
Gilles Peskine | 0d72165 | 2020-06-26 23:35:53 +0200 | [diff] [blame] | 848 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 849 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 850 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 851 | |
| 852 | # should we skip? |
| 853 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 854 | SKIP_NEXT="NO" |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 855 | record_outcome "SKIP" |
Hanno Becker | 9d76d56 | 2018-11-16 17:27:29 +0000 | [diff] [blame] | 856 | SKIPS=$(( $SKIPS + 1 )) |
| 857 | return |
| 858 | fi |
| 859 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 860 | # update DTLS variable |
| 861 | detect_dtls "$SRV_CMD" |
| 862 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 863 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 864 | # 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] | 865 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 866 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 867 | case " $SRV_CMD " in |
| 868 | *' server_addr=::1 '*) |
| 869 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 870 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 871 | fi |
| 872 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 873 | # update CMD_IS_GNUTLS variable |
| 874 | is_gnutls "$SRV_CMD" |
| 875 | |
| 876 | # if the server uses gnutls but doesn't set priority, explicitly |
| 877 | # set the default priority |
| 878 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 879 | case "$SRV_CMD" in |
| 880 | *--priority*) :;; |
| 881 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 882 | esac |
| 883 | fi |
| 884 | |
| 885 | # update CMD_IS_GNUTLS variable |
| 886 | is_gnutls "$CLI_CMD" |
| 887 | |
| 888 | # if the client uses gnutls but doesn't set priority, explicitly |
| 889 | # set the default priority |
| 890 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 891 | case "$CLI_CMD" in |
| 892 | *--priority*) :;; |
| 893 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 894 | esac |
| 895 | fi |
| 896 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 897 | # fix client port |
| 898 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 899 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 900 | else |
| 901 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 902 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 903 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 904 | # prepend valgrind to our commands if active |
| 905 | if [ "$MEMCHECK" -gt 0 ]; then |
| 906 | if is_polar "$SRV_CMD"; then |
| 907 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 908 | fi |
| 909 | if is_polar "$CLI_CMD"; then |
| 910 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 911 | fi |
| 912 | fi |
| 913 | |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 914 | TIMES_LEFT=2 |
| 915 | while [ $TIMES_LEFT -gt 0 ]; do |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 916 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 917 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 918 | # run the commands |
| 919 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | a3b994f | 2020-07-27 09:45:32 +0200 | [diff] [blame] | 920 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 921 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 922 | PXY_PID=$! |
Unknown | d364f4c | 2019-09-02 10:42:57 -0400 | [diff] [blame] | 923 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 924 | fi |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 925 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 926 | check_osrv_dtls |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 927 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 928 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 929 | SRV_PID=$! |
Gilles Peskine | 418b536 | 2017-12-14 18:58:42 +0100 | [diff] [blame] | 930 | wait_server_start "$SRV_PORT" "$SRV_PID" |
Manuel Pégourié-Gonnard | c0f6a69 | 2014-08-30 22:41:47 +0200 | [diff] [blame] | 931 | |
Gilles Peskine | 231befa | 2020-08-26 20:05:11 +0200 | [diff] [blame] | 932 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 933 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 934 | wait_client_done |
Manuel Pégourié-Gonnard | e01af4c | 2014-03-25 14:16:44 +0100 | [diff] [blame] | 935 | |
Hanno Becker | cadb5bb | 2017-05-26 13:56:10 +0100 | [diff] [blame] | 936 | sleep 0.05 |
| 937 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 938 | # terminate the server (and the proxy) |
| 939 | kill $SRV_PID |
| 940 | wait $SRV_PID |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 941 | SRV_RET=$? |
Hanno Becker | d82d846 | 2017-05-29 21:37:46 +0100 | [diff] [blame] | 942 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 943 | if [ -n "$PXY_CMD" ]; then |
| 944 | kill $PXY_PID >/dev/null 2>&1 |
| 945 | wait $PXY_PID |
| 946 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 947 | |
Manuel Pégourié-Gonnard | ab5f7b4 | 2015-08-04 21:01:37 +0200 | [diff] [blame] | 948 | # retry only on timeouts |
| 949 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 950 | printf "RETRY " |
| 951 | else |
| 952 | TIMES_LEFT=0 |
| 953 | fi |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 954 | done |
| 955 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 956 | # 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] | 957 | # (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] | 958 | # expected client exit to incorrectly succeed in case of catastrophic |
| 959 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 960 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 961 | then |
| 962 | if is_polar "$SRV_CMD"; then |
| 963 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 964 | else |
| 965 | fail "server or client failed to reach handshake stage" |
| 966 | return |
| 967 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 968 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 969 | if is_polar "$CLI_CMD"; then |
| 970 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 971 | else |
| 972 | fail "server or client failed to reach handshake stage" |
| 973 | return |
| 974 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 975 | fi |
| 976 | fi |
| 977 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 978 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 979 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 980 | # exit with status 0 when interrupted by a signal, and we don't really |
| 981 | # care anyway), in case e.g. the server reports a memory leak. |
| 982 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 983 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 984 | return |
| 985 | fi |
| 986 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 987 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 988 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 989 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 990 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 991 | 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] | 992 | return |
| 993 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 994 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 995 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 996 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 997 | # 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] | 998 | while [ $# -gt 0 ] |
| 999 | do |
| 1000 | case $1 in |
| 1001 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1002 | 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] | 1003 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1004 | return |
| 1005 | fi |
| 1006 | ;; |
| 1007 | |
| 1008 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1009 | 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] | 1010 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1011 | return |
| 1012 | fi |
| 1013 | ;; |
| 1014 | |
| 1015 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1016 | 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] | 1017 | 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] | 1018 | return |
| 1019 | fi |
| 1020 | ;; |
| 1021 | |
| 1022 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 1023 | 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] | 1024 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 1025 | return |
| 1026 | fi |
| 1027 | ;; |
| 1028 | |
| 1029 | # The filtering in the following two options (-u and -U) do the following |
| 1030 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 1031 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1032 | # - keep one of each non-unique line |
| 1033 | # - count how many lines remain |
| 1034 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 1035 | # if there were no duplicates. |
| 1036 | "-U") |
| 1037 | 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 |
| 1038 | fail "lines following pattern '$2' must be unique in Server output" |
| 1039 | return |
| 1040 | fi |
| 1041 | ;; |
| 1042 | |
| 1043 | "-u") |
| 1044 | 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 |
| 1045 | 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] | 1046 | return |
| 1047 | fi |
| 1048 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 1049 | "-F") |
| 1050 | if ! $2 "$SRV_OUT"; then |
| 1051 | fail "function call to '$2' failed on Server output" |
| 1052 | return |
| 1053 | fi |
| 1054 | ;; |
| 1055 | "-f") |
| 1056 | if ! $2 "$CLI_OUT"; then |
| 1057 | fail "function call to '$2' failed on Client output" |
| 1058 | return |
| 1059 | fi |
| 1060 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 1061 | "-g") |
| 1062 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 1063 | fail "function call to '$2' failed on Server and Client output" |
| 1064 | return |
| 1065 | fi |
| 1066 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1067 | |
| 1068 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 1069 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1070 | exit 1 |
| 1071 | esac |
| 1072 | shift 2 |
| 1073 | done |
| 1074 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 1075 | # check valgrind's results |
| 1076 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1077 | 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] | 1078 | fail "Server has memory errors" |
| 1079 | return |
| 1080 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1081 | 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] | 1082 | fail "Client has memory errors" |
| 1083 | return |
| 1084 | fi |
| 1085 | fi |
| 1086 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1087 | # if we're here, everything is ok |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1088 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1089 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1090 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1091 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1092 | if [ -n "$PXY_CMD" ]; then |
| 1093 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1094 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1095 | fi |
| 1096 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1097 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1098 | } |
| 1099 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1100 | run_test_psa() { |
| 1101 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1102 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 1103 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 1104 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1105 | 0 \ |
| 1106 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1107 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1108 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1109 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1110 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1111 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1112 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1113 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1114 | -C "Failed to setup PSA-based cipher context"\ |
| 1115 | -S "Failed to setup PSA-based cipher context"\ |
| 1116 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1117 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1118 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1119 | -S "error" \ |
| 1120 | -C "error" |
| 1121 | } |
| 1122 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1123 | run_test_psa_force_curve() { |
| 1124 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1125 | run_test "PSA - ECDH with $1" \ |
Gilles Peskine | 12b5b38 | 2021-06-02 10:00:42 +0200 | [diff] [blame] | 1126 | "$P_SRV debug_level=4 force_version=tls1_2 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1127 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1128 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1129 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1130 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1131 | -c "PSA calc verify" \ |
| 1132 | -c "calc PSA finished" \ |
| 1133 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1134 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1135 | -s "PSA calc verify" \ |
| 1136 | -s "calc PSA finished" \ |
| 1137 | -C "Failed to setup PSA-based cipher context"\ |
| 1138 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1139 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1140 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1141 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1142 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1143 | -C "error" |
| 1144 | } |
| 1145 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1146 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1147 | # a maximum fragment length. |
| 1148 | # first argument ($1) is MFL for SSL client |
| 1149 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1150 | run_test_memory_after_hanshake_with_mfl() |
| 1151 | { |
| 1152 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1153 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1154 | |
| 1155 | # Leave some margin for robustness |
| 1156 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1157 | |
| 1158 | run_test "Handshake memory usage (MFL $1)" \ |
| 1159 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1160 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1161 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1162 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1163 | 0 \ |
| 1164 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1165 | } |
| 1166 | |
| 1167 | |
| 1168 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1169 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1170 | run_tests_memory_after_hanshake() |
| 1171 | { |
| 1172 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1173 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1174 | |
| 1175 | # first test with default MFU is to get reference memory usage |
| 1176 | MEMORY_USAGE_MFL_16K=0 |
| 1177 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1178 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1179 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1180 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1181 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1182 | 0 \ |
| 1183 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1184 | |
| 1185 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1186 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1187 | |
| 1188 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1189 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1190 | |
| 1191 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1192 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1193 | |
| 1194 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1195 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1196 | } |
| 1197 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1198 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1199 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1200 | rm -f context_srv.txt |
| 1201 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1202 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1203 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1204 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1205 | 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] | 1206 | exit 1 |
| 1207 | } |
| 1208 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1209 | # |
| 1210 | # MAIN |
| 1211 | # |
| 1212 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1213 | get_options "$@" |
| 1214 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1215 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1216 | # patterns rather than regular expressions, use a case statement instead |
| 1217 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1218 | # detects simple cases: plain substring, everything, nothing. |
| 1219 | # |
| 1220 | # As an exception, the character '.' is treated as an ordinary character |
| 1221 | # if it is the only special character in the string. This is because it's |
| 1222 | # rare to need "any one character", but needing a literal '.' is common |
| 1223 | # (e.g. '-f "DTLS 1.2"'). |
| 1224 | need_grep= |
| 1225 | case "$FILTER" in |
| 1226 | '^$') simple_filter=;; |
| 1227 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1228 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1229 | need_grep=1;; |
| 1230 | *) # No regexp or shell-pattern special character |
| 1231 | simple_filter="*$FILTER*";; |
| 1232 | esac |
| 1233 | case "$EXCLUDE" in |
| 1234 | '^$') simple_exclude=;; |
| 1235 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1236 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1237 | need_grep=1;; |
| 1238 | *) # No regexp or shell-pattern special character |
| 1239 | simple_exclude="*$EXCLUDE*";; |
| 1240 | esac |
| 1241 | if [ -n "$need_grep" ]; then |
| 1242 | is_excluded () { |
| 1243 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1244 | } |
| 1245 | else |
| 1246 | is_excluded () { |
| 1247 | case "$1" in |
| 1248 | $simple_exclude) true;; |
| 1249 | $simple_filter) false;; |
| 1250 | *) true;; |
| 1251 | esac |
| 1252 | } |
| 1253 | fi |
| 1254 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1255 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1256 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1257 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1258 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1259 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1260 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1261 | exit 1 |
| 1262 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1263 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1264 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1265 | exit 1 |
| 1266 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1267 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1268 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1269 | exit 1 |
| 1270 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1271 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1272 | if which valgrind >/dev/null 2>&1; then :; else |
| 1273 | echo "Memcheck not possible. Valgrind not found" |
| 1274 | exit 1 |
| 1275 | fi |
| 1276 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1277 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1278 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1279 | exit 1 |
| 1280 | fi |
| 1281 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1282 | # used by watchdog |
| 1283 | MAIN_PID="$$" |
| 1284 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1285 | # We use somewhat arbitrary delays for tests: |
| 1286 | # - how long do we wait for the server to start (when lsof not available)? |
| 1287 | # - how long do we allow for the client to finish? |
| 1288 | # (not to check performance, just to avoid waiting indefinitely) |
| 1289 | # Things are slower with valgrind, so give extra time here. |
| 1290 | # |
| 1291 | # Note: without lsof, there is a trade-off between the running time of this |
| 1292 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1293 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1294 | # 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] | 1295 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1296 | START_DELAY=6 |
| 1297 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1298 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1299 | START_DELAY=2 |
| 1300 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1301 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1302 | |
| 1303 | # some particular tests need more time: |
| 1304 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1305 | # - for the server, we sleep for a number of seconds after the client exits |
| 1306 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1307 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1308 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1309 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1310 | # 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] | 1311 | # +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] | 1312 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1313 | 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] | 1314 | 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] | 1315 | O_SRV="$O_SRV -accept $SRV_PORT" |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 1316 | O_CLI="$O_CLI -connect localhost:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1317 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1318 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1319 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1320 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1321 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
| 1322 | O_LEGACY_CLI="$O_LEGACY_CLI -connect localhost:+SRV_PORT" |
| 1323 | fi |
| 1324 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1325 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1326 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
| 1327 | O_NEXT_CLI="$O_NEXT_CLI -connect localhost:+SRV_PORT" |
| 1328 | fi |
| 1329 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1330 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1331 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1332 | fi |
| 1333 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1334 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1335 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1336 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1337 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1338 | # Allow SHA-1, because many of our test certificates use it |
| 1339 | P_SRV="$P_SRV allow_sha1=1" |
| 1340 | P_CLI="$P_CLI allow_sha1=1" |
| 1341 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1342 | # Also pick a unique name for intermediate files |
| 1343 | SRV_OUT="srv_out.$$" |
| 1344 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1345 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1346 | SESSION="session.$$" |
| 1347 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1348 | SKIP_NEXT="NO" |
| 1349 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1350 | trap cleanup INT TERM HUP |
| 1351 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1352 | # Basic test |
| 1353 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1354 | # Checks that: |
| 1355 | # - 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] | 1356 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1357 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1358 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1359 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1360 | "$P_CLI" \ |
| 1361 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1362 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1363 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1364 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1365 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1366 | -S "error" \ |
| 1367 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1368 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1369 | run_test "Default, DTLS" \ |
| 1370 | "$P_SRV dtls=1" \ |
| 1371 | "$P_CLI dtls=1" \ |
| 1372 | 0 \ |
| 1373 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1374 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1375 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1376 | run_test "TLS client auth: required" \ |
| 1377 | "$P_SRV auth_mode=required" \ |
| 1378 | "$P_CLI" \ |
| 1379 | 0 \ |
| 1380 | -s "Verifying peer X.509 certificate... ok" |
| 1381 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1382 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1383 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1384 | requires_config_enabled MBEDTLS_SHA256_C |
| 1385 | run_test "TLS: password protected client key" \ |
| 1386 | "$P_SRV auth_mode=required" \ |
| 1387 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1388 | 0 |
| 1389 | |
| 1390 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1391 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1392 | requires_config_enabled MBEDTLS_SHA256_C |
| 1393 | run_test "TLS: password protected server key" \ |
| 1394 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1395 | "$P_CLI" \ |
| 1396 | 0 |
| 1397 | |
| 1398 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1399 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1400 | requires_config_enabled MBEDTLS_RSA_C |
| 1401 | requires_config_enabled MBEDTLS_SHA256_C |
| 1402 | run_test "TLS: password protected server key, two certificates" \ |
| 1403 | "$P_SRV \ |
| 1404 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1405 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1406 | "$P_CLI" \ |
| 1407 | 0 |
| 1408 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1409 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1410 | run_test "CA callback on client" \ |
| 1411 | "$P_SRV debug_level=3" \ |
| 1412 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1413 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1414 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1415 | -S "error" \ |
| 1416 | -C "error" |
| 1417 | |
| 1418 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1419 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1420 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1421 | requires_config_enabled MBEDTLS_SHA256_C |
| 1422 | run_test "CA callback on server" \ |
| 1423 | "$P_SRV auth_mode=required" \ |
| 1424 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1425 | key_file=data_files/server5.key" \ |
| 1426 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1427 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1428 | -s "Verifying peer X.509 certificate... ok" \ |
| 1429 | -S "error" \ |
| 1430 | -C "error" |
| 1431 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1432 | # Test using an opaque private key for client authentication |
| 1433 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1434 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1435 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1436 | requires_config_enabled MBEDTLS_SHA256_C |
| 1437 | run_test "Opaque key for client authentication" \ |
| 1438 | "$P_SRV auth_mode=required" \ |
| 1439 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1440 | key_file=data_files/server5.key" \ |
| 1441 | 0 \ |
| 1442 | -c "key type: Opaque" \ |
| 1443 | -s "Verifying peer X.509 certificate... ok" \ |
| 1444 | -S "error" \ |
| 1445 | -C "error" |
| 1446 | |
Przemyslaw Stekiel | 0483e3d | 2021-10-04 11:13:22 +0200 | [diff] [blame^] | 1447 | # Test using an opaque private key for server authentication |
| 1448 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1449 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1450 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1451 | requires_config_enabled MBEDTLS_SHA256_C |
| 1452 | run_test "Opaque key for server authentication" \ |
| 1453 | "$P_SRV auth_mode=required key_opaque=1" \ |
| 1454 | "$P_CLI crt_file=data_files/server5.crt \ |
| 1455 | key_file=data_files/server5.key" \ |
| 1456 | 0 \ |
| 1457 | -c "Verifying peer X.509 certificate... ok" \ |
| 1458 | -s "key type: Opaque" \ |
| 1459 | -S "error" \ |
| 1460 | -C "error" |
| 1461 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1462 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1463 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1464 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1465 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1466 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1467 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1468 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1469 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1470 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1471 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1472 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1473 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1474 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1475 | run_test_psa_force_curve "secp521r1" |
| 1476 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1477 | run_test_psa_force_curve "brainpoolP512r1" |
| 1478 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1479 | run_test_psa_force_curve "secp384r1" |
| 1480 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1481 | run_test_psa_force_curve "brainpoolP384r1" |
| 1482 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1483 | run_test_psa_force_curve "secp256r1" |
| 1484 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1485 | run_test_psa_force_curve "secp256k1" |
| 1486 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1487 | run_test_psa_force_curve "brainpoolP256r1" |
| 1488 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1489 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1490 | ## SECP224K1 is buggy via the PSA API |
| 1491 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1492 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1493 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1494 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1495 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1496 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1497 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1498 | run_test_psa_force_curve "secp192r1" |
| 1499 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1500 | run_test_psa_force_curve "secp192k1" |
| 1501 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1502 | # Test current time in ServerHello |
| 1503 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1504 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1505 | "$P_SRV debug_level=3" \ |
| 1506 | "$P_CLI debug_level=3" \ |
| 1507 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1508 | -f "check_server_hello_time" \ |
| 1509 | -F "check_server_hello_time" |
| 1510 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1511 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1512 | run_test "Unique IV in GCM" \ |
| 1513 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1514 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1515 | 0 \ |
| 1516 | -u "IV used" \ |
| 1517 | -U "IV used" |
| 1518 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1519 | # Tests for certificate verification callback |
| 1520 | run_test "Configuration-specific CRT verification callback" \ |
| 1521 | "$P_SRV debug_level=3" \ |
| 1522 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1523 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1524 | -S "error" \ |
| 1525 | -c "Verify requested for " \ |
| 1526 | -c "Use configuration-specific verification callback" \ |
| 1527 | -C "Use context-specific verification callback" \ |
| 1528 | -C "error" |
| 1529 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1530 | run_test "Context-specific CRT verification callback" \ |
| 1531 | "$P_SRV debug_level=3" \ |
| 1532 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1533 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1534 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1535 | -c "Verify requested for " \ |
| 1536 | -c "Use context-specific verification callback" \ |
| 1537 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1538 | -C "error" |
| 1539 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1540 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1541 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1542 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1543 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1544 | 1 \ |
| 1545 | -c "The certificate is signed with an unacceptable hash" |
| 1546 | |
| 1547 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1548 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1549 | "$P_CLI allow_sha1=1" \ |
| 1550 | 0 |
| 1551 | |
| 1552 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1553 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1554 | "$P_CLI allow_sha1=0" \ |
| 1555 | 0 |
| 1556 | |
| 1557 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1558 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1559 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1560 | 1 \ |
| 1561 | -s "The certificate is signed with an unacceptable hash" |
| 1562 | |
| 1563 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1564 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1565 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1566 | 0 |
| 1567 | |
| 1568 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1569 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1570 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1571 | 0 |
| 1572 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1573 | # Dummy TLS 1.3 test |
| 1574 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1575 | # ssl_client2/ssl_server2 example programs works. |
| 1576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1577 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1578 | "$P_SRV tls13_kex_modes=psk" \ |
| 1579 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1580 | 0 |
| 1581 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1582 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1583 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1584 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1585 | 0 |
| 1586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1587 | run_test "TLS 1.3, key exchange mode parameter passing: Pure-ephemeral only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1588 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1589 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1590 | 0 |
| 1591 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1592 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1593 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1594 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1595 | 0 |
| 1596 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1597 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1598 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1599 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1600 | 0 |
| 1601 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1602 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1603 | "$P_SRV tls13_kex_modes=all" \ |
| 1604 | "$P_CLI tls13_kex_modes=all" \ |
| 1605 | 0 |
| 1606 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1607 | # Tests for datagram packing |
| 1608 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1609 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1610 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1611 | 0 \ |
| 1612 | -c "next record in same datagram" \ |
| 1613 | -s "next record in same datagram" |
| 1614 | |
| 1615 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1616 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1617 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1618 | 0 \ |
| 1619 | -s "next record in same datagram" \ |
| 1620 | -C "next record in same datagram" |
| 1621 | |
| 1622 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1623 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1624 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1625 | 0 \ |
| 1626 | -S "next record in same datagram" \ |
| 1627 | -c "next record in same datagram" |
| 1628 | |
| 1629 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1630 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1631 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1632 | 0 \ |
| 1633 | -S "next record in same datagram" \ |
| 1634 | -C "next record in same datagram" |
| 1635 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1636 | # Tests for Context serialization |
| 1637 | |
| 1638 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1639 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1640 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1641 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1642 | 0 \ |
| 1643 | -c "Deserializing connection..." \ |
| 1644 | -S "Deserializing connection..." |
| 1645 | |
| 1646 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1647 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1648 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1649 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1650 | 0 \ |
| 1651 | -c "Deserializing connection..." \ |
| 1652 | -S "Deserializing connection..." |
| 1653 | |
| 1654 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1655 | run_test "Context serialization, client serializes, GCM" \ |
| 1656 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1657 | "$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] | 1658 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1659 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1660 | -S "Deserializing connection..." |
| 1661 | |
| 1662 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1663 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1664 | run_test "Context serialization, client serializes, with CID" \ |
| 1665 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1666 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1667 | 0 \ |
| 1668 | -c "Deserializing connection..." \ |
| 1669 | -S "Deserializing connection..." |
| 1670 | |
| 1671 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1672 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1673 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1674 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1675 | 0 \ |
| 1676 | -C "Deserializing connection..." \ |
| 1677 | -s "Deserializing connection..." |
| 1678 | |
| 1679 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1680 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1681 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1682 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1683 | 0 \ |
| 1684 | -C "Deserializing connection..." \ |
| 1685 | -s "Deserializing connection..." |
| 1686 | |
| 1687 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1688 | run_test "Context serialization, server serializes, GCM" \ |
| 1689 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1690 | "$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] | 1691 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1692 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1693 | -s "Deserializing connection..." |
| 1694 | |
| 1695 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1696 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1697 | run_test "Context serialization, server serializes, with CID" \ |
| 1698 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1699 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1700 | 0 \ |
| 1701 | -C "Deserializing connection..." \ |
| 1702 | -s "Deserializing connection..." |
| 1703 | |
| 1704 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1705 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1706 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1707 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1708 | 0 \ |
| 1709 | -c "Deserializing connection..." \ |
| 1710 | -s "Deserializing connection..." |
| 1711 | |
| 1712 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1713 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1714 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1715 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1716 | 0 \ |
| 1717 | -c "Deserializing connection..." \ |
| 1718 | -s "Deserializing connection..." |
| 1719 | |
| 1720 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1721 | run_test "Context serialization, both serialize, GCM" \ |
| 1722 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1723 | "$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] | 1724 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1725 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1726 | -s "Deserializing connection..." |
| 1727 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1728 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1729 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1730 | run_test "Context serialization, both serialize, with CID" \ |
| 1731 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1732 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1733 | 0 \ |
| 1734 | -c "Deserializing connection..." \ |
| 1735 | -s "Deserializing connection..." |
| 1736 | |
| 1737 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1738 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1739 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1740 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1741 | 0 \ |
| 1742 | -c "Deserializing connection..." \ |
| 1743 | -S "Deserializing connection..." |
| 1744 | |
| 1745 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1746 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1747 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1748 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1749 | 0 \ |
| 1750 | -c "Deserializing connection..." \ |
| 1751 | -S "Deserializing connection..." |
| 1752 | |
| 1753 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1754 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1755 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1756 | "$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] | 1757 | 0 \ |
| 1758 | -c "Deserializing connection..." \ |
| 1759 | -S "Deserializing connection..." |
| 1760 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1761 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1762 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1763 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1764 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1765 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1766 | 0 \ |
| 1767 | -c "Deserializing connection..." \ |
| 1768 | -S "Deserializing connection..." |
| 1769 | |
| 1770 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1771 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1772 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1773 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1774 | 0 \ |
| 1775 | -C "Deserializing connection..." \ |
| 1776 | -s "Deserializing connection..." |
| 1777 | |
| 1778 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1779 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1780 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1781 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1782 | 0 \ |
| 1783 | -C "Deserializing connection..." \ |
| 1784 | -s "Deserializing connection..." |
| 1785 | |
| 1786 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1787 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1788 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1789 | "$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] | 1790 | 0 \ |
| 1791 | -C "Deserializing connection..." \ |
| 1792 | -s "Deserializing connection..." |
| 1793 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1794 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1795 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1796 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1797 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1798 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1799 | 0 \ |
| 1800 | -C "Deserializing connection..." \ |
| 1801 | -s "Deserializing connection..." |
| 1802 | |
| 1803 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1804 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1805 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1806 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1807 | 0 \ |
| 1808 | -c "Deserializing connection..." \ |
| 1809 | -s "Deserializing connection..." |
| 1810 | |
| 1811 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1812 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1813 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1814 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1815 | 0 \ |
| 1816 | -c "Deserializing connection..." \ |
| 1817 | -s "Deserializing connection..." |
| 1818 | |
| 1819 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1820 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1821 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1822 | "$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] | 1823 | 0 \ |
| 1824 | -c "Deserializing connection..." \ |
| 1825 | -s "Deserializing connection..." |
| 1826 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1827 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1828 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1829 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1830 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1831 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1832 | 0 \ |
| 1833 | -c "Deserializing connection..." \ |
| 1834 | -s "Deserializing connection..." |
| 1835 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1836 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1837 | run_test "Saving the serialized context to a file" \ |
| 1838 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1839 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1840 | 0 \ |
| 1841 | -s "Save serialized context to a file... ok" \ |
| 1842 | -c "Save serialized context to a file... ok" |
| 1843 | rm -f context_srv.txt |
| 1844 | rm -f context_cli.txt |
| 1845 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1846 | # Tests for DTLS Connection ID extension |
| 1847 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1848 | # So far, the CID API isn't implemented, so we can't |
| 1849 | # grep for output witnessing its use. This needs to be |
| 1850 | # changed once the CID extension is implemented. |
| 1851 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1852 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1853 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1854 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1855 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1856 | 0 \ |
| 1857 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1858 | -s "found CID extension" \ |
| 1859 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1860 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1861 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1862 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1863 | -C "found CID extension" \ |
| 1864 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1865 | -C "Copy CIDs into SSL transform" \ |
| 1866 | -c "Use of Connection ID was rejected by the server" |
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 disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1870 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1871 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1872 | 0 \ |
| 1873 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1874 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1875 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1876 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1877 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1878 | -C "found CID extension" \ |
| 1879 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1880 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1881 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1882 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1883 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1884 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1885 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1886 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1887 | 0 \ |
| 1888 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1889 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1890 | -c "client hello, adding CID extension" \ |
| 1891 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1892 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1893 | -s "server hello, adding CID extension" \ |
| 1894 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1895 | -c "Use of CID extension negotiated" \ |
| 1896 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1897 | -c "Copy CIDs into SSL transform" \ |
| 1898 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1899 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1900 | -s "Use of Connection ID has been negotiated" \ |
| 1901 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1902 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1903 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1904 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1905 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1906 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1907 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1908 | 0 \ |
| 1909 | -c "Enable use of CID extension." \ |
| 1910 | -s "Enable use of CID extension." \ |
| 1911 | -c "client hello, adding CID extension" \ |
| 1912 | -s "found CID extension" \ |
| 1913 | -s "Use of CID extension negotiated" \ |
| 1914 | -s "server hello, adding CID extension" \ |
| 1915 | -c "found CID extension" \ |
| 1916 | -c "Use of CID extension negotiated" \ |
| 1917 | -s "Copy CIDs into SSL transform" \ |
| 1918 | -c "Copy CIDs into SSL transform" \ |
| 1919 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1920 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1921 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1922 | -c "Use of Connection ID has been negotiated" \ |
| 1923 | -c "ignoring unexpected CID" \ |
| 1924 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1925 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1926 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1927 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1928 | -p "$P_PXY mtu=800" \ |
| 1929 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1930 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1931 | 0 \ |
| 1932 | -c "Enable use of CID extension." \ |
| 1933 | -s "Enable use of CID extension." \ |
| 1934 | -c "client hello, adding CID extension" \ |
| 1935 | -s "found CID extension" \ |
| 1936 | -s "Use of CID extension negotiated" \ |
| 1937 | -s "server hello, adding CID extension" \ |
| 1938 | -c "found CID extension" \ |
| 1939 | -c "Use of CID extension negotiated" \ |
| 1940 | -s "Copy CIDs into SSL transform" \ |
| 1941 | -c "Copy CIDs into SSL transform" \ |
| 1942 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1943 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1944 | -s "Use of Connection ID has been negotiated" \ |
| 1945 | -c "Use of Connection ID has been negotiated" |
| 1946 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1947 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1948 | 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] | 1949 | -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] | 1950 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1951 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1952 | 0 \ |
| 1953 | -c "Enable use of CID extension." \ |
| 1954 | -s "Enable use of CID extension." \ |
| 1955 | -c "client hello, adding CID extension" \ |
| 1956 | -s "found CID extension" \ |
| 1957 | -s "Use of CID extension negotiated" \ |
| 1958 | -s "server hello, adding CID extension" \ |
| 1959 | -c "found CID extension" \ |
| 1960 | -c "Use of CID extension negotiated" \ |
| 1961 | -s "Copy CIDs into SSL transform" \ |
| 1962 | -c "Copy CIDs into SSL transform" \ |
| 1963 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1964 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1965 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1966 | -c "Use of Connection ID has been negotiated" \ |
| 1967 | -c "ignoring unexpected CID" \ |
| 1968 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1969 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1970 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1971 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1972 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1973 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1974 | 0 \ |
| 1975 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1976 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1977 | -c "client hello, adding CID extension" \ |
| 1978 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1979 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1980 | -s "server hello, adding CID extension" \ |
| 1981 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1982 | -c "Use of CID extension negotiated" \ |
| 1983 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1984 | -c "Copy CIDs into SSL transform" \ |
| 1985 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1986 | -s "Peer CID (length 0 Bytes):" \ |
| 1987 | -s "Use of Connection ID has been negotiated" \ |
| 1988 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1989 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1990 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1991 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1992 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1993 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1994 | 0 \ |
| 1995 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1996 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1997 | -c "client hello, adding CID extension" \ |
| 1998 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1999 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2000 | -s "server hello, adding CID extension" \ |
| 2001 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2002 | -c "Use of CID extension negotiated" \ |
| 2003 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2004 | -c "Copy CIDs into SSL transform" \ |
| 2005 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2006 | -c "Peer CID (length 0 Bytes):" \ |
| 2007 | -s "Use of Connection ID has been negotiated" \ |
| 2008 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2009 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2010 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2011 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2012 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2013 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2014 | 0 \ |
| 2015 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2016 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2017 | -c "client hello, adding CID extension" \ |
| 2018 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2019 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2020 | -s "server hello, adding CID extension" \ |
| 2021 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2022 | -c "Use of CID extension negotiated" \ |
| 2023 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2024 | -c "Copy CIDs into SSL transform" \ |
| 2025 | -S "Use of Connection ID has been negotiated" \ |
| 2026 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2027 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2028 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2029 | 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] | 2030 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2031 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2032 | 0 \ |
| 2033 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2034 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2035 | -c "client hello, adding CID extension" \ |
| 2036 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2037 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2038 | -s "server hello, adding CID extension" \ |
| 2039 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2040 | -c "Use of CID extension negotiated" \ |
| 2041 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2042 | -c "Copy CIDs into SSL transform" \ |
| 2043 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2044 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2045 | -s "Use of Connection ID has been negotiated" \ |
| 2046 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2047 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2048 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2049 | 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] | 2050 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2051 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2052 | 0 \ |
| 2053 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2054 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2055 | -c "client hello, adding CID extension" \ |
| 2056 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2057 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2058 | -s "server hello, adding CID extension" \ |
| 2059 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2060 | -c "Use of CID extension negotiated" \ |
| 2061 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2062 | -c "Copy CIDs into SSL transform" \ |
| 2063 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2064 | -s "Peer CID (length 0 Bytes):" \ |
| 2065 | -s "Use of Connection ID has been negotiated" \ |
| 2066 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2067 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2068 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2069 | 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] | 2070 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2071 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2072 | 0 \ |
| 2073 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2074 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2075 | -c "client hello, adding CID extension" \ |
| 2076 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2077 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2078 | -s "server hello, adding CID extension" \ |
| 2079 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2080 | -c "Use of CID extension negotiated" \ |
| 2081 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2082 | -c "Copy CIDs into SSL transform" \ |
| 2083 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2084 | -c "Peer CID (length 0 Bytes):" \ |
| 2085 | -s "Use of Connection ID has been negotiated" \ |
| 2086 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2087 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2088 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2089 | 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] | 2090 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2091 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2092 | 0 \ |
| 2093 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2094 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2095 | -c "client hello, adding CID extension" \ |
| 2096 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2097 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2098 | -s "server hello, adding CID extension" \ |
| 2099 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2100 | -c "Use of CID extension negotiated" \ |
| 2101 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2102 | -c "Copy CIDs into SSL transform" \ |
| 2103 | -S "Use of Connection ID has been negotiated" \ |
| 2104 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2105 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2106 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2107 | 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] | 2108 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2109 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2110 | 0 \ |
| 2111 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2112 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2113 | -c "client hello, adding CID extension" \ |
| 2114 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2115 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2116 | -s "server hello, adding CID extension" \ |
| 2117 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2118 | -c "Use of CID extension negotiated" \ |
| 2119 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2120 | -c "Copy CIDs into SSL transform" \ |
| 2121 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2122 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2123 | -s "Use of Connection ID has been negotiated" \ |
| 2124 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2125 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2126 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2127 | 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] | 2128 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2129 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2130 | 0 \ |
| 2131 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2132 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2133 | -c "client hello, adding CID extension" \ |
| 2134 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2135 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2136 | -s "server hello, adding CID extension" \ |
| 2137 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2138 | -c "Use of CID extension negotiated" \ |
| 2139 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2140 | -c "Copy CIDs into SSL transform" \ |
| 2141 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2142 | -s "Peer CID (length 0 Bytes):" \ |
| 2143 | -s "Use of Connection ID has been negotiated" \ |
| 2144 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2145 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2146 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2147 | 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] | 2148 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2149 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2150 | 0 \ |
| 2151 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2152 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2153 | -c "client hello, adding CID extension" \ |
| 2154 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2155 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2156 | -s "server hello, adding CID extension" \ |
| 2157 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2158 | -c "Use of CID extension negotiated" \ |
| 2159 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2160 | -c "Copy CIDs into SSL transform" \ |
| 2161 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2162 | -c "Peer CID (length 0 Bytes):" \ |
| 2163 | -s "Use of Connection ID has been negotiated" \ |
| 2164 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2165 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2166 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2167 | 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] | 2168 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2169 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2170 | 0 \ |
| 2171 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2172 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2173 | -c "client hello, adding CID extension" \ |
| 2174 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2175 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2176 | -s "server hello, adding CID extension" \ |
| 2177 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2178 | -c "Use of CID extension negotiated" \ |
| 2179 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2180 | -c "Copy CIDs into SSL transform" \ |
| 2181 | -S "Use of Connection ID has been negotiated" \ |
| 2182 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2183 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2184 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2185 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2186 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2187 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2188 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2189 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2190 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2191 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2192 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2193 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2194 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2195 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2196 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2197 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2198 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2199 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2200 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2201 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2202 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2203 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2204 | 0 \ |
| 2205 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2206 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2207 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2208 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2209 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2210 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2211 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2212 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2213 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2214 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2215 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2216 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2217 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2218 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2219 | 0 \ |
| 2220 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2221 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2222 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2223 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2224 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2225 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2226 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2227 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2228 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2229 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2230 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2231 | 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] | 2232 | -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] | 2233 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2234 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2235 | 0 \ |
| 2236 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2237 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2238 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2239 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2240 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2241 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 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 has been negotiated" \ |
| 2244 | -c "ignoring unexpected CID" \ |
| 2245 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2246 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2247 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2248 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2249 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2250 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2251 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2252 | 0 \ |
| 2253 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2254 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2255 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2256 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2257 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2258 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2259 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2260 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2261 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2262 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2263 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2264 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2265 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2266 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 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 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2273 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2274 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2275 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2276 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2277 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2278 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2279 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2280 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2281 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2282 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2283 | 0 \ |
| 2284 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2285 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2286 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2287 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2288 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2289 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2290 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2291 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2292 | -c "ignoring unexpected CID" \ |
| 2293 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2294 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2295 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2296 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2297 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2298 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2299 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2300 | 0 \ |
| 2301 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2302 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2303 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2304 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2305 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2306 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2307 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2308 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2309 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2310 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2311 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2312 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2313 | 0 \ |
| 2314 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2315 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2316 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2317 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2318 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2319 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2320 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2321 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2322 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2323 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2324 | -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] | 2325 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2326 | "$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" \ |
| 2327 | 0 \ |
| 2328 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2329 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2330 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2331 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2332 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2333 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2334 | -c "ignoring unexpected CID" \ |
| 2335 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2336 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2337 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2338 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2339 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2340 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2341 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2342 | 0 \ |
| 2343 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2344 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2345 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2346 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2347 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2348 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2349 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2350 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2351 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2352 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2353 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2354 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2355 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2356 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2357 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2358 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2359 | 0 \ |
| 2360 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2361 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2362 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2363 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2364 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2365 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2366 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2367 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2368 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2369 | -c "ignoring unexpected CID" \ |
| 2370 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2371 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2372 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2373 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2374 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2375 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2376 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2377 | 0 \ |
| 2378 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2379 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2380 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2381 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2382 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2383 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2384 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2385 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2386 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2387 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2388 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2389 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2390 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2391 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2392 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2393 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2394 | 0 \ |
| 2395 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2396 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2397 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2398 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2399 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2400 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2401 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2402 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2403 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2404 | -c "ignoring unexpected CID" \ |
| 2405 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2406 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2407 | # This and the test below it require MAX_CONTENT_LEN to be at least MFL+1, because the |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2408 | # tests check that the buffer contents are reallocated when the message is |
| 2409 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2410 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2411 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2412 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2413 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2414 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2415 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2416 | 0 \ |
| 2417 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2418 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2419 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2420 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2421 | -s "Reallocating in_buf" \ |
| 2422 | -s "Reallocating out_buf" |
| 2423 | |
| 2424 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2425 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2426 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2427 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2428 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2429 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2430 | 0 \ |
| 2431 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2432 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2433 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2434 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2435 | -s "Reallocating in_buf" \ |
| 2436 | -s "Reallocating out_buf" |
| 2437 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2438 | # Tests for Encrypt-then-MAC extension |
| 2439 | |
| 2440 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2441 | "$P_SRV debug_level=3 \ |
| 2442 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2443 | "$P_CLI debug_level=3" \ |
| 2444 | 0 \ |
| 2445 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2446 | -s "found encrypt then mac extension" \ |
| 2447 | -s "server hello, adding encrypt then mac extension" \ |
| 2448 | -c "found encrypt_then_mac extension" \ |
| 2449 | -c "using encrypt then mac" \ |
| 2450 | -s "using encrypt then mac" |
| 2451 | |
| 2452 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2453 | "$P_SRV debug_level=3 etm=0 \ |
| 2454 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2455 | "$P_CLI debug_level=3 etm=1" \ |
| 2456 | 0 \ |
| 2457 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2458 | -s "found encrypt then mac extension" \ |
| 2459 | -S "server hello, adding encrypt then mac extension" \ |
| 2460 | -C "found encrypt_then_mac extension" \ |
| 2461 | -C "using encrypt then mac" \ |
| 2462 | -S "using encrypt then mac" |
| 2463 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2464 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2465 | "$P_SRV debug_level=3 etm=1 \ |
| 2466 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2467 | "$P_CLI debug_level=3 etm=1" \ |
| 2468 | 0 \ |
| 2469 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2470 | -s "found encrypt then mac extension" \ |
| 2471 | -S "server hello, adding encrypt then mac extension" \ |
| 2472 | -C "found encrypt_then_mac extension" \ |
| 2473 | -C "using encrypt then mac" \ |
| 2474 | -S "using encrypt then mac" |
| 2475 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2476 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2477 | "$P_SRV debug_level=3 etm=1 \ |
| 2478 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2479 | "$P_CLI debug_level=3 etm=0" \ |
| 2480 | 0 \ |
| 2481 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2482 | -S "found encrypt then mac extension" \ |
| 2483 | -S "server hello, adding encrypt then mac extension" \ |
| 2484 | -C "found encrypt_then_mac extension" \ |
| 2485 | -C "using encrypt then mac" \ |
| 2486 | -S "using encrypt then mac" |
| 2487 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2488 | # Tests for Extended Master Secret extension |
| 2489 | |
| 2490 | run_test "Extended Master Secret: default" \ |
| 2491 | "$P_SRV debug_level=3" \ |
| 2492 | "$P_CLI debug_level=3" \ |
| 2493 | 0 \ |
| 2494 | -c "client hello, adding extended_master_secret extension" \ |
| 2495 | -s "found extended master secret extension" \ |
| 2496 | -s "server hello, adding extended master secret extension" \ |
| 2497 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2498 | -c "session hash for extended master secret" \ |
| 2499 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2500 | |
| 2501 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2502 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2503 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2504 | 0 \ |
| 2505 | -c "client hello, adding extended_master_secret extension" \ |
| 2506 | -s "found extended master secret extension" \ |
| 2507 | -S "server hello, adding extended master secret extension" \ |
| 2508 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2509 | -C "session hash for extended master secret" \ |
| 2510 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2511 | |
| 2512 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2513 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2514 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2515 | 0 \ |
| 2516 | -C "client hello, adding extended_master_secret extension" \ |
| 2517 | -S "found extended master secret extension" \ |
| 2518 | -S "server hello, adding extended master secret extension" \ |
| 2519 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2520 | -C "session hash for extended master secret" \ |
| 2521 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2522 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2523 | # Test sending and receiving empty application data records |
| 2524 | |
| 2525 | run_test "Encrypt then MAC: empty application data record" \ |
| 2526 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2527 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2528 | 0 \ |
| 2529 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2530 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2531 | -c "0 bytes written in 1 fragments" |
| 2532 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2533 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2534 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2535 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2536 | 0 \ |
| 2537 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2538 | -c "0 bytes written in 1 fragments" |
| 2539 | |
| 2540 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2541 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2542 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2543 | 0 \ |
| 2544 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2545 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2546 | -c "0 bytes written in 1 fragments" |
| 2547 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2548 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2549 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2550 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2551 | 0 \ |
| 2552 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2553 | -c "0 bytes written in 1 fragments" |
| 2554 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2555 | # Tests for CBC 1/n-1 record splitting |
| 2556 | |
| 2557 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2558 | "$P_SRV" \ |
| 2559 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2560 | request_size=123 force_version=tls1_2" \ |
| 2561 | 0 \ |
| 2562 | -s "Read from client: 123 bytes read" \ |
| 2563 | -S "Read from client: 1 bytes read" \ |
| 2564 | -S "122 bytes read" |
| 2565 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2566 | # Tests for Session Tickets |
| 2567 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2568 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2569 | "$P_SRV debug_level=3 tickets=1" \ |
| 2570 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2571 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2572 | -c "client hello, adding session ticket extension" \ |
| 2573 | -s "found session ticket extension" \ |
| 2574 | -s "server hello, adding session ticket extension" \ |
| 2575 | -c "found session_ticket extension" \ |
| 2576 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2577 | -S "session successfully restored from cache" \ |
| 2578 | -s "session successfully restored from ticket" \ |
| 2579 | -s "a session has been resumed" \ |
| 2580 | -c "a session has been resumed" |
| 2581 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2582 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2583 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2584 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2585 | 0 \ |
| 2586 | -c "client hello, adding session ticket extension" \ |
| 2587 | -s "found session ticket extension" \ |
| 2588 | -s "server hello, adding session ticket extension" \ |
| 2589 | -c "found session_ticket extension" \ |
| 2590 | -c "parse new session ticket" \ |
| 2591 | -S "session successfully restored from cache" \ |
| 2592 | -s "session successfully restored from ticket" \ |
| 2593 | -s "a session has been resumed" \ |
| 2594 | -c "a session has been resumed" |
| 2595 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2596 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2597 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2598 | "$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] | 2599 | 0 \ |
| 2600 | -c "client hello, adding session ticket extension" \ |
| 2601 | -s "found session ticket extension" \ |
| 2602 | -s "server hello, adding session ticket extension" \ |
| 2603 | -c "found session_ticket extension" \ |
| 2604 | -c "parse new session ticket" \ |
| 2605 | -S "session successfully restored from cache" \ |
| 2606 | -S "session successfully restored from ticket" \ |
| 2607 | -S "a session has been resumed" \ |
| 2608 | -C "a session has been resumed" |
| 2609 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2610 | run_test "Session resume using tickets: session copy" \ |
| 2611 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2612 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2613 | 0 \ |
| 2614 | -c "client hello, adding session ticket extension" \ |
| 2615 | -s "found session ticket extension" \ |
| 2616 | -s "server hello, adding session ticket extension" \ |
| 2617 | -c "found session_ticket extension" \ |
| 2618 | -c "parse new session ticket" \ |
| 2619 | -S "session successfully restored from cache" \ |
| 2620 | -s "session successfully restored from ticket" \ |
| 2621 | -s "a session has been resumed" \ |
| 2622 | -c "a session has been resumed" |
| 2623 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2624 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2625 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2626 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2627 | 0 \ |
| 2628 | -c "client hello, adding session ticket extension" \ |
| 2629 | -c "found session_ticket extension" \ |
| 2630 | -c "parse new session ticket" \ |
| 2631 | -c "a session has been resumed" |
| 2632 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2633 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2634 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2635 | "( $O_CLI -sess_out $SESSION; \ |
| 2636 | $O_CLI -sess_in $SESSION; \ |
| 2637 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2638 | 0 \ |
| 2639 | -s "found session ticket extension" \ |
| 2640 | -s "server hello, adding session ticket extension" \ |
| 2641 | -S "session successfully restored from cache" \ |
| 2642 | -s "session successfully restored from ticket" \ |
| 2643 | -s "a session has been resumed" |
| 2644 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2645 | # Tests for Session Tickets with DTLS |
| 2646 | |
| 2647 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2648 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2649 | "$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] | 2650 | 0 \ |
| 2651 | -c "client hello, adding session ticket extension" \ |
| 2652 | -s "found session ticket extension" \ |
| 2653 | -s "server hello, adding session ticket extension" \ |
| 2654 | -c "found session_ticket extension" \ |
| 2655 | -c "parse new session ticket" \ |
| 2656 | -S "session successfully restored from cache" \ |
| 2657 | -s "session successfully restored from ticket" \ |
| 2658 | -s "a session has been resumed" \ |
| 2659 | -c "a session has been resumed" |
| 2660 | |
| 2661 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2662 | "$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] | 2663 | "$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] | 2664 | 0 \ |
| 2665 | -c "client hello, adding session ticket extension" \ |
| 2666 | -s "found session ticket extension" \ |
| 2667 | -s "server hello, adding session ticket extension" \ |
| 2668 | -c "found session_ticket extension" \ |
| 2669 | -c "parse new session ticket" \ |
| 2670 | -S "session successfully restored from cache" \ |
| 2671 | -s "session successfully restored from ticket" \ |
| 2672 | -s "a session has been resumed" \ |
| 2673 | -c "a session has been resumed" |
| 2674 | |
| 2675 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2676 | "$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] | 2677 | "$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] | 2678 | 0 \ |
| 2679 | -c "client hello, adding session ticket extension" \ |
| 2680 | -s "found session ticket extension" \ |
| 2681 | -s "server hello, adding session ticket extension" \ |
| 2682 | -c "found session_ticket extension" \ |
| 2683 | -c "parse new session ticket" \ |
| 2684 | -S "session successfully restored from cache" \ |
| 2685 | -S "session successfully restored from ticket" \ |
| 2686 | -S "a session has been resumed" \ |
| 2687 | -C "a session has been resumed" |
| 2688 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2689 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2690 | "$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] | 2691 | "$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] | 2692 | 0 \ |
| 2693 | -c "client hello, adding session ticket extension" \ |
| 2694 | -s "found session ticket extension" \ |
| 2695 | -s "server hello, adding session ticket extension" \ |
| 2696 | -c "found session_ticket extension" \ |
| 2697 | -c "parse new session ticket" \ |
| 2698 | -S "session successfully restored from cache" \ |
| 2699 | -s "session successfully restored from ticket" \ |
| 2700 | -s "a session has been resumed" \ |
| 2701 | -c "a session has been resumed" |
| 2702 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2703 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2704 | "$O_SRV -dtls" \ |
| 2705 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2706 | 0 \ |
| 2707 | -c "client hello, adding session ticket extension" \ |
| 2708 | -c "found session_ticket extension" \ |
| 2709 | -c "parse new session ticket" \ |
| 2710 | -c "a session has been resumed" |
| 2711 | |
| 2712 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2713 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2714 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2715 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2716 | rm -f $SESSION )" \ |
| 2717 | 0 \ |
| 2718 | -s "found session ticket extension" \ |
| 2719 | -s "server hello, adding session ticket extension" \ |
| 2720 | -S "session successfully restored from cache" \ |
| 2721 | -s "session successfully restored from ticket" \ |
| 2722 | -s "a session has been resumed" |
| 2723 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2724 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2725 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2726 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2727 | "$P_SRV debug_level=3 tickets=0" \ |
| 2728 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2729 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2730 | -c "client hello, adding session ticket extension" \ |
| 2731 | -s "found session ticket extension" \ |
| 2732 | -S "server hello, adding session ticket extension" \ |
| 2733 | -C "found session_ticket extension" \ |
| 2734 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 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 | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2740 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2741 | "$P_SRV debug_level=3 tickets=1" \ |
| 2742 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2743 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2744 | -C "client hello, adding session ticket extension" \ |
| 2745 | -S "found session ticket extension" \ |
| 2746 | -S "server hello, adding session ticket extension" \ |
| 2747 | -C "found session_ticket extension" \ |
| 2748 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2749 | -s "session successfully restored from cache" \ |
| 2750 | -S "session successfully restored from ticket" \ |
| 2751 | -s "a session has been resumed" \ |
| 2752 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2753 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2754 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2755 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2756 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2757 | 0 \ |
| 2758 | -S "session successfully restored from cache" \ |
| 2759 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2760 | -S "a session has been resumed" \ |
| 2761 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2762 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2763 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2764 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2765 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2766 | 0 \ |
| 2767 | -s "session successfully restored from cache" \ |
| 2768 | -S "session successfully restored from ticket" \ |
| 2769 | -s "a session has been resumed" \ |
| 2770 | -c "a session has been resumed" |
| 2771 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2772 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2773 | "$P_SRV debug_level=3 tickets=0" \ |
| 2774 | "$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] | 2775 | 0 \ |
| 2776 | -s "session successfully restored from cache" \ |
| 2777 | -S "session successfully restored from ticket" \ |
| 2778 | -s "a session has been resumed" \ |
| 2779 | -c "a session has been resumed" |
| 2780 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2781 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2782 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2783 | "$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] | 2784 | 0 \ |
| 2785 | -S "session successfully restored from cache" \ |
| 2786 | -S "session successfully restored from ticket" \ |
| 2787 | -S "a session has been resumed" \ |
| 2788 | -C "a session has been resumed" |
| 2789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2790 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2791 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2792 | "$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] | 2793 | 0 \ |
| 2794 | -s "session successfully restored from cache" \ |
| 2795 | -S "session successfully restored from ticket" \ |
| 2796 | -s "a session has been resumed" \ |
| 2797 | -c "a session has been resumed" |
| 2798 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2799 | run_test "Session resume using cache: session copy" \ |
| 2800 | "$P_SRV debug_level=3 tickets=0" \ |
| 2801 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2802 | 0 \ |
| 2803 | -s "session successfully restored from cache" \ |
| 2804 | -S "session successfully restored from ticket" \ |
| 2805 | -s "a session has been resumed" \ |
| 2806 | -c "a session has been resumed" |
| 2807 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2808 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2809 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2810 | "( $O_CLI -sess_out $SESSION; \ |
| 2811 | $O_CLI -sess_in $SESSION; \ |
| 2812 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2813 | 0 \ |
| 2814 | -s "found session ticket extension" \ |
| 2815 | -S "server hello, adding session ticket extension" \ |
| 2816 | -s "session successfully restored from cache" \ |
| 2817 | -S "session successfully restored from ticket" \ |
| 2818 | -s "a session has been resumed" |
| 2819 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2820 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2821 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2822 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2823 | 0 \ |
| 2824 | -C "found session_ticket extension" \ |
| 2825 | -C "parse new session ticket" \ |
| 2826 | -c "a session has been resumed" |
| 2827 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2828 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2829 | |
| 2830 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2831 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2832 | "$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] | 2833 | 0 \ |
| 2834 | -c "client hello, adding session ticket extension" \ |
| 2835 | -s "found session ticket extension" \ |
| 2836 | -S "server hello, adding session ticket extension" \ |
| 2837 | -C "found session_ticket extension" \ |
| 2838 | -C "parse new session ticket" \ |
| 2839 | -s "session successfully restored from cache" \ |
| 2840 | -S "session successfully restored from ticket" \ |
| 2841 | -s "a session has been resumed" \ |
| 2842 | -c "a session has been resumed" |
| 2843 | |
| 2844 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2845 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2846 | "$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] | 2847 | 0 \ |
| 2848 | -C "client hello, adding session ticket extension" \ |
| 2849 | -S "found session ticket extension" \ |
| 2850 | -S "server hello, adding session ticket extension" \ |
| 2851 | -C "found session_ticket extension" \ |
| 2852 | -C "parse new session ticket" \ |
| 2853 | -s "session successfully restored from cache" \ |
| 2854 | -S "session successfully restored from ticket" \ |
| 2855 | -s "a session has been resumed" \ |
| 2856 | -c "a session has been resumed" |
| 2857 | |
| 2858 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2859 | "$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] | 2860 | "$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] | 2861 | 0 \ |
| 2862 | -S "session successfully restored from cache" \ |
| 2863 | -S "session successfully restored from ticket" \ |
| 2864 | -S "a session has been resumed" \ |
| 2865 | -C "a session has been resumed" |
| 2866 | |
| 2867 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2868 | "$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] | 2869 | "$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] | 2870 | 0 \ |
| 2871 | -s "session successfully restored from cache" \ |
| 2872 | -S "session successfully restored from ticket" \ |
| 2873 | -s "a session has been resumed" \ |
| 2874 | -c "a session has been resumed" |
| 2875 | |
| 2876 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2877 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2878 | "$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] | 2879 | 0 \ |
| 2880 | -s "session successfully restored from cache" \ |
| 2881 | -S "session successfully restored from ticket" \ |
| 2882 | -s "a session has been resumed" \ |
| 2883 | -c "a session has been resumed" |
| 2884 | |
| 2885 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2886 | "$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] | 2887 | "$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] | 2888 | 0 \ |
| 2889 | -S "session successfully restored from cache" \ |
| 2890 | -S "session successfully restored from ticket" \ |
| 2891 | -S "a session has been resumed" \ |
| 2892 | -C "a session has been resumed" |
| 2893 | |
| 2894 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2895 | "$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] | 2896 | "$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] | 2897 | 0 \ |
| 2898 | -s "session successfully restored from cache" \ |
| 2899 | -S "session successfully restored from ticket" \ |
| 2900 | -s "a session has been resumed" \ |
| 2901 | -c "a session has been resumed" |
| 2902 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2903 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2904 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2905 | "$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] | 2906 | 0 \ |
| 2907 | -s "session successfully restored from cache" \ |
| 2908 | -S "session successfully restored from ticket" \ |
| 2909 | -s "a session has been resumed" \ |
| 2910 | -c "a session has been resumed" |
| 2911 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2912 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2913 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2914 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2915 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2916 | rm -f $SESSION )" \ |
| 2917 | 0 \ |
| 2918 | -s "found session ticket extension" \ |
| 2919 | -S "server hello, adding session ticket extension" \ |
| 2920 | -s "session successfully restored from cache" \ |
| 2921 | -S "session successfully restored from ticket" \ |
| 2922 | -s "a session has been resumed" |
| 2923 | |
| 2924 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2925 | "$O_SRV -dtls" \ |
| 2926 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2927 | 0 \ |
| 2928 | -C "found session_ticket extension" \ |
| 2929 | -C "parse new session ticket" \ |
| 2930 | -c "a session has been resumed" |
| 2931 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2932 | # Tests for Max Fragment Length extension |
| 2933 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2934 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2935 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2936 | "$P_SRV debug_level=3" \ |
| 2937 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2938 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2939 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2940 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2941 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2942 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2943 | -C "client hello, adding max_fragment_length extension" \ |
| 2944 | -S "found max fragment length extension" \ |
| 2945 | -S "server hello, max_fragment_length extension" \ |
| 2946 | -C "found max_fragment_length extension" |
| 2947 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2948 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2949 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2950 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2951 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2952 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2953 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2954 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2955 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2956 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2957 | -C "client hello, adding max_fragment_length extension" \ |
| 2958 | -S "found max fragment length extension" \ |
| 2959 | -S "server hello, max_fragment_length extension" \ |
| 2960 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2961 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2962 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2963 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2964 | |
| 2965 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2966 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2967 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2968 | "$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] | 2969 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2970 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2971 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2972 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2973 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2974 | -C "client hello, adding max_fragment_length extension" \ |
| 2975 | -S "found max fragment length extension" \ |
| 2976 | -S "server hello, max_fragment_length extension" \ |
| 2977 | -C "found max_fragment_length extension" \ |
| 2978 | -c "fragment larger than.*maximum " |
| 2979 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2980 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2981 | # (session fragment length will be 16384 regardless of mbedtls |
| 2982 | # content length configuration.) |
| 2983 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2984 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2985 | run_test "Max fragment length: disabled, larger message" \ |
| 2986 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2987 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2988 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2989 | -C "Maximum incoming record payload length is 16384" \ |
| 2990 | -C "Maximum outgoing record payload length is 16384" \ |
| 2991 | -S "Maximum incoming record payload length is 16384" \ |
| 2992 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2993 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2994 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2995 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2996 | |
| 2997 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2998 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2999 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3000 | "$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] | 3001 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3002 | -C "Maximum incoming record payload length is 16384" \ |
| 3003 | -C "Maximum outgoing record payload length is 16384" \ |
| 3004 | -S "Maximum incoming record payload length is 16384" \ |
| 3005 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3006 | -c "fragment larger than.*maximum " |
| 3007 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3008 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3009 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3010 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3011 | "$P_SRV debug_level=3" \ |
| 3012 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3013 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3014 | -c "Maximum incoming record payload length is 4096" \ |
| 3015 | -c "Maximum outgoing record payload length is 4096" \ |
| 3016 | -s "Maximum incoming record payload length is 4096" \ |
| 3017 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3018 | -c "client hello, adding max_fragment_length extension" \ |
| 3019 | -s "found max fragment length extension" \ |
| 3020 | -s "server hello, max_fragment_length extension" \ |
| 3021 | -c "found max_fragment_length extension" |
| 3022 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3023 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3024 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3025 | run_test "Max fragment length: client 512, server 1024" \ |
| 3026 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3027 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3028 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3029 | -c "Maximum incoming record payload length is 512" \ |
| 3030 | -c "Maximum outgoing record payload length is 512" \ |
| 3031 | -s "Maximum incoming record payload length is 512" \ |
| 3032 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3033 | -c "client hello, adding max_fragment_length extension" \ |
| 3034 | -s "found max fragment length extension" \ |
| 3035 | -s "server hello, max_fragment_length extension" \ |
| 3036 | -c "found max_fragment_length extension" |
| 3037 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3038 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3039 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3040 | run_test "Max fragment length: client 512, server 2048" \ |
| 3041 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3042 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3043 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3044 | -c "Maximum incoming record payload length is 512" \ |
| 3045 | -c "Maximum outgoing record payload length is 512" \ |
| 3046 | -s "Maximum incoming record payload length is 512" \ |
| 3047 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3048 | -c "client hello, adding max_fragment_length extension" \ |
| 3049 | -s "found max fragment length extension" \ |
| 3050 | -s "server hello, max_fragment_length extension" \ |
| 3051 | -c "found max_fragment_length extension" |
| 3052 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3053 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3054 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3055 | run_test "Max fragment length: client 512, server 4096" \ |
| 3056 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3057 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3058 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3059 | -c "Maximum incoming record payload length is 512" \ |
| 3060 | -c "Maximum outgoing record payload length is 512" \ |
| 3061 | -s "Maximum incoming record payload length is 512" \ |
| 3062 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3063 | -c "client hello, adding max_fragment_length extension" \ |
| 3064 | -s "found max fragment length extension" \ |
| 3065 | -s "server hello, max_fragment_length extension" \ |
| 3066 | -c "found max_fragment_length extension" |
| 3067 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3068 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3069 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3070 | run_test "Max fragment length: client 1024, server 512" \ |
| 3071 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3072 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3073 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3074 | -c "Maximum incoming record payload length is 1024" \ |
| 3075 | -c "Maximum outgoing record payload length is 1024" \ |
| 3076 | -s "Maximum incoming record payload length is 1024" \ |
| 3077 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3078 | -c "client hello, adding max_fragment_length extension" \ |
| 3079 | -s "found max fragment length extension" \ |
| 3080 | -s "server hello, max_fragment_length extension" \ |
| 3081 | -c "found max_fragment_length extension" |
| 3082 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3083 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3084 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3085 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3086 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3087 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3088 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3089 | -c "Maximum incoming record payload length is 1024" \ |
| 3090 | -c "Maximum outgoing record payload length is 1024" \ |
| 3091 | -s "Maximum incoming record payload length is 1024" \ |
| 3092 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3093 | -c "client hello, adding max_fragment_length extension" \ |
| 3094 | -s "found max fragment length extension" \ |
| 3095 | -s "server hello, max_fragment_length extension" \ |
| 3096 | -c "found max_fragment_length extension" |
| 3097 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3098 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3099 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3100 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3101 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3102 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3103 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3104 | -c "Maximum incoming record payload length is 1024" \ |
| 3105 | -c "Maximum outgoing record payload length is 1024" \ |
| 3106 | -s "Maximum incoming record payload length is 1024" \ |
| 3107 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3108 | -c "client hello, adding max_fragment_length extension" \ |
| 3109 | -s "found max fragment length extension" \ |
| 3110 | -s "server hello, max_fragment_length extension" \ |
| 3111 | -c "found max_fragment_length extension" |
| 3112 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3113 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3114 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3115 | run_test "Max fragment length: client 2048, server 512" \ |
| 3116 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3117 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3118 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3119 | -c "Maximum incoming record payload length is 2048" \ |
| 3120 | -c "Maximum outgoing record payload length is 2048" \ |
| 3121 | -s "Maximum incoming record payload length is 2048" \ |
| 3122 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3123 | -c "client hello, adding max_fragment_length extension" \ |
| 3124 | -s "found max fragment length extension" \ |
| 3125 | -s "server hello, max_fragment_length extension" \ |
| 3126 | -c "found max_fragment_length extension" |
| 3127 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3128 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3129 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3130 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3131 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3132 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3133 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3134 | -c "Maximum incoming record payload length is 2048" \ |
| 3135 | -c "Maximum outgoing record payload length is 2048" \ |
| 3136 | -s "Maximum incoming record payload length is 2048" \ |
| 3137 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3138 | -c "client hello, adding max_fragment_length extension" \ |
| 3139 | -s "found max fragment length extension" \ |
| 3140 | -s "server hello, max_fragment_length extension" \ |
| 3141 | -c "found max_fragment_length extension" |
| 3142 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3143 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3144 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3145 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3146 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3147 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3148 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3149 | -c "Maximum incoming record payload length is 2048" \ |
| 3150 | -c "Maximum outgoing record payload length is 2048" \ |
| 3151 | -s "Maximum incoming record payload length is 2048" \ |
| 3152 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3153 | -c "client hello, adding max_fragment_length extension" \ |
| 3154 | -s "found max fragment length extension" \ |
| 3155 | -s "server hello, max_fragment_length extension" \ |
| 3156 | -c "found max_fragment_length extension" |
| 3157 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3158 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3159 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3160 | run_test "Max fragment length: client 4096, server 512" \ |
| 3161 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3162 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3163 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3164 | -c "Maximum incoming record payload length is 4096" \ |
| 3165 | -c "Maximum outgoing record payload length is 4096" \ |
| 3166 | -s "Maximum incoming record payload length is 4096" \ |
| 3167 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3168 | -c "client hello, adding max_fragment_length extension" \ |
| 3169 | -s "found max fragment length extension" \ |
| 3170 | -s "server hello, max_fragment_length extension" \ |
| 3171 | -c "found max_fragment_length extension" |
| 3172 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3173 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3174 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3175 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3176 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3177 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3178 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3179 | -c "Maximum incoming record payload length is 4096" \ |
| 3180 | -c "Maximum outgoing record payload length is 4096" \ |
| 3181 | -s "Maximum incoming record payload length is 4096" \ |
| 3182 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3183 | -c "client hello, adding max_fragment_length extension" \ |
| 3184 | -s "found max fragment length extension" \ |
| 3185 | -s "server hello, max_fragment_length extension" \ |
| 3186 | -c "found max_fragment_length extension" |
| 3187 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3188 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3189 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3190 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3191 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3192 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3193 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3194 | -c "Maximum incoming record payload length is 4096" \ |
| 3195 | -c "Maximum outgoing record payload length is 4096" \ |
| 3196 | -s "Maximum incoming record payload length is 4096" \ |
| 3197 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3198 | -c "client hello, adding max_fragment_length extension" \ |
| 3199 | -s "found max fragment length extension" \ |
| 3200 | -s "server hello, max_fragment_length extension" \ |
| 3201 | -c "found max_fragment_length extension" |
| 3202 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3203 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3204 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3205 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3206 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3207 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3208 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3209 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3210 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3211 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3212 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3213 | -C "client hello, adding max_fragment_length extension" \ |
| 3214 | -S "found max fragment length extension" \ |
| 3215 | -S "server hello, max_fragment_length extension" \ |
| 3216 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3217 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3218 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3219 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3220 | requires_gnutls |
| 3221 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3222 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3223 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3224 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3225 | -c "Maximum incoming record payload length is 4096" \ |
| 3226 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3227 | -c "client hello, adding max_fragment_length extension" \ |
| 3228 | -c "found max_fragment_length extension" |
| 3229 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3230 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3231 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3232 | run_test "Max fragment length: client, message just fits" \ |
| 3233 | "$P_SRV debug_level=3" \ |
| 3234 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3235 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3236 | -c "Maximum incoming record payload length is 2048" \ |
| 3237 | -c "Maximum outgoing record payload length is 2048" \ |
| 3238 | -s "Maximum incoming record payload length is 2048" \ |
| 3239 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3240 | -c "client hello, adding max_fragment_length extension" \ |
| 3241 | -s "found max fragment length extension" \ |
| 3242 | -s "server hello, max_fragment_length extension" \ |
| 3243 | -c "found max_fragment_length extension" \ |
| 3244 | -c "2048 bytes written in 1 fragments" \ |
| 3245 | -s "2048 bytes read" |
| 3246 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3247 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3248 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3249 | run_test "Max fragment length: client, larger message" \ |
| 3250 | "$P_SRV debug_level=3" \ |
| 3251 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3252 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3253 | -c "Maximum incoming record payload length is 2048" \ |
| 3254 | -c "Maximum outgoing record payload length is 2048" \ |
| 3255 | -s "Maximum incoming record payload length is 2048" \ |
| 3256 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3257 | -c "client hello, adding max_fragment_length extension" \ |
| 3258 | -s "found max fragment length extension" \ |
| 3259 | -s "server hello, max_fragment_length extension" \ |
| 3260 | -c "found max_fragment_length extension" \ |
| 3261 | -c "2345 bytes written in 2 fragments" \ |
| 3262 | -s "2048 bytes read" \ |
| 3263 | -s "297 bytes read" |
| 3264 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3265 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3266 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3267 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3268 | "$P_SRV debug_level=3 dtls=1" \ |
| 3269 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3270 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3271 | -c "Maximum incoming record payload length is 2048" \ |
| 3272 | -c "Maximum outgoing record payload length is 2048" \ |
| 3273 | -s "Maximum incoming record payload length is 2048" \ |
| 3274 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3275 | -c "client hello, adding max_fragment_length extension" \ |
| 3276 | -s "found max fragment length extension" \ |
| 3277 | -s "server hello, max_fragment_length extension" \ |
| 3278 | -c "found max_fragment_length extension" \ |
| 3279 | -c "fragment larger than.*maximum" |
| 3280 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3281 | # Tests for renegotiation |
| 3282 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3283 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3284 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3285 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3286 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3287 | 0 \ |
| 3288 | -C "client hello, adding renegotiation extension" \ |
| 3289 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3290 | -S "found renegotiation extension" \ |
| 3291 | -s "server hello, secure renegotiation extension" \ |
| 3292 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3293 | -C "=> renegotiate" \ |
| 3294 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3295 | -S "write hello request" |
| 3296 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3297 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3298 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3299 | "$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] | 3300 | "$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] | 3301 | 0 \ |
| 3302 | -c "client hello, adding renegotiation extension" \ |
| 3303 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3304 | -s "found renegotiation extension" \ |
| 3305 | -s "server hello, secure renegotiation extension" \ |
| 3306 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3307 | -c "=> renegotiate" \ |
| 3308 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3309 | -S "write hello request" |
| 3310 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3311 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3312 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3313 | "$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] | 3314 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3315 | 0 \ |
| 3316 | -c "client hello, adding renegotiation extension" \ |
| 3317 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3318 | -s "found renegotiation extension" \ |
| 3319 | -s "server hello, secure renegotiation extension" \ |
| 3320 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3321 | -c "=> renegotiate" \ |
| 3322 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3323 | -s "write hello request" |
| 3324 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3325 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3326 | # 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] | 3327 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3328 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3329 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3330 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3331 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3332 | 0 \ |
| 3333 | -c "client hello, adding renegotiation extension" \ |
| 3334 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3335 | -s "found renegotiation extension" \ |
| 3336 | -s "server hello, secure renegotiation extension" \ |
| 3337 | -c "found renegotiation extension" \ |
| 3338 | -c "=> renegotiate" \ |
| 3339 | -s "=> renegotiate" \ |
| 3340 | -S "write hello request" \ |
| 3341 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3342 | |
| 3343 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3344 | # 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] | 3345 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3346 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3347 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3348 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3349 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3350 | 0 \ |
| 3351 | -c "client hello, adding renegotiation extension" \ |
| 3352 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3353 | -s "found renegotiation extension" \ |
| 3354 | -s "server hello, secure renegotiation extension" \ |
| 3355 | -c "found renegotiation extension" \ |
| 3356 | -c "=> renegotiate" \ |
| 3357 | -s "=> renegotiate" \ |
| 3358 | -s "write hello request" \ |
| 3359 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3360 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3361 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3362 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3363 | "$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] | 3364 | "$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] | 3365 | 0 \ |
| 3366 | -c "client hello, adding renegotiation extension" \ |
| 3367 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3368 | -s "found renegotiation extension" \ |
| 3369 | -s "server hello, secure renegotiation extension" \ |
| 3370 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3371 | -c "=> renegotiate" \ |
| 3372 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3373 | -s "write hello request" |
| 3374 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3375 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3376 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3377 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3378 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3379 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3380 | "$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" \ |
| 3381 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3382 | -c "Maximum incoming record payload length is 2048" \ |
| 3383 | -c "Maximum outgoing record payload length is 2048" \ |
| 3384 | -s "Maximum incoming record payload length is 2048" \ |
| 3385 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3386 | -c "client hello, adding max_fragment_length extension" \ |
| 3387 | -s "found max fragment length extension" \ |
| 3388 | -s "server hello, max_fragment_length extension" \ |
| 3389 | -c "found max_fragment_length extension" \ |
| 3390 | -c "client hello, adding renegotiation extension" \ |
| 3391 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3392 | -s "found renegotiation extension" \ |
| 3393 | -s "server hello, secure renegotiation extension" \ |
| 3394 | -c "found renegotiation extension" \ |
| 3395 | -c "=> renegotiate" \ |
| 3396 | -s "=> renegotiate" \ |
| 3397 | -s "write hello request" |
| 3398 | |
| 3399 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3400 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3401 | "$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] | 3402 | "$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] | 3403 | 1 \ |
| 3404 | -c "client hello, adding renegotiation extension" \ |
| 3405 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3406 | -S "found renegotiation extension" \ |
| 3407 | -s "server hello, secure renegotiation extension" \ |
| 3408 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3409 | -c "=> renegotiate" \ |
| 3410 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3411 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3412 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3413 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3414 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3415 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3416 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3417 | "$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] | 3418 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3419 | 0 \ |
| 3420 | -C "client hello, adding renegotiation extension" \ |
| 3421 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3422 | -S "found renegotiation extension" \ |
| 3423 | -s "server hello, secure renegotiation extension" \ |
| 3424 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3425 | -C "=> renegotiate" \ |
| 3426 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3427 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3428 | -S "SSL - An unexpected message was received from our peer" \ |
| 3429 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3430 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3431 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3432 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3433 | "$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] | 3434 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3435 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3436 | 0 \ |
| 3437 | -C "client hello, adding renegotiation extension" \ |
| 3438 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3439 | -S "found renegotiation extension" \ |
| 3440 | -s "server hello, secure renegotiation extension" \ |
| 3441 | -c "found renegotiation extension" \ |
| 3442 | -C "=> renegotiate" \ |
| 3443 | -S "=> renegotiate" \ |
| 3444 | -s "write hello request" \ |
| 3445 | -S "SSL - An unexpected message was received from our peer" \ |
| 3446 | -S "failed" |
| 3447 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3448 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3449 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3450 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3451 | "$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] | 3452 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3453 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3454 | 0 \ |
| 3455 | -C "client hello, adding renegotiation extension" \ |
| 3456 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3457 | -S "found renegotiation extension" \ |
| 3458 | -s "server hello, secure renegotiation extension" \ |
| 3459 | -c "found renegotiation extension" \ |
| 3460 | -C "=> renegotiate" \ |
| 3461 | -S "=> renegotiate" \ |
| 3462 | -s "write hello request" \ |
| 3463 | -S "SSL - An unexpected message was received from our peer" \ |
| 3464 | -S "failed" |
| 3465 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3466 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3467 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3468 | "$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] | 3469 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3470 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3471 | 0 \ |
| 3472 | -C "client hello, adding renegotiation extension" \ |
| 3473 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3474 | -S "found renegotiation extension" \ |
| 3475 | -s "server hello, secure renegotiation extension" \ |
| 3476 | -c "found renegotiation extension" \ |
| 3477 | -C "=> renegotiate" \ |
| 3478 | -S "=> renegotiate" \ |
| 3479 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3480 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3481 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3482 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3483 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3484 | "$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] | 3485 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3486 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3487 | 0 \ |
| 3488 | -c "client hello, adding renegotiation extension" \ |
| 3489 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3490 | -s "found renegotiation extension" \ |
| 3491 | -s "server hello, secure renegotiation extension" \ |
| 3492 | -c "found renegotiation extension" \ |
| 3493 | -c "=> renegotiate" \ |
| 3494 | -s "=> renegotiate" \ |
| 3495 | -s "write hello request" \ |
| 3496 | -S "SSL - An unexpected message was received from our peer" \ |
| 3497 | -S "failed" |
| 3498 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3499 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3500 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3501 | "$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] | 3502 | "$P_CLI debug_level=3 exchanges=2 renegotiation=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 | -S "record counter limit reached: renegotiate" \ |
| 3510 | -C "=> renegotiate" \ |
| 3511 | -S "=> renegotiate" \ |
| 3512 | -S "write hello request" \ |
| 3513 | -S "SSL - An unexpected message was received from our peer" \ |
| 3514 | -S "failed" |
| 3515 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3516 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3517 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3518 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3519 | "$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] | 3520 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3521 | 0 \ |
| 3522 | -c "client hello, adding renegotiation extension" \ |
| 3523 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3524 | -s "found renegotiation extension" \ |
| 3525 | -s "server hello, secure renegotiation extension" \ |
| 3526 | -c "found renegotiation extension" \ |
| 3527 | -s "record counter limit reached: renegotiate" \ |
| 3528 | -c "=> renegotiate" \ |
| 3529 | -s "=> renegotiate" \ |
| 3530 | -s "write hello request" \ |
| 3531 | -S "SSL - An unexpected message was received from our peer" \ |
| 3532 | -S "failed" |
| 3533 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3534 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3535 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3536 | "$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] | 3537 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3538 | 0 \ |
| 3539 | -c "client hello, adding renegotiation extension" \ |
| 3540 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3541 | -s "found renegotiation extension" \ |
| 3542 | -s "server hello, secure renegotiation extension" \ |
| 3543 | -c "found renegotiation extension" \ |
| 3544 | -s "record counter limit reached: renegotiate" \ |
| 3545 | -c "=> renegotiate" \ |
| 3546 | -s "=> renegotiate" \ |
| 3547 | -s "write hello request" \ |
| 3548 | -S "SSL - An unexpected message was received from our peer" \ |
| 3549 | -S "failed" |
| 3550 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3551 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3552 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3553 | "$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] | 3554 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3555 | 0 \ |
| 3556 | -C "client hello, adding renegotiation extension" \ |
| 3557 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3558 | -S "found renegotiation extension" \ |
| 3559 | -s "server hello, secure renegotiation extension" \ |
| 3560 | -c "found renegotiation extension" \ |
| 3561 | -S "record counter limit reached: renegotiate" \ |
| 3562 | -C "=> renegotiate" \ |
| 3563 | -S "=> renegotiate" \ |
| 3564 | -S "write hello request" \ |
| 3565 | -S "SSL - An unexpected message was received from our peer" \ |
| 3566 | -S "failed" |
| 3567 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3568 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3569 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3570 | "$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] | 3571 | "$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] | 3572 | 0 \ |
| 3573 | -c "client hello, adding renegotiation extension" \ |
| 3574 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3575 | -s "found renegotiation extension" \ |
| 3576 | -s "server hello, secure renegotiation extension" \ |
| 3577 | -c "found renegotiation extension" \ |
| 3578 | -c "=> renegotiate" \ |
| 3579 | -s "=> renegotiate" \ |
| 3580 | -S "write hello request" |
| 3581 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3582 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3583 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3584 | "$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] | 3585 | "$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] | 3586 | 0 \ |
| 3587 | -c "client hello, adding renegotiation extension" \ |
| 3588 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3589 | -s "found renegotiation extension" \ |
| 3590 | -s "server hello, secure renegotiation extension" \ |
| 3591 | -c "found renegotiation extension" \ |
| 3592 | -c "=> renegotiate" \ |
| 3593 | -s "=> renegotiate" \ |
| 3594 | -s "write hello request" |
| 3595 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3596 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3597 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3598 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3599 | "$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] | 3600 | 0 \ |
| 3601 | -c "client hello, adding renegotiation extension" \ |
| 3602 | -c "found renegotiation extension" \ |
| 3603 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3604 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3605 | -C "error" \ |
| 3606 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3607 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3608 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3609 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3610 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3611 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3612 | "$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] | 3613 | 0 \ |
| 3614 | -c "client hello, adding renegotiation extension" \ |
| 3615 | -c "found renegotiation extension" \ |
| 3616 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3617 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3618 | -C "error" \ |
| 3619 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3620 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3621 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3622 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3623 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3624 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3625 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3626 | 1 \ |
| 3627 | -c "client hello, adding renegotiation extension" \ |
| 3628 | -C "found renegotiation extension" \ |
| 3629 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3630 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3631 | -c "error" \ |
| 3632 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3633 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3634 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3635 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3636 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3637 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3638 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3639 | allow_legacy=0" \ |
| 3640 | 1 \ |
| 3641 | -c "client hello, adding renegotiation extension" \ |
| 3642 | -C "found renegotiation extension" \ |
| 3643 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3644 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3645 | -c "error" \ |
| 3646 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3647 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3648 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3649 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3650 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3651 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3652 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3653 | allow_legacy=1" \ |
| 3654 | 0 \ |
| 3655 | -c "client hello, adding renegotiation extension" \ |
| 3656 | -C "found renegotiation extension" \ |
| 3657 | -c "=> renegotiate" \ |
| 3658 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3659 | -C "error" \ |
| 3660 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3661 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3662 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3663 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3664 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3665 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3666 | 0 \ |
| 3667 | -c "client hello, adding renegotiation extension" \ |
| 3668 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3669 | -s "found renegotiation extension" \ |
| 3670 | -s "server hello, secure renegotiation extension" \ |
| 3671 | -c "found renegotiation extension" \ |
| 3672 | -c "=> renegotiate" \ |
| 3673 | -s "=> renegotiate" \ |
| 3674 | -S "write hello request" |
| 3675 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3676 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3677 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3678 | "$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] | 3679 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3680 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3681 | 0 \ |
| 3682 | -c "client hello, adding renegotiation extension" \ |
| 3683 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3684 | -s "found renegotiation extension" \ |
| 3685 | -s "server hello, secure renegotiation extension" \ |
| 3686 | -c "found renegotiation extension" \ |
| 3687 | -c "=> renegotiate" \ |
| 3688 | -s "=> renegotiate" \ |
| 3689 | -s "write hello request" |
| 3690 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3691 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3692 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3693 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3694 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3695 | 0 \ |
| 3696 | -c "client hello, adding renegotiation extension" \ |
| 3697 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3698 | -s "found renegotiation extension" \ |
| 3699 | -s "server hello, secure renegotiation extension" \ |
| 3700 | -s "record counter limit reached: renegotiate" \ |
| 3701 | -c "=> renegotiate" \ |
| 3702 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3703 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3704 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3705 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3706 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3707 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3708 | "$G_SRV -u --mtu 4096" \ |
| 3709 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3710 | 0 \ |
| 3711 | -c "client hello, adding renegotiation extension" \ |
| 3712 | -c "found renegotiation extension" \ |
| 3713 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3714 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3715 | -C "error" \ |
| 3716 | -s "Extra-header:" |
| 3717 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3718 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3719 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3720 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3721 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3722 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3723 | "$P_CLI debug_level=3" \ |
| 3724 | 0 \ |
| 3725 | -c "found renegotiation extension" \ |
| 3726 | -C "error" \ |
| 3727 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3728 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3729 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3730 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3731 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3732 | "$P_CLI debug_level=3" \ |
| 3733 | 0 \ |
| 3734 | -C "found renegotiation extension" \ |
| 3735 | -C "error" \ |
| 3736 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3737 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3738 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3739 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3740 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3741 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3742 | 1 \ |
| 3743 | -C "found renegotiation extension" \ |
| 3744 | -c "error" \ |
| 3745 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3746 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3747 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3748 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3749 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3750 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3751 | 0 \ |
| 3752 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3753 | -s "server hello, secure renegotiation extension" |
| 3754 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3755 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3756 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3757 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3758 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3759 | 0 \ |
| 3760 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3761 | -S "server hello, secure renegotiation extension" |
| 3762 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3763 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3764 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3765 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3766 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3767 | 1 \ |
| 3768 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3769 | -S "server hello, secure renegotiation extension" |
| 3770 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3771 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3772 | |
| 3773 | requires_gnutls |
| 3774 | run_test "DER format: no trailing bytes" \ |
| 3775 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3776 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3777 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3778 | 0 \ |
| 3779 | -c "Handshake was completed" \ |
| 3780 | |
| 3781 | requires_gnutls |
| 3782 | run_test "DER format: with a trailing zero byte" \ |
| 3783 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3784 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3785 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3786 | 0 \ |
| 3787 | -c "Handshake was completed" \ |
| 3788 | |
| 3789 | requires_gnutls |
| 3790 | run_test "DER format: with a trailing random byte" \ |
| 3791 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3792 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3793 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3794 | 0 \ |
| 3795 | -c "Handshake was completed" \ |
| 3796 | |
| 3797 | requires_gnutls |
| 3798 | run_test "DER format: with 2 trailing random bytes" \ |
| 3799 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3800 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3801 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3802 | 0 \ |
| 3803 | -c "Handshake was completed" \ |
| 3804 | |
| 3805 | requires_gnutls |
| 3806 | run_test "DER format: with 4 trailing random bytes" \ |
| 3807 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3808 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3809 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3810 | 0 \ |
| 3811 | -c "Handshake was completed" \ |
| 3812 | |
| 3813 | requires_gnutls |
| 3814 | run_test "DER format: with 8 trailing random bytes" \ |
| 3815 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3816 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3817 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3818 | 0 \ |
| 3819 | -c "Handshake was completed" \ |
| 3820 | |
| 3821 | requires_gnutls |
| 3822 | run_test "DER format: with 9 trailing random bytes" \ |
| 3823 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3824 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3825 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3826 | 0 \ |
| 3827 | -c "Handshake was completed" \ |
| 3828 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3829 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3830 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3831 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3832 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3833 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3834 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3835 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3836 | 1 \ |
| 3837 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3838 | -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] | 3839 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3840 | -c "X509 - Certificate verification failed" |
| 3841 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3842 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3843 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3844 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3845 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3846 | 0 \ |
| 3847 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3848 | -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] | 3849 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3850 | -C "X509 - Certificate verification failed" |
| 3851 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3852 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3853 | "$P_SRV" \ |
| 3854 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3855 | 0 \ |
| 3856 | -c "x509_verify_cert() returned" \ |
| 3857 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3858 | -c "! Certificate verification flags"\ |
| 3859 | -C "! mbedtls_ssl_handshake returned" \ |
| 3860 | -C "X509 - Certificate verification failed" \ |
| 3861 | -C "SSL - No CA Chain is set, but required to operate" |
| 3862 | |
| 3863 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3864 | "$P_SRV" \ |
| 3865 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3866 | 1 \ |
| 3867 | -c "x509_verify_cert() returned" \ |
| 3868 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3869 | -c "! Certificate verification flags"\ |
| 3870 | -c "! mbedtls_ssl_handshake returned" \ |
| 3871 | -c "SSL - No CA Chain is set, but required to operate" |
| 3872 | |
| 3873 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3874 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3875 | # the client informs the server about the supported curves - it does, though, in the |
| 3876 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3877 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3878 | # different means to have the server ignoring the client's supported curve list. |
| 3879 | |
| 3880 | requires_config_enabled MBEDTLS_ECP_C |
| 3881 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3882 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3883 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3884 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3885 | 1 \ |
| 3886 | -c "bad certificate (EC key curve)"\ |
| 3887 | -c "! Certificate verification flags"\ |
| 3888 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3889 | |
| 3890 | requires_config_enabled MBEDTLS_ECP_C |
| 3891 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3892 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3893 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3894 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3895 | 1 \ |
| 3896 | -c "bad certificate (EC key curve)"\ |
| 3897 | -c "! Certificate verification flags"\ |
| 3898 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3899 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3900 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3901 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3902 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3903 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3904 | 0 \ |
| 3905 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3906 | -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] | 3907 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3908 | -C "X509 - Certificate verification failed" |
| 3909 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3910 | run_test "Authentication: client SHA256, server required" \ |
| 3911 | "$P_SRV auth_mode=required" \ |
| 3912 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3913 | key_file=data_files/server6.key \ |
| 3914 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3915 | 0 \ |
| 3916 | -c "Supported Signature Algorithm found: 4," \ |
| 3917 | -c "Supported Signature Algorithm found: 5," |
| 3918 | |
| 3919 | run_test "Authentication: client SHA384, server required" \ |
| 3920 | "$P_SRV auth_mode=required" \ |
| 3921 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3922 | key_file=data_files/server6.key \ |
| 3923 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3924 | 0 \ |
| 3925 | -c "Supported Signature Algorithm found: 4," \ |
| 3926 | -c "Supported Signature Algorithm found: 5," |
| 3927 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3928 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3929 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3930 | "$P_CLI debug_level=3 crt_file=none \ |
| 3931 | key_file=data_files/server5.key" \ |
| 3932 | 1 \ |
| 3933 | -S "skip write certificate request" \ |
| 3934 | -C "skip parse certificate request" \ |
| 3935 | -c "got a certificate request" \ |
| 3936 | -c "= write certificate$" \ |
| 3937 | -C "skip write certificate$" \ |
| 3938 | -S "x509_verify_cert() returned" \ |
| 3939 | -s "client has no certificate" \ |
| 3940 | -s "! mbedtls_ssl_handshake returned" \ |
| 3941 | -c "! mbedtls_ssl_handshake returned" \ |
| 3942 | -s "No client certification received from the client, but required by the authentication mode" |
| 3943 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3944 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3945 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3946 | "$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] | 3947 | key_file=data_files/server5.key" \ |
| 3948 | 1 \ |
| 3949 | -S "skip write certificate request" \ |
| 3950 | -C "skip parse certificate request" \ |
| 3951 | -c "got a certificate request" \ |
| 3952 | -C "skip write certificate" \ |
| 3953 | -C "skip write certificate verify" \ |
| 3954 | -S "skip parse certificate verify" \ |
| 3955 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3956 | -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] | 3957 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3958 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3959 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3960 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3961 | # We don't check that the client receives the alert because it might |
| 3962 | # detect that its write end of the connection is closed and abort |
| 3963 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3964 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3965 | run_test "Authentication: client cert not trusted, server required" \ |
| 3966 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3967 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3968 | key_file=data_files/server5.key" \ |
| 3969 | 1 \ |
| 3970 | -S "skip write certificate request" \ |
| 3971 | -C "skip parse certificate request" \ |
| 3972 | -c "got a certificate request" \ |
| 3973 | -C "skip write certificate" \ |
| 3974 | -C "skip write certificate verify" \ |
| 3975 | -S "skip parse certificate verify" \ |
| 3976 | -s "x509_verify_cert() returned" \ |
| 3977 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3978 | -s "! mbedtls_ssl_handshake returned" \ |
| 3979 | -c "! mbedtls_ssl_handshake returned" \ |
| 3980 | -s "X509 - Certificate verification failed" |
| 3981 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3982 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3983 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3984 | "$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] | 3985 | key_file=data_files/server5.key" \ |
| 3986 | 0 \ |
| 3987 | -S "skip write certificate request" \ |
| 3988 | -C "skip parse certificate request" \ |
| 3989 | -c "got a certificate request" \ |
| 3990 | -C "skip write certificate" \ |
| 3991 | -C "skip write certificate verify" \ |
| 3992 | -S "skip parse certificate verify" \ |
| 3993 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3994 | -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] | 3995 | -S "! mbedtls_ssl_handshake returned" \ |
| 3996 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3997 | -S "X509 - Certificate verification failed" |
| 3998 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3999 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4000 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4001 | "$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] | 4002 | key_file=data_files/server5.key" \ |
| 4003 | 0 \ |
| 4004 | -s "skip write certificate request" \ |
| 4005 | -C "skip parse certificate request" \ |
| 4006 | -c "got no certificate request" \ |
| 4007 | -c "skip write certificate" \ |
| 4008 | -c "skip write certificate verify" \ |
| 4009 | -s "skip parse certificate verify" \ |
| 4010 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4011 | -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] | 4012 | -S "! mbedtls_ssl_handshake returned" \ |
| 4013 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4014 | -S "X509 - Certificate verification failed" |
| 4015 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4016 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4017 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4018 | "$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] | 4019 | 0 \ |
| 4020 | -S "skip write certificate request" \ |
| 4021 | -C "skip parse certificate request" \ |
| 4022 | -c "got a certificate request" \ |
| 4023 | -C "skip write certificate$" \ |
| 4024 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4025 | -c "skip write certificate verify" \ |
| 4026 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4027 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4028 | -S "! mbedtls_ssl_handshake returned" \ |
| 4029 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4030 | -S "X509 - Certificate verification failed" |
| 4031 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4032 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4033 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4034 | "$O_CLI" \ |
| 4035 | 0 \ |
| 4036 | -S "skip write certificate request" \ |
| 4037 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4038 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4039 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4040 | -S "X509 - Certificate verification failed" |
| 4041 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4042 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4043 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4044 | "$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] | 4045 | 0 \ |
| 4046 | -C "skip parse certificate request" \ |
| 4047 | -c "got a certificate request" \ |
| 4048 | -C "skip write certificate$" \ |
| 4049 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4050 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4051 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4052 | run_test "Authentication: client no cert, openssl server required" \ |
| 4053 | "$O_SRV -Verify 10" \ |
| 4054 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4055 | 1 \ |
| 4056 | -C "skip parse certificate request" \ |
| 4057 | -c "got a certificate request" \ |
| 4058 | -C "skip write certificate$" \ |
| 4059 | -c "skip write certificate verify" \ |
| 4060 | -c "! mbedtls_ssl_handshake returned" |
| 4061 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4062 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4063 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4064 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4065 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4066 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4067 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4068 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4069 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4070 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4071 | # 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] | 4072 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4073 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4074 | run_test "Authentication: server max_int chain, client default" \ |
| 4075 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4076 | key_file=data_files/dir-maxpath/09.key" \ |
| 4077 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4078 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4079 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4080 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4081 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4082 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4083 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4084 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4085 | key_file=data_files/dir-maxpath/10.key" \ |
| 4086 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4087 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4088 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4089 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4090 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4091 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4092 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4093 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4094 | key_file=data_files/dir-maxpath/10.key" \ |
| 4095 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4096 | auth_mode=optional" \ |
| 4097 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4098 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4099 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4100 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4101 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4102 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4103 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4104 | key_file=data_files/dir-maxpath/10.key" \ |
| 4105 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4106 | auth_mode=none" \ |
| 4107 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4108 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4109 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4110 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4111 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4112 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4113 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4114 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4115 | key_file=data_files/dir-maxpath/10.key" \ |
| 4116 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4117 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4118 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4119 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4120 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4121 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4122 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4123 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4124 | key_file=data_files/dir-maxpath/10.key" \ |
| 4125 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4126 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4127 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4128 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4129 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4130 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4131 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4132 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4133 | key_file=data_files/dir-maxpath/10.key" \ |
| 4134 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4135 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4136 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4137 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4138 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4139 | run_test "Authentication: client max_int chain, server required" \ |
| 4140 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4141 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4142 | key_file=data_files/dir-maxpath/09.key" \ |
| 4143 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4144 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4145 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4146 | # Tests for CA list in CertificateRequest messages |
| 4147 | |
| 4148 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4149 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4150 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4151 | key_file=data_files/server6.key" \ |
| 4152 | 0 \ |
| 4153 | -s "requested DN" |
| 4154 | |
| 4155 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4156 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4157 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4158 | key_file=data_files/server6.key" \ |
| 4159 | 0 \ |
| 4160 | -S "requested DN" |
| 4161 | |
| 4162 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4163 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4164 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4165 | key_file=data_files/server5.key" \ |
| 4166 | 1 \ |
| 4167 | -S "requested DN" \ |
| 4168 | -s "x509_verify_cert() returned" \ |
| 4169 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4170 | -s "! mbedtls_ssl_handshake returned" \ |
| 4171 | -c "! mbedtls_ssl_handshake returned" \ |
| 4172 | -s "X509 - Certificate verification failed" |
| 4173 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4174 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4175 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4176 | |
| 4177 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4178 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4179 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4180 | key_file=data_files/server5.key" \ |
| 4181 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 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_verify_cert() returned" \ |
| 4185 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4186 | -c "! mbedtls_ssl_handshake returned" \ |
| 4187 | -c "X509 - Certificate verification failed" |
| 4188 | |
| 4189 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4190 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4191 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4192 | key_file=data_files/server5.key" \ |
| 4193 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4194 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4195 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4196 | -c "x509_verify_cert() returned" \ |
| 4197 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4198 | -C "! mbedtls_ssl_handshake returned" \ |
| 4199 | -C "X509 - Certificate verification failed" |
| 4200 | |
| 4201 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4202 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4203 | # the client informs the server about the supported curves - it does, though, in the |
| 4204 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4205 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4206 | # different means to have the server ignoring the client's supported curve list. |
| 4207 | |
| 4208 | requires_config_enabled MBEDTLS_ECP_C |
| 4209 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4210 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4211 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4212 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4213 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4214 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4215 | -c "use CA callback for X.509 CRT verification" \ |
| 4216 | -c "bad certificate (EC key curve)" \ |
| 4217 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4218 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4219 | |
| 4220 | requires_config_enabled MBEDTLS_ECP_C |
| 4221 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4222 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4223 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4224 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4225 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4226 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4227 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4228 | -c "bad certificate (EC key curve)"\ |
| 4229 | -c "! Certificate verification flags"\ |
| 4230 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4231 | |
| 4232 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4233 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4234 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4235 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4236 | key_file=data_files/server6.key \ |
| 4237 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4238 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4239 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4240 | -c "Supported Signature Algorithm found: 4," \ |
| 4241 | -c "Supported Signature Algorithm found: 5," |
| 4242 | |
| 4243 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4244 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4245 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4246 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4247 | key_file=data_files/server6.key \ |
| 4248 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4249 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4250 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4251 | -c "Supported Signature Algorithm found: 4," \ |
| 4252 | -c "Supported Signature Algorithm found: 5," |
| 4253 | |
| 4254 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4255 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4256 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4257 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4258 | key_file=data_files/server5.key" \ |
| 4259 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4260 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4261 | -S "skip write certificate request" \ |
| 4262 | -C "skip parse certificate request" \ |
| 4263 | -c "got a certificate request" \ |
| 4264 | -C "skip write certificate" \ |
| 4265 | -C "skip write certificate verify" \ |
| 4266 | -S "skip parse certificate verify" \ |
| 4267 | -s "x509_verify_cert() returned" \ |
| 4268 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4269 | -s "! mbedtls_ssl_handshake returned" \ |
| 4270 | -s "send alert level=2 message=48" \ |
| 4271 | -c "! mbedtls_ssl_handshake returned" \ |
| 4272 | -s "X509 - Certificate verification failed" |
| 4273 | # We don't check that the client receives the alert because it might |
| 4274 | # detect that its write end of the connection is closed and abort |
| 4275 | # before reading the alert message. |
| 4276 | |
| 4277 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4278 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4279 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4280 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4281 | key_file=data_files/server5.key" \ |
| 4282 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4283 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4284 | -S "skip write certificate request" \ |
| 4285 | -C "skip parse certificate request" \ |
| 4286 | -c "got a certificate request" \ |
| 4287 | -C "skip write certificate" \ |
| 4288 | -C "skip write certificate verify" \ |
| 4289 | -S "skip parse certificate verify" \ |
| 4290 | -s "x509_verify_cert() returned" \ |
| 4291 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4292 | -s "! mbedtls_ssl_handshake returned" \ |
| 4293 | -c "! mbedtls_ssl_handshake returned" \ |
| 4294 | -s "X509 - Certificate verification failed" |
| 4295 | |
| 4296 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4297 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4298 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4299 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4300 | key_file=data_files/server5.key" \ |
| 4301 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4302 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4303 | -S "skip write certificate request" \ |
| 4304 | -C "skip parse certificate request" \ |
| 4305 | -c "got a certificate request" \ |
| 4306 | -C "skip write certificate" \ |
| 4307 | -C "skip write certificate verify" \ |
| 4308 | -S "skip parse certificate verify" \ |
| 4309 | -s "x509_verify_cert() returned" \ |
| 4310 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4311 | -S "! mbedtls_ssl_handshake returned" \ |
| 4312 | -C "! mbedtls_ssl_handshake returned" \ |
| 4313 | -S "X509 - Certificate verification failed" |
| 4314 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4315 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4316 | requires_full_size_output_buffer |
| 4317 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4318 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4319 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4320 | key_file=data_files/dir-maxpath/09.key" \ |
| 4321 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4322 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4323 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4324 | -C "X509 - A fatal error occurred" |
| 4325 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4326 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4327 | requires_full_size_output_buffer |
| 4328 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4329 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4330 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4331 | key_file=data_files/dir-maxpath/10.key" \ |
| 4332 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4333 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4334 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4335 | -c "X509 - A fatal error occurred" |
| 4336 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4337 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4338 | requires_full_size_output_buffer |
| 4339 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4340 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4341 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4342 | key_file=data_files/dir-maxpath/10.key" \ |
| 4343 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4344 | debug_level=3 auth_mode=optional" \ |
| 4345 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4346 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4347 | -c "X509 - A fatal error occurred" |
| 4348 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4349 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4350 | requires_full_size_output_buffer |
| 4351 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4352 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4353 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4354 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4355 | key_file=data_files/dir-maxpath/10.key" \ |
| 4356 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4357 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4358 | -s "X509 - A fatal error occurred" |
| 4359 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4360 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4361 | requires_full_size_output_buffer |
| 4362 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4363 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4364 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4365 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4366 | key_file=data_files/dir-maxpath/10.key" \ |
| 4367 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4368 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4369 | -s "X509 - A fatal error occurred" |
| 4370 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4371 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4372 | requires_full_size_output_buffer |
| 4373 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4374 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4375 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4376 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4377 | key_file=data_files/dir-maxpath/09.key" \ |
| 4378 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4379 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4380 | -S "X509 - A fatal error occurred" |
| 4381 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4382 | # Tests for certificate selection based on SHA verson |
| 4383 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4384 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4385 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4386 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4387 | key_file=data_files/server5.key \ |
| 4388 | crt_file2=data_files/server5-sha1.crt \ |
| 4389 | key_file2=data_files/server5.key" \ |
| 4390 | "$P_CLI force_version=tls1_2" \ |
| 4391 | 0 \ |
| 4392 | -c "signed using.*ECDSA with SHA256" \ |
| 4393 | -C "signed using.*ECDSA with SHA1" |
| 4394 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4395 | # tests for SNI |
| 4396 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4397 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4398 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4399 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4400 | 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] | 4401 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4402 | 0 \ |
| 4403 | -S "parse ServerName extension" \ |
| 4404 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4405 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4406 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4407 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4408 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4409 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4410 | 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] | 4411 | 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] | 4412 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4413 | 0 \ |
| 4414 | -s "parse ServerName extension" \ |
| 4415 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4416 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4417 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4418 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4419 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4420 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4421 | 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] | 4422 | 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] | 4423 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4424 | 0 \ |
| 4425 | -s "parse ServerName extension" \ |
| 4426 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4427 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4428 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4429 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4430 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4431 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4432 | 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] | 4433 | 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] | 4434 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4435 | 1 \ |
| 4436 | -s "parse ServerName extension" \ |
| 4437 | -s "ssl_sni_wrapper() returned" \ |
| 4438 | -s "mbedtls_ssl_handshake returned" \ |
| 4439 | -c "mbedtls_ssl_handshake returned" \ |
| 4440 | -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] | 4441 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4442 | run_test "SNI: client auth no override: optional" \ |
| 4443 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4444 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4445 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4446 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4447 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4448 | -S "skip write certificate request" \ |
| 4449 | -C "skip parse certificate request" \ |
| 4450 | -c "got a certificate request" \ |
| 4451 | -C "skip write certificate" \ |
| 4452 | -C "skip write certificate verify" \ |
| 4453 | -S "skip parse certificate verify" |
| 4454 | |
| 4455 | run_test "SNI: client auth override: none -> optional" \ |
| 4456 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4457 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4458 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4459 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4460 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4461 | -S "skip write certificate request" \ |
| 4462 | -C "skip parse certificate request" \ |
| 4463 | -c "got a certificate request" \ |
| 4464 | -C "skip write certificate" \ |
| 4465 | -C "skip write certificate verify" \ |
| 4466 | -S "skip parse certificate verify" |
| 4467 | |
| 4468 | run_test "SNI: client auth override: optional -> none" \ |
| 4469 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4470 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4471 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4472 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4473 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4474 | -s "skip write certificate request" \ |
| 4475 | -C "skip parse certificate request" \ |
| 4476 | -c "got no certificate request" \ |
| 4477 | -c "skip write certificate" \ |
| 4478 | -c "skip write certificate verify" \ |
| 4479 | -s "skip parse certificate verify" |
| 4480 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4481 | run_test "SNI: CA no override" \ |
| 4482 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4483 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4484 | ca_file=data_files/test-ca.crt \ |
| 4485 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4486 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4487 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4488 | 1 \ |
| 4489 | -S "skip write certificate request" \ |
| 4490 | -C "skip parse certificate request" \ |
| 4491 | -c "got a certificate request" \ |
| 4492 | -C "skip write certificate" \ |
| 4493 | -C "skip write certificate verify" \ |
| 4494 | -S "skip parse certificate verify" \ |
| 4495 | -s "x509_verify_cert() returned" \ |
| 4496 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4497 | -S "The certificate has been revoked (is on a CRL)" |
| 4498 | |
| 4499 | run_test "SNI: CA override" \ |
| 4500 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4501 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4502 | ca_file=data_files/test-ca.crt \ |
| 4503 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4504 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4505 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4506 | 0 \ |
| 4507 | -S "skip write certificate request" \ |
| 4508 | -C "skip parse certificate request" \ |
| 4509 | -c "got a certificate request" \ |
| 4510 | -C "skip write certificate" \ |
| 4511 | -C "skip write certificate verify" \ |
| 4512 | -S "skip parse certificate verify" \ |
| 4513 | -S "x509_verify_cert() returned" \ |
| 4514 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4515 | -S "The certificate has been revoked (is on a CRL)" |
| 4516 | |
| 4517 | run_test "SNI: CA override with CRL" \ |
| 4518 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4519 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4520 | ca_file=data_files/test-ca.crt \ |
| 4521 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4522 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4523 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4524 | 1 \ |
| 4525 | -S "skip write certificate request" \ |
| 4526 | -C "skip parse certificate request" \ |
| 4527 | -c "got a certificate request" \ |
| 4528 | -C "skip write certificate" \ |
| 4529 | -C "skip write certificate verify" \ |
| 4530 | -S "skip parse certificate verify" \ |
| 4531 | -s "x509_verify_cert() returned" \ |
| 4532 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4533 | -s "The certificate has been revoked (is on a CRL)" |
| 4534 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4535 | # Tests for SNI and DTLS |
| 4536 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4537 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4538 | run_test "SNI: DTLS, no SNI callback" \ |
| 4539 | "$P_SRV debug_level=3 dtls=1 \ |
| 4540 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4541 | "$P_CLI server_name=localhost dtls=1" \ |
| 4542 | 0 \ |
| 4543 | -S "parse ServerName extension" \ |
| 4544 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4545 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4546 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4547 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4548 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4549 | "$P_SRV debug_level=3 dtls=1 \ |
| 4550 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4551 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4552 | "$P_CLI server_name=localhost dtls=1" \ |
| 4553 | 0 \ |
| 4554 | -s "parse ServerName extension" \ |
| 4555 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4556 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4557 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4558 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4559 | run_test "SNI: DTLS, matching cert 2" \ |
| 4560 | "$P_SRV debug_level=3 dtls=1 \ |
| 4561 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4562 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4563 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4564 | 0 \ |
| 4565 | -s "parse ServerName extension" \ |
| 4566 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4567 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4568 | |
| 4569 | run_test "SNI: DTLS, no matching cert" \ |
| 4570 | "$P_SRV debug_level=3 dtls=1 \ |
| 4571 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4572 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4573 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4574 | 1 \ |
| 4575 | -s "parse ServerName extension" \ |
| 4576 | -s "ssl_sni_wrapper() returned" \ |
| 4577 | -s "mbedtls_ssl_handshake returned" \ |
| 4578 | -c "mbedtls_ssl_handshake returned" \ |
| 4579 | -c "SSL - A fatal alert message was received from our peer" |
| 4580 | |
| 4581 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4582 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4583 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4584 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4585 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4586 | 0 \ |
| 4587 | -S "skip write certificate request" \ |
| 4588 | -C "skip parse certificate request" \ |
| 4589 | -c "got a certificate request" \ |
| 4590 | -C "skip write certificate" \ |
| 4591 | -C "skip write certificate verify" \ |
| 4592 | -S "skip parse certificate verify" |
| 4593 | |
| 4594 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4595 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4596 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4597 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4598 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4599 | 0 \ |
| 4600 | -S "skip write certificate request" \ |
| 4601 | -C "skip parse certificate request" \ |
| 4602 | -c "got a certificate request" \ |
| 4603 | -C "skip write certificate" \ |
| 4604 | -C "skip write certificate verify" \ |
| 4605 | -S "skip parse certificate verify" |
| 4606 | |
| 4607 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4608 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4609 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4610 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4611 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4612 | 0 \ |
| 4613 | -s "skip write certificate request" \ |
| 4614 | -C "skip parse certificate request" \ |
| 4615 | -c "got no certificate request" \ |
| 4616 | -c "skip write certificate" \ |
| 4617 | -c "skip write certificate verify" \ |
| 4618 | -s "skip parse certificate verify" |
| 4619 | |
| 4620 | run_test "SNI: DTLS, CA no override" \ |
| 4621 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4622 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4623 | ca_file=data_files/test-ca.crt \ |
| 4624 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4625 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4626 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4627 | 1 \ |
| 4628 | -S "skip write certificate request" \ |
| 4629 | -C "skip parse certificate request" \ |
| 4630 | -c "got a certificate request" \ |
| 4631 | -C "skip write certificate" \ |
| 4632 | -C "skip write certificate verify" \ |
| 4633 | -S "skip parse certificate verify" \ |
| 4634 | -s "x509_verify_cert() returned" \ |
| 4635 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4636 | -S "The certificate has been revoked (is on a CRL)" |
| 4637 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4638 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4639 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4640 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4641 | ca_file=data_files/test-ca.crt \ |
| 4642 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4643 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4644 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4645 | 0 \ |
| 4646 | -S "skip write certificate request" \ |
| 4647 | -C "skip parse certificate request" \ |
| 4648 | -c "got a certificate request" \ |
| 4649 | -C "skip write certificate" \ |
| 4650 | -C "skip write certificate verify" \ |
| 4651 | -S "skip parse certificate verify" \ |
| 4652 | -S "x509_verify_cert() returned" \ |
| 4653 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4654 | -S "The certificate has been revoked (is on a CRL)" |
| 4655 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4656 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4657 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4658 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4659 | ca_file=data_files/test-ca.crt \ |
| 4660 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4661 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4662 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4663 | 1 \ |
| 4664 | -S "skip write certificate request" \ |
| 4665 | -C "skip parse certificate request" \ |
| 4666 | -c "got a certificate request" \ |
| 4667 | -C "skip write certificate" \ |
| 4668 | -C "skip write certificate verify" \ |
| 4669 | -S "skip parse certificate verify" \ |
| 4670 | -s "x509_verify_cert() returned" \ |
| 4671 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4672 | -s "The certificate has been revoked (is on a CRL)" |
| 4673 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4674 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4675 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4676 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4677 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4678 | "$P_CLI nbio=2 tickets=0" \ |
| 4679 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4680 | -S "mbedtls_ssl_handshake returned" \ |
| 4681 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4682 | -c "Read from server: .* bytes read" |
| 4683 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4684 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4685 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4686 | "$P_CLI nbio=2 tickets=0" \ |
| 4687 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4688 | -S "mbedtls_ssl_handshake returned" \ |
| 4689 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4690 | -c "Read from server: .* bytes read" |
| 4691 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4692 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4693 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4694 | "$P_CLI nbio=2 tickets=1" \ |
| 4695 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4696 | -S "mbedtls_ssl_handshake returned" \ |
| 4697 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4698 | -c "Read from server: .* bytes read" |
| 4699 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4700 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4701 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4702 | "$P_CLI nbio=2 tickets=1" \ |
| 4703 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4704 | -S "mbedtls_ssl_handshake returned" \ |
| 4705 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4706 | -c "Read from server: .* bytes read" |
| 4707 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4708 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4709 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4710 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4711 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4712 | -S "mbedtls_ssl_handshake returned" \ |
| 4713 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4714 | -c "Read from server: .* bytes read" |
| 4715 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4716 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4717 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4718 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4719 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4720 | -S "mbedtls_ssl_handshake returned" \ |
| 4721 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4722 | -c "Read from server: .* bytes read" |
| 4723 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4724 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4725 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4726 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4727 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4728 | -S "mbedtls_ssl_handshake returned" \ |
| 4729 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4730 | -c "Read from server: .* bytes read" |
| 4731 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4732 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4733 | |
| 4734 | run_test "Event-driven I/O: basic handshake" \ |
| 4735 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4736 | "$P_CLI event=1 tickets=0" \ |
| 4737 | 0 \ |
| 4738 | -S "mbedtls_ssl_handshake returned" \ |
| 4739 | -C "mbedtls_ssl_handshake returned" \ |
| 4740 | -c "Read from server: .* bytes read" |
| 4741 | |
| 4742 | run_test "Event-driven I/O: client auth" \ |
| 4743 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4744 | "$P_CLI event=1 tickets=0" \ |
| 4745 | 0 \ |
| 4746 | -S "mbedtls_ssl_handshake returned" \ |
| 4747 | -C "mbedtls_ssl_handshake returned" \ |
| 4748 | -c "Read from server: .* bytes read" |
| 4749 | |
| 4750 | run_test "Event-driven I/O: ticket" \ |
| 4751 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4752 | "$P_CLI event=1 tickets=1" \ |
| 4753 | 0 \ |
| 4754 | -S "mbedtls_ssl_handshake returned" \ |
| 4755 | -C "mbedtls_ssl_handshake returned" \ |
| 4756 | -c "Read from server: .* bytes read" |
| 4757 | |
| 4758 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4759 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4760 | "$P_CLI event=1 tickets=1" \ |
| 4761 | 0 \ |
| 4762 | -S "mbedtls_ssl_handshake returned" \ |
| 4763 | -C "mbedtls_ssl_handshake returned" \ |
| 4764 | -c "Read from server: .* bytes read" |
| 4765 | |
| 4766 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4767 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4768 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4769 | 0 \ |
| 4770 | -S "mbedtls_ssl_handshake returned" \ |
| 4771 | -C "mbedtls_ssl_handshake returned" \ |
| 4772 | -c "Read from server: .* bytes read" |
| 4773 | |
| 4774 | run_test "Event-driven I/O: ticket + resume" \ |
| 4775 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4776 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4777 | 0 \ |
| 4778 | -S "mbedtls_ssl_handshake returned" \ |
| 4779 | -C "mbedtls_ssl_handshake returned" \ |
| 4780 | -c "Read from server: .* bytes read" |
| 4781 | |
| 4782 | run_test "Event-driven I/O: session-id resume" \ |
| 4783 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4784 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4785 | 0 \ |
| 4786 | -S "mbedtls_ssl_handshake returned" \ |
| 4787 | -C "mbedtls_ssl_handshake returned" \ |
| 4788 | -c "Read from server: .* bytes read" |
| 4789 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4790 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4791 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4792 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4793 | 0 \ |
| 4794 | -c "Read from server: .* bytes read" |
| 4795 | |
| 4796 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4797 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4798 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4799 | 0 \ |
| 4800 | -c "Read from server: .* bytes read" |
| 4801 | |
| 4802 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4803 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4804 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4805 | 0 \ |
| 4806 | -c "Read from server: .* bytes read" |
| 4807 | |
| 4808 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4809 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4810 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4811 | 0 \ |
| 4812 | -c "Read from server: .* bytes read" |
| 4813 | |
| 4814 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4815 | "$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] | 4816 | "$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] | 4817 | 0 \ |
| 4818 | -c "Read from server: .* bytes read" |
| 4819 | |
| 4820 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4821 | "$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] | 4822 | "$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] | 4823 | 0 \ |
| 4824 | -c "Read from server: .* bytes read" |
| 4825 | |
| 4826 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4827 | "$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] | 4828 | "$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] | 4829 | 0 \ |
| 4830 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4831 | |
| 4832 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4833 | # During session resumption, the client will send its ApplicationData record |
| 4834 | # within the same datagram as the Finished messages. In this situation, the |
| 4835 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4836 | # because the ApplicationData request has already been queued internally. |
| 4837 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4838 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4839 | "$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] | 4840 | "$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] | 4841 | 0 \ |
| 4842 | -c "Read from server: .* bytes read" |
| 4843 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4844 | # Tests for version negotiation |
| 4845 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4846 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4847 | "$P_SRV" \ |
| 4848 | "$P_CLI" \ |
| 4849 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4850 | -S "mbedtls_ssl_handshake returned" \ |
| 4851 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4852 | -s "Protocol is TLSv1.2" \ |
| 4853 | -c "Protocol is TLSv1.2" |
| 4854 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 4855 | run_test "Not supported version check: cli TLS 1.0" \ |
| 4856 | "$P_SRV" \ |
| 4857 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 4858 | 1 \ |
| 4859 | -s "Handshake protocol not within min/max boundaries" \ |
| 4860 | -c "Error in protocol version" \ |
| 4861 | -S "Protocol is TLSv1.0" \ |
| 4862 | -C "Handshake was completed" |
| 4863 | |
| 4864 | run_test "Not supported version check: cli TLS 1.1" \ |
| 4865 | "$P_SRV" \ |
| 4866 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 4867 | 1 \ |
| 4868 | -s "Handshake protocol not within min/max boundaries" \ |
| 4869 | -c "Error in protocol version" \ |
| 4870 | -S "Protocol is TLSv1.1" \ |
| 4871 | -C "Handshake was completed" |
| 4872 | |
| 4873 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 4874 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 4875 | "$P_CLI" \ |
| 4876 | 1 \ |
| 4877 | -s "Error in protocol version" \ |
| 4878 | -c "Handshake protocol not within min/max boundaries" \ |
| 4879 | -S "Version: TLS1.0" \ |
| 4880 | -C "Protocol is TLSv1.0" |
| 4881 | |
| 4882 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 4883 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 4884 | "$P_CLI" \ |
| 4885 | 1 \ |
| 4886 | -s "Error in protocol version" \ |
| 4887 | -c "Handshake protocol not within min/max boundaries" \ |
| 4888 | -S "Version: TLS1.1" \ |
| 4889 | -C "Protocol is TLSv1.1" |
| 4890 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4891 | # Tests for ALPN extension |
| 4892 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4893 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4894 | "$P_SRV debug_level=3" \ |
| 4895 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4896 | 0 \ |
| 4897 | -C "client hello, adding alpn extension" \ |
| 4898 | -S "found alpn extension" \ |
| 4899 | -C "got an alert message, type: \\[2:120]" \ |
| 4900 | -S "server hello, adding alpn extension" \ |
| 4901 | -C "found alpn extension " \ |
| 4902 | -C "Application Layer Protocol is" \ |
| 4903 | -S "Application Layer Protocol is" |
| 4904 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4905 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4906 | "$P_SRV debug_level=3" \ |
| 4907 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4908 | 0 \ |
| 4909 | -c "client hello, adding alpn extension" \ |
| 4910 | -s "found alpn extension" \ |
| 4911 | -C "got an alert message, type: \\[2:120]" \ |
| 4912 | -S "server hello, adding alpn extension" \ |
| 4913 | -C "found alpn extension " \ |
| 4914 | -c "Application Layer Protocol is (none)" \ |
| 4915 | -S "Application Layer Protocol is" |
| 4916 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4917 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4918 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4919 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4920 | 0 \ |
| 4921 | -C "client hello, adding alpn extension" \ |
| 4922 | -S "found alpn extension" \ |
| 4923 | -C "got an alert message, type: \\[2:120]" \ |
| 4924 | -S "server hello, adding alpn extension" \ |
| 4925 | -C "found alpn extension " \ |
| 4926 | -C "Application Layer Protocol is" \ |
| 4927 | -s "Application Layer Protocol is (none)" |
| 4928 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4929 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4930 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4931 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4932 | 0 \ |
| 4933 | -c "client hello, adding alpn extension" \ |
| 4934 | -s "found alpn extension" \ |
| 4935 | -C "got an alert message, type: \\[2:120]" \ |
| 4936 | -s "server hello, adding alpn extension" \ |
| 4937 | -c "found alpn extension" \ |
| 4938 | -c "Application Layer Protocol is abc" \ |
| 4939 | -s "Application Layer Protocol is abc" |
| 4940 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4941 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4942 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4943 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4944 | 0 \ |
| 4945 | -c "client hello, adding alpn extension" \ |
| 4946 | -s "found alpn extension" \ |
| 4947 | -C "got an alert message, type: \\[2:120]" \ |
| 4948 | -s "server hello, adding alpn extension" \ |
| 4949 | -c "found alpn extension" \ |
| 4950 | -c "Application Layer Protocol is abc" \ |
| 4951 | -s "Application Layer Protocol is abc" |
| 4952 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4953 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4954 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4955 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4956 | 0 \ |
| 4957 | -c "client hello, adding alpn extension" \ |
| 4958 | -s "found alpn extension" \ |
| 4959 | -C "got an alert message, type: \\[2:120]" \ |
| 4960 | -s "server hello, adding alpn extension" \ |
| 4961 | -c "found alpn extension" \ |
| 4962 | -c "Application Layer Protocol is 1234" \ |
| 4963 | -s "Application Layer Protocol is 1234" |
| 4964 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4965 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4966 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4967 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4968 | 1 \ |
| 4969 | -c "client hello, adding alpn extension" \ |
| 4970 | -s "found alpn extension" \ |
| 4971 | -c "got an alert message, type: \\[2:120]" \ |
| 4972 | -S "server hello, adding alpn extension" \ |
| 4973 | -C "found alpn extension" \ |
| 4974 | -C "Application Layer Protocol is 1234" \ |
| 4975 | -S "Application Layer Protocol is 1234" |
| 4976 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4977 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4978 | # Tests for keyUsage in leaf certificates, part 1: |
| 4979 | # server-side certificate/suite selection |
| 4980 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4981 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4982 | "$P_SRV key_file=data_files/server2.key \ |
| 4983 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4984 | "$P_CLI" \ |
| 4985 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4986 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4987 | |
| 4988 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4989 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4990 | "$P_SRV key_file=data_files/server2.key \ |
| 4991 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4992 | "$P_CLI" \ |
| 4993 | 0 \ |
| 4994 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4995 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4996 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4997 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4998 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4999 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5000 | 1 \ |
| 5001 | -C "Ciphersuite is " |
| 5002 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5003 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5004 | "$P_SRV key_file=data_files/server5.key \ |
| 5005 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5006 | "$P_CLI" \ |
| 5007 | 0 \ |
| 5008 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5009 | |
| 5010 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5011 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5012 | "$P_SRV key_file=data_files/server5.key \ |
| 5013 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5014 | "$P_CLI" \ |
| 5015 | 0 \ |
| 5016 | -c "Ciphersuite is TLS-ECDH-" |
| 5017 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5018 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5019 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5020 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5021 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5022 | 1 \ |
| 5023 | -C "Ciphersuite is " |
| 5024 | |
| 5025 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5026 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5028 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5029 | "$O_SRV -key data_files/server2.key \ |
| 5030 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5031 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5032 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5033 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5034 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5035 | -C "Processing of the Certificate handshake message failed" \ |
| 5036 | -c "Ciphersuite is TLS-" |
| 5037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5038 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5039 | "$O_SRV -key data_files/server2.key \ |
| 5040 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5041 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5042 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5043 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5044 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5045 | -C "Processing of the Certificate handshake message failed" \ |
| 5046 | -c "Ciphersuite is TLS-" |
| 5047 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5048 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5049 | "$O_SRV -key data_files/server2.key \ |
| 5050 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5051 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5052 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5053 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5054 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5055 | -C "Processing of the Certificate handshake message failed" \ |
| 5056 | -c "Ciphersuite is TLS-" |
| 5057 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5058 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5059 | "$O_SRV -key data_files/server2.key \ |
| 5060 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5061 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5062 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5063 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5064 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5065 | -c "Processing of the Certificate handshake message failed" \ |
| 5066 | -C "Ciphersuite is TLS-" |
| 5067 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5068 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5069 | "$O_SRV -key data_files/server2.key \ |
| 5070 | -cert data_files/server2.ku-ke.crt" \ |
| 5071 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5072 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5073 | 0 \ |
| 5074 | -c "bad certificate (usage extensions)" \ |
| 5075 | -C "Processing of the Certificate handshake message failed" \ |
| 5076 | -c "Ciphersuite is TLS-" \ |
| 5077 | -c "! Usage does not match the keyUsage extension" |
| 5078 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5079 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5080 | "$O_SRV -key data_files/server2.key \ |
| 5081 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5082 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5083 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5084 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5085 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5086 | -C "Processing of the Certificate handshake message failed" \ |
| 5087 | -c "Ciphersuite is TLS-" |
| 5088 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5089 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5090 | "$O_SRV -key data_files/server2.key \ |
| 5091 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5092 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5093 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5094 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5095 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5096 | -c "Processing of the Certificate handshake message failed" \ |
| 5097 | -C "Ciphersuite is TLS-" |
| 5098 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5099 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5100 | "$O_SRV -key data_files/server2.key \ |
| 5101 | -cert data_files/server2.ku-ds.crt" \ |
| 5102 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5103 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5104 | 0 \ |
| 5105 | -c "bad certificate (usage extensions)" \ |
| 5106 | -C "Processing of the Certificate handshake message failed" \ |
| 5107 | -c "Ciphersuite is TLS-" \ |
| 5108 | -c "! Usage does not match the keyUsage extension" |
| 5109 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5110 | # Tests for keyUsage in leaf certificates, part 3: |
| 5111 | # server-side checking of client cert |
| 5112 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5113 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5114 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5115 | "$O_CLI -key data_files/server2.key \ |
| 5116 | -cert data_files/server2.ku-ds.crt" \ |
| 5117 | 0 \ |
| 5118 | -S "bad certificate (usage extensions)" \ |
| 5119 | -S "Processing of the Certificate handshake message failed" |
| 5120 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5121 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5122 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5123 | "$O_CLI -key data_files/server2.key \ |
| 5124 | -cert data_files/server2.ku-ke.crt" \ |
| 5125 | 0 \ |
| 5126 | -s "bad certificate (usage extensions)" \ |
| 5127 | -S "Processing of the Certificate handshake message failed" |
| 5128 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5129 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5130 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5131 | "$O_CLI -key data_files/server2.key \ |
| 5132 | -cert data_files/server2.ku-ke.crt" \ |
| 5133 | 1 \ |
| 5134 | -s "bad certificate (usage extensions)" \ |
| 5135 | -s "Processing of the Certificate handshake message failed" |
| 5136 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5137 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5138 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5139 | "$O_CLI -key data_files/server5.key \ |
| 5140 | -cert data_files/server5.ku-ds.crt" \ |
| 5141 | 0 \ |
| 5142 | -S "bad certificate (usage extensions)" \ |
| 5143 | -S "Processing of the Certificate handshake message failed" |
| 5144 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5145 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5146 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5147 | "$O_CLI -key data_files/server5.key \ |
| 5148 | -cert data_files/server5.ku-ka.crt" \ |
| 5149 | 0 \ |
| 5150 | -s "bad certificate (usage extensions)" \ |
| 5151 | -S "Processing of the Certificate handshake message failed" |
| 5152 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5153 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5154 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5155 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5156 | "$P_SRV key_file=data_files/server5.key \ |
| 5157 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5158 | "$P_CLI" \ |
| 5159 | 0 |
| 5160 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5161 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5162 | "$P_SRV key_file=data_files/server5.key \ |
| 5163 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5164 | "$P_CLI" \ |
| 5165 | 0 |
| 5166 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5167 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5168 | "$P_SRV key_file=data_files/server5.key \ |
| 5169 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5170 | "$P_CLI" \ |
| 5171 | 0 |
| 5172 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5173 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5174 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5175 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5176 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5177 | 1 |
| 5178 | |
| 5179 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5180 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5181 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5182 | "$O_SRV -key data_files/server5.key \ |
| 5183 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5184 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5185 | 0 \ |
| 5186 | -C "bad certificate (usage extensions)" \ |
| 5187 | -C "Processing of the Certificate handshake message failed" \ |
| 5188 | -c "Ciphersuite is TLS-" |
| 5189 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5190 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5191 | "$O_SRV -key data_files/server5.key \ |
| 5192 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5193 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5194 | 0 \ |
| 5195 | -C "bad certificate (usage extensions)" \ |
| 5196 | -C "Processing of the Certificate handshake message failed" \ |
| 5197 | -c "Ciphersuite is TLS-" |
| 5198 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5199 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5200 | "$O_SRV -key data_files/server5.key \ |
| 5201 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5202 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5203 | 0 \ |
| 5204 | -C "bad certificate (usage extensions)" \ |
| 5205 | -C "Processing of the Certificate handshake message failed" \ |
| 5206 | -c "Ciphersuite is TLS-" |
| 5207 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5208 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5209 | "$O_SRV -key data_files/server5.key \ |
| 5210 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5211 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5212 | 1 \ |
| 5213 | -c "bad certificate (usage extensions)" \ |
| 5214 | -c "Processing of the Certificate handshake message failed" \ |
| 5215 | -C "Ciphersuite is TLS-" |
| 5216 | |
| 5217 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5218 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5219 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5220 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5221 | "$O_CLI -key data_files/server5.key \ |
| 5222 | -cert data_files/server5.eku-cli.crt" \ |
| 5223 | 0 \ |
| 5224 | -S "bad certificate (usage extensions)" \ |
| 5225 | -S "Processing of the Certificate handshake message failed" |
| 5226 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5227 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5228 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5229 | "$O_CLI -key data_files/server5.key \ |
| 5230 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5231 | 0 \ |
| 5232 | -S "bad certificate (usage extensions)" \ |
| 5233 | -S "Processing of the Certificate handshake message failed" |
| 5234 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5235 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5236 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5237 | "$O_CLI -key data_files/server5.key \ |
| 5238 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5239 | 0 \ |
| 5240 | -S "bad certificate (usage extensions)" \ |
| 5241 | -S "Processing of the Certificate handshake message failed" |
| 5242 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5243 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5244 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5245 | "$O_CLI -key data_files/server5.key \ |
| 5246 | -cert data_files/server5.eku-cs.crt" \ |
| 5247 | 0 \ |
| 5248 | -s "bad certificate (usage extensions)" \ |
| 5249 | -S "Processing of the Certificate handshake message failed" |
| 5250 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5251 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5252 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5253 | "$O_CLI -key data_files/server5.key \ |
| 5254 | -cert data_files/server5.eku-cs.crt" \ |
| 5255 | 1 \ |
| 5256 | -s "bad certificate (usage extensions)" \ |
| 5257 | -s "Processing of the Certificate handshake message failed" |
| 5258 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5259 | # Tests for DHM parameters loading |
| 5260 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5261 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5262 | "$P_SRV" \ |
| 5263 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5264 | debug_level=3" \ |
| 5265 | 0 \ |
| 5266 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5267 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5268 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5269 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5270 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5271 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5272 | debug_level=3" \ |
| 5273 | 0 \ |
| 5274 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5275 | -c "value of 'DHM: G ' (2 bits)" |
| 5276 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5277 | # Tests for DHM client-side size checking |
| 5278 | |
| 5279 | run_test "DHM size: server default, client default, OK" \ |
| 5280 | "$P_SRV" \ |
| 5281 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5282 | debug_level=1" \ |
| 5283 | 0 \ |
| 5284 | -C "DHM prime too short:" |
| 5285 | |
| 5286 | run_test "DHM size: server default, client 2048, OK" \ |
| 5287 | "$P_SRV" \ |
| 5288 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5289 | debug_level=1 dhmlen=2048" \ |
| 5290 | 0 \ |
| 5291 | -C "DHM prime too short:" |
| 5292 | |
| 5293 | run_test "DHM size: server 1024, client default, OK" \ |
| 5294 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5295 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5296 | debug_level=1" \ |
| 5297 | 0 \ |
| 5298 | -C "DHM prime too short:" |
| 5299 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5300 | run_test "DHM size: server 999, client 999, OK" \ |
| 5301 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5302 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5303 | debug_level=1 dhmlen=999" \ |
| 5304 | 0 \ |
| 5305 | -C "DHM prime too short:" |
| 5306 | |
| 5307 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5308 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5309 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5310 | debug_level=1 dhmlen=1000" \ |
| 5311 | 0 \ |
| 5312 | -C "DHM prime too short:" |
| 5313 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5314 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5315 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5316 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5317 | debug_level=1" \ |
| 5318 | 1 \ |
| 5319 | -c "DHM prime too short:" |
| 5320 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5321 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5322 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5323 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5324 | debug_level=1 dhmlen=1001" \ |
| 5325 | 1 \ |
| 5326 | -c "DHM prime too short:" |
| 5327 | |
| 5328 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5329 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5330 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5331 | debug_level=1 dhmlen=1000" \ |
| 5332 | 1 \ |
| 5333 | -c "DHM prime too short:" |
| 5334 | |
| 5335 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5336 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5337 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5338 | debug_level=1 dhmlen=999" \ |
| 5339 | 1 \ |
| 5340 | -c "DHM prime too short:" |
| 5341 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5342 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5343 | "$P_SRV" \ |
| 5344 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5345 | debug_level=1 dhmlen=2049" \ |
| 5346 | 1 \ |
| 5347 | -c "DHM prime too short:" |
| 5348 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5349 | # Tests for PSK callback |
| 5350 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5351 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5352 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5353 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5354 | psk_identity=foo psk=abc123" \ |
| 5355 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5356 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5357 | -S "SSL - Unknown identity received" \ |
| 5358 | -S "SSL - Verification of the message MAC failed" |
| 5359 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5360 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5361 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5362 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5363 | "$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] | 5364 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5365 | 0 \ |
| 5366 | -c "skip PMS generation for opaque PSK"\ |
| 5367 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5368 | -C "session hash for extended master secret"\ |
| 5369 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5370 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +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: opaque psk on client, no callback, SHA-384" \ |
| 5376 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5377 | "$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] | 5378 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5379 | 0 \ |
| 5380 | -c "skip PMS generation for opaque PSK"\ |
| 5381 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5382 | -C "session hash for extended master secret"\ |
| 5383 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5384 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5385 | -S "SSL - Unknown identity received" \ |
| 5386 | -S "SSL - Verification of the message MAC failed" |
| 5387 | |
| 5388 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5389 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5390 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5391 | "$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] | 5392 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5393 | 0 \ |
| 5394 | -c "skip PMS generation for opaque PSK"\ |
| 5395 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5396 | -c "session hash for extended master secret"\ |
| 5397 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5398 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5399 | -S "SSL - Unknown identity received" \ |
| 5400 | -S "SSL - Verification of the message MAC failed" |
| 5401 | |
| 5402 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5403 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5404 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5405 | "$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] | 5406 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5407 | 0 \ |
| 5408 | -c "skip PMS generation for opaque PSK"\ |
| 5409 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5410 | -c "session hash for extended master secret"\ |
| 5411 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5412 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5413 | -S "SSL - Unknown identity received" \ |
| 5414 | -S "SSL - Verification of the message MAC failed" |
| 5415 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5416 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5417 | 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] | 5418 | "$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] | 5419 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5420 | psk_identity=foo psk=abc123" \ |
| 5421 | 0 \ |
| 5422 | -C "skip PMS generation for opaque PSK"\ |
| 5423 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5424 | -C "session hash for extended master secret"\ |
| 5425 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5426 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5427 | -S "SSL - Unknown identity received" \ |
| 5428 | -S "SSL - Verification of the message MAC failed" |
| 5429 | |
| 5430 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5431 | 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] | 5432 | "$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] | 5433 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5434 | psk_identity=foo psk=abc123" \ |
| 5435 | 0 \ |
| 5436 | -C "skip PMS generation for opaque PSK"\ |
| 5437 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5438 | -C "session hash for extended master secret"\ |
| 5439 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5440 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5441 | -S "SSL - Unknown identity received" \ |
| 5442 | -S "SSL - Verification of the message MAC failed" |
| 5443 | |
| 5444 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5445 | 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] | 5446 | "$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] | 5447 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5448 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5449 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5450 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5451 | -c "session hash for extended master secret"\ |
| 5452 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5453 | -C "skip PMS generation for opaque PSK"\ |
| 5454 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5455 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5456 | -S "SSL - Unknown identity received" \ |
| 5457 | -S "SSL - Verification of the message MAC failed" |
| 5458 | |
| 5459 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5460 | 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] | 5461 | "$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] | 5462 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5463 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5464 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5465 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5466 | -c "session hash for extended master secret"\ |
| 5467 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5468 | -C "skip PMS generation for opaque PSK"\ |
| 5469 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5470 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5471 | -S "SSL - Unknown identity received" \ |
| 5472 | -S "SSL - Verification of the message MAC failed" |
| 5473 | |
| 5474 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5475 | 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] | 5476 | "$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] | 5477 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5478 | psk_identity=def psk=beef" \ |
| 5479 | 0 \ |
| 5480 | -C "skip PMS generation for opaque PSK"\ |
| 5481 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5482 | -C "session hash for extended master secret"\ |
| 5483 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5484 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5485 | -S "SSL - Unknown identity received" \ |
| 5486 | -S "SSL - Verification of the message MAC failed" |
| 5487 | |
| 5488 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5489 | 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] | 5490 | "$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] | 5491 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5492 | psk_identity=def psk=beef" \ |
| 5493 | 0 \ |
| 5494 | -C "skip PMS generation for opaque PSK"\ |
| 5495 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5496 | -C "session hash for extended master secret"\ |
| 5497 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5498 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5499 | -S "SSL - Unknown identity received" \ |
| 5500 | -S "SSL - Verification of the message MAC failed" |
| 5501 | |
| 5502 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5503 | 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] | 5504 | "$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] | 5505 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5506 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5507 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5508 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5509 | -c "session hash for extended master secret"\ |
| 5510 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5511 | -C "skip PMS generation for opaque PSK"\ |
| 5512 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5513 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5514 | -S "SSL - Unknown identity received" \ |
| 5515 | -S "SSL - Verification of the message MAC failed" |
| 5516 | |
| 5517 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5518 | 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] | 5519 | "$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] | 5520 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5521 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5522 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5523 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5524 | -c "session hash for extended master secret"\ |
| 5525 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5526 | -C "skip PMS generation for opaque PSK"\ |
| 5527 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5528 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5529 | -S "SSL - Unknown identity received" \ |
| 5530 | -S "SSL - Verification of the message MAC failed" |
| 5531 | |
| 5532 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5533 | 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] | 5534 | "$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] | 5535 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5536 | psk_identity=def psk=beef" \ |
| 5537 | 0 \ |
| 5538 | -C "skip PMS generation for opaque PSK"\ |
| 5539 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5540 | -C "session hash for extended master secret"\ |
| 5541 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5542 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5543 | -S "SSL - Unknown identity received" \ |
| 5544 | -S "SSL - Verification of the message MAC failed" |
| 5545 | |
| 5546 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5547 | 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] | 5548 | "$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] | 5549 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5550 | psk_identity=def psk=beef" \ |
| 5551 | 0 \ |
| 5552 | -C "skip PMS generation for opaque PSK"\ |
| 5553 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5554 | -C "session hash for extended master secret"\ |
| 5555 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5556 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5557 | -S "SSL - Unknown identity received" \ |
| 5558 | -S "SSL - Verification of the message MAC failed" |
| 5559 | |
| 5560 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5561 | 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] | 5562 | "$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] | 5563 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5564 | psk_identity=def psk=beef" \ |
| 5565 | 0 \ |
| 5566 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5567 | -C "session hash for extended master secret"\ |
| 5568 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5569 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5570 | -S "SSL - Unknown identity received" \ |
| 5571 | -S "SSL - Verification of the message MAC failed" |
| 5572 | |
| 5573 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5574 | 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] | 5575 | "$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] | 5576 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5577 | psk_identity=def psk=beef" \ |
| 5578 | 0 \ |
| 5579 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5580 | -C "session hash for extended master secret"\ |
| 5581 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5582 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5583 | -S "SSL - Unknown identity received" \ |
| 5584 | -S "SSL - Verification of the message MAC failed" |
| 5585 | |
| 5586 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5587 | 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] | 5588 | "$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] | 5589 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5590 | psk_identity=def psk=beef" \ |
| 5591 | 1 \ |
| 5592 | -s "SSL - Verification of the message MAC failed" |
| 5593 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5594 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5595 | "$P_SRV" \ |
| 5596 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5597 | psk_identity=foo psk=abc123" \ |
| 5598 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5599 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5600 | -S "SSL - Unknown identity received" \ |
| 5601 | -S "SSL - Verification of the message MAC failed" |
| 5602 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5603 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5604 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5605 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5606 | psk_identity=foo psk=abc123" \ |
| 5607 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5608 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5609 | -s "SSL - Unknown identity received" \ |
| 5610 | -S "SSL - Verification of the message MAC failed" |
| 5611 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5612 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5613 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5614 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5615 | psk_identity=abc psk=dead" \ |
| 5616 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5617 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5618 | -S "SSL - Unknown identity received" \ |
| 5619 | -S "SSL - Verification of the message MAC failed" |
| 5620 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5621 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5622 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5623 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5624 | psk_identity=def psk=beef" \ |
| 5625 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5626 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5627 | -S "SSL - Unknown identity received" \ |
| 5628 | -S "SSL - Verification of the message MAC failed" |
| 5629 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5630 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5631 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5632 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5633 | psk_identity=ghi psk=beef" \ |
| 5634 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5635 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5636 | -s "SSL - Unknown identity received" \ |
| 5637 | -S "SSL - Verification of the message MAC failed" |
| 5638 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5639 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5640 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5641 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5642 | psk_identity=abc psk=beef" \ |
| 5643 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5644 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5645 | -S "SSL - Unknown identity received" \ |
| 5646 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5647 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5648 | # Tests for EC J-PAKE |
| 5649 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5650 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5651 | run_test "ECJPAKE: client not configured" \ |
| 5652 | "$P_SRV debug_level=3" \ |
| 5653 | "$P_CLI debug_level=3" \ |
| 5654 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5655 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5656 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5657 | -S "found ecjpake kkpp extension" \ |
| 5658 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5659 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5660 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5661 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5662 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5663 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5664 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5665 | run_test "ECJPAKE: server not configured" \ |
| 5666 | "$P_SRV debug_level=3" \ |
| 5667 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5668 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5669 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5670 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5671 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5672 | -s "found ecjpake kkpp extension" \ |
| 5673 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5674 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5675 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5676 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5677 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5678 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5679 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5680 | run_test "ECJPAKE: working, TLS" \ |
| 5681 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5682 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5683 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5684 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5685 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5686 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5687 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5688 | -s "found ecjpake kkpp extension" \ |
| 5689 | -S "skip ecjpake kkpp extension" \ |
| 5690 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5691 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5692 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5693 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5694 | -S "SSL - Verification of the message MAC failed" |
| 5695 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5696 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5697 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5698 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5699 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5700 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5701 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5702 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5703 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5704 | -s "SSL - Verification of the message MAC failed" |
| 5705 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5706 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5707 | run_test "ECJPAKE: working, DTLS" \ |
| 5708 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5709 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5710 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5711 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5712 | -c "re-using cached ecjpake parameters" \ |
| 5713 | -S "SSL - Verification of the message MAC failed" |
| 5714 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5715 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5716 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5717 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5718 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5719 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5720 | 0 \ |
| 5721 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5722 | -S "SSL - Verification of the message MAC failed" |
| 5723 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5724 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5725 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5726 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5727 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5728 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5729 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5730 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5731 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5732 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5733 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5734 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5735 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5736 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5737 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5738 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5739 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5740 | 0 |
| 5741 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5742 | # Test for ClientHello without extensions |
| 5743 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5744 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5745 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5746 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5747 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5748 | 0 \ |
| 5749 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5750 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5751 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5752 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5753 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5754 | "$P_SRV" \ |
| 5755 | "$P_CLI request_size=100" \ |
| 5756 | 0 \ |
| 5757 | -s "Read from client: 100 bytes read$" |
| 5758 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5759 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5760 | "$P_SRV" \ |
| 5761 | "$P_CLI request_size=500" \ |
| 5762 | 0 \ |
| 5763 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5764 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5765 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5766 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5767 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5768 | "$P_SRV" \ |
| 5769 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5770 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5771 | 0 \ |
| 5772 | -s "Read from client: 1 bytes read" |
| 5773 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5774 | 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] | 5775 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5776 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5777 | 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] | 5778 | 0 \ |
| 5779 | -s "Read from client: 1 bytes read" |
| 5780 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5781 | 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] | 5782 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5783 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5784 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5785 | 0 \ |
| 5786 | -s "Read from client: 1 bytes read" |
| 5787 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5788 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5789 | "$P_SRV" \ |
| 5790 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5791 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5792 | 0 \ |
| 5793 | -s "Read from client: 1 bytes read" |
| 5794 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5795 | 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] | 5796 | "$P_SRV" \ |
| 5797 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5798 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5799 | 0 \ |
| 5800 | -s "Read from client: 1 bytes read" |
| 5801 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5802 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5803 | |
| 5804 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5805 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5806 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5807 | "$P_CLI dtls=1 request_size=1 \ |
| 5808 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5809 | 0 \ |
| 5810 | -s "Read from client: 1 bytes read" |
| 5811 | |
| 5812 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5813 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5814 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5815 | "$P_CLI dtls=1 request_size=1 \ |
| 5816 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5817 | 0 \ |
| 5818 | -s "Read from client: 1 bytes read" |
| 5819 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5820 | # Tests for small server packets |
| 5821 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5822 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5823 | "$P_SRV response_size=1" \ |
| 5824 | "$P_CLI force_version=tls1_2 \ |
| 5825 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5826 | 0 \ |
| 5827 | -c "Read from server: 1 bytes read" |
| 5828 | |
| 5829 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5830 | "$P_SRV response_size=1" \ |
| 5831 | "$P_CLI force_version=tls1_2 \ |
| 5832 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5833 | 0 \ |
| 5834 | -c "Read from server: 1 bytes read" |
| 5835 | |
| 5836 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5837 | "$P_SRV response_size=1" \ |
| 5838 | "$P_CLI force_version=tls1_2 \ |
| 5839 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5840 | 0 \ |
| 5841 | -c "Read from server: 1 bytes read" |
| 5842 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5843 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5844 | "$P_SRV response_size=1" \ |
| 5845 | "$P_CLI force_version=tls1_2 \ |
| 5846 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5847 | 0 \ |
| 5848 | -c "Read from server: 1 bytes read" |
| 5849 | |
| 5850 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5851 | "$P_SRV response_size=1" \ |
| 5852 | "$P_CLI force_version=tls1_2 \ |
| 5853 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5854 | 0 \ |
| 5855 | -c "Read from server: 1 bytes read" |
| 5856 | |
| 5857 | # Tests for small server packets in DTLS |
| 5858 | |
| 5859 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5860 | run_test "Small server packet DTLS 1.2" \ |
| 5861 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5862 | "$P_CLI dtls=1 \ |
| 5863 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5864 | 0 \ |
| 5865 | -c "Read from server: 1 bytes read" |
| 5866 | |
| 5867 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5868 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5869 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5870 | "$P_CLI dtls=1 \ |
| 5871 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5872 | 0 \ |
| 5873 | -c "Read from server: 1 bytes read" |
| 5874 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5875 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5876 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5877 | # How many fragments do we expect to write $1 bytes? |
| 5878 | fragments_for_write() { |
| 5879 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5880 | } |
| 5881 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5882 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5883 | "$P_SRV" \ |
| 5884 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5885 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5886 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5887 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5888 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5889 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5890 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5891 | "$P_SRV" \ |
| 5892 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5893 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5894 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5895 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5896 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5897 | 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] | 5898 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5899 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5900 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5901 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5902 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5903 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5904 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5905 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5906 | "$P_SRV" \ |
| 5907 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5908 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5909 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5910 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5911 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5912 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5913 | 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] | 5914 | "$P_SRV" \ |
| 5915 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5916 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5917 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5918 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5919 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5920 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 5921 | # 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] | 5922 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5923 | "$P_SRV response_size=16384" \ |
| 5924 | "$P_CLI force_version=tls1_2 \ |
| 5925 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5926 | 0 \ |
| 5927 | -c "Read from server: 16384 bytes read" |
| 5928 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5929 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5930 | "$P_SRV response_size=16384" \ |
| 5931 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5932 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5933 | 0 \ |
| 5934 | -s "16384 bytes written in 1 fragments" \ |
| 5935 | -c "Read from server: 16384 bytes read" |
| 5936 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5937 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5938 | "$P_SRV response_size=16384" \ |
| 5939 | "$P_CLI force_version=tls1_2 \ |
| 5940 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5941 | 0 \ |
| 5942 | -c "Read from server: 16384 bytes read" |
| 5943 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5944 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5945 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5946 | "$P_CLI force_version=tls1_2 \ |
| 5947 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5948 | 0 \ |
| 5949 | -s "16384 bytes written in 1 fragments" \ |
| 5950 | -c "Read from server: 16384 bytes read" |
| 5951 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5952 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5953 | "$P_SRV response_size=16384" \ |
| 5954 | "$P_CLI force_version=tls1_2 \ |
| 5955 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5956 | 0 \ |
| 5957 | -c "Read from server: 16384 bytes read" |
| 5958 | |
| 5959 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5960 | "$P_SRV response_size=16384" \ |
| 5961 | "$P_CLI force_version=tls1_2 \ |
| 5962 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5963 | 0 \ |
| 5964 | -c "Read from server: 16384 bytes read" |
| 5965 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5966 | # Tests for restartable ECC |
| 5967 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5968 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 5969 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5970 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5971 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5972 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5973 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5974 | "$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] | 5975 | 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] | 5976 | debug_level=1" \ |
| 5977 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5978 | -C "x509_verify_cert.*4b00" \ |
| 5979 | -C "mbedtls_pk_verify.*4b00" \ |
| 5980 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5981 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5982 | |
| 5983 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5984 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5985 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5986 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5987 | "$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] | 5988 | 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] | 5989 | debug_level=1 ec_max_ops=0" \ |
| 5990 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5991 | -C "x509_verify_cert.*4b00" \ |
| 5992 | -C "mbedtls_pk_verify.*4b00" \ |
| 5993 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5994 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5995 | |
| 5996 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5997 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5998 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5999 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6000 | "$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] | 6001 | 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] | 6002 | debug_level=1 ec_max_ops=65535" \ |
| 6003 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6004 | -C "x509_verify_cert.*4b00" \ |
| 6005 | -C "mbedtls_pk_verify.*4b00" \ |
| 6006 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6007 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6008 | |
| 6009 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6010 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6011 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6012 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6013 | "$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] | 6014 | 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] | 6015 | debug_level=1 ec_max_ops=1000" \ |
| 6016 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6017 | -c "x509_verify_cert.*4b00" \ |
| 6018 | -c "mbedtls_pk_verify.*4b00" \ |
| 6019 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6020 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6021 | |
| 6022 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6023 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6024 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6025 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6026 | crt_file=data_files/server5-badsign.crt \ |
| 6027 | key_file=data_files/server5.key" \ |
| 6028 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6029 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6030 | debug_level=1 ec_max_ops=1000" \ |
| 6031 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6032 | -c "x509_verify_cert.*4b00" \ |
| 6033 | -C "mbedtls_pk_verify.*4b00" \ |
| 6034 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6035 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6036 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6037 | -c "! mbedtls_ssl_handshake returned" \ |
| 6038 | -c "X509 - Certificate verification failed" |
| 6039 | |
| 6040 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6041 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6042 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6043 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6044 | crt_file=data_files/server5-badsign.crt \ |
| 6045 | key_file=data_files/server5.key" \ |
| 6046 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6047 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6048 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6049 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6050 | -c "x509_verify_cert.*4b00" \ |
| 6051 | -c "mbedtls_pk_verify.*4b00" \ |
| 6052 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6053 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6054 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6055 | -C "! mbedtls_ssl_handshake returned" \ |
| 6056 | -C "X509 - Certificate verification failed" |
| 6057 | |
| 6058 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6059 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6060 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6061 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6062 | crt_file=data_files/server5-badsign.crt \ |
| 6063 | key_file=data_files/server5.key" \ |
| 6064 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6065 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6066 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6067 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6068 | -C "x509_verify_cert.*4b00" \ |
| 6069 | -c "mbedtls_pk_verify.*4b00" \ |
| 6070 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6071 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6072 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6073 | -C "! mbedtls_ssl_handshake returned" \ |
| 6074 | -C "X509 - Certificate verification failed" |
| 6075 | |
| 6076 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6077 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6078 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6079 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6080 | "$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] | 6081 | 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] | 6082 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6083 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6084 | -c "x509_verify_cert.*4b00" \ |
| 6085 | -c "mbedtls_pk_verify.*4b00" \ |
| 6086 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6087 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6088 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6089 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6090 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6091 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6092 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6093 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6094 | debug_level=1 ec_max_ops=1000" \ |
| 6095 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6096 | -c "x509_verify_cert.*4b00" \ |
| 6097 | -c "mbedtls_pk_verify.*4b00" \ |
| 6098 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6099 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6100 | |
| 6101 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6102 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6103 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6104 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6105 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6106 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6107 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6108 | -C "x509_verify_cert.*4b00" \ |
| 6109 | -C "mbedtls_pk_verify.*4b00" \ |
| 6110 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6111 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6112 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6113 | # Tests of asynchronous private key support in SSL |
| 6114 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6115 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6116 | run_test "SSL async private: sign, delay=0" \ |
| 6117 | "$P_SRV \ |
| 6118 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6119 | "$P_CLI" \ |
| 6120 | 0 \ |
| 6121 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6122 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6123 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6124 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6125 | run_test "SSL async private: sign, delay=1" \ |
| 6126 | "$P_SRV \ |
| 6127 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6128 | "$P_CLI" \ |
| 6129 | 0 \ |
| 6130 | -s "Async sign callback: using key slot " \ |
| 6131 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6132 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6133 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6134 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6135 | run_test "SSL async private: sign, delay=2" \ |
| 6136 | "$P_SRV \ |
| 6137 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6138 | "$P_CLI" \ |
| 6139 | 0 \ |
| 6140 | -s "Async sign callback: using key slot " \ |
| 6141 | -U "Async sign callback: using key slot " \ |
| 6142 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6143 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6144 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6145 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6146 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6147 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6148 | run_test "SSL async private: sign, SNI" \ |
| 6149 | "$P_SRV debug_level=3 \ |
| 6150 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6151 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6152 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6153 | "$P_CLI server_name=polarssl.example" \ |
| 6154 | 0 \ |
| 6155 | -s "Async sign callback: using key slot " \ |
| 6156 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6157 | -s "parse ServerName extension" \ |
| 6158 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6159 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6160 | |
| 6161 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6162 | run_test "SSL async private: decrypt, delay=0" \ |
| 6163 | "$P_SRV \ |
| 6164 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6165 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6166 | 0 \ |
| 6167 | -s "Async decrypt callback: using key slot " \ |
| 6168 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6169 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6170 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6171 | run_test "SSL async private: decrypt, delay=1" \ |
| 6172 | "$P_SRV \ |
| 6173 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6174 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6175 | 0 \ |
| 6176 | -s "Async decrypt callback: using key slot " \ |
| 6177 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6178 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6179 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6180 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6181 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6182 | "$P_SRV psk=abc123 \ |
| 6183 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6184 | "$P_CLI psk=abc123 \ |
| 6185 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6186 | 0 \ |
| 6187 | -s "Async decrypt callback: using key slot " \ |
| 6188 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6189 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6190 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6191 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6192 | "$P_SRV psk=abc123 \ |
| 6193 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6194 | "$P_CLI psk=abc123 \ |
| 6195 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6196 | 0 \ |
| 6197 | -s "Async decrypt callback: using key slot " \ |
| 6198 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6199 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6200 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6201 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6202 | run_test "SSL async private: sign callback not present" \ |
| 6203 | "$P_SRV \ |
| 6204 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6205 | "$P_CLI; [ \$? -eq 1 ] && |
| 6206 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6207 | 0 \ |
| 6208 | -S "Async sign callback" \ |
| 6209 | -s "! mbedtls_ssl_handshake returned" \ |
| 6210 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6211 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6212 | -s "Successful connection" |
| 6213 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6214 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6215 | run_test "SSL async private: decrypt callback not present" \ |
| 6216 | "$P_SRV debug_level=1 \ |
| 6217 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6218 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6219 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6220 | 0 \ |
| 6221 | -S "Async decrypt callback" \ |
| 6222 | -s "! mbedtls_ssl_handshake returned" \ |
| 6223 | -s "got no RSA private key" \ |
| 6224 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6225 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6226 | |
| 6227 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6228 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6229 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6230 | "$P_SRV \ |
| 6231 | async_operations=s async_private_delay1=1 \ |
| 6232 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6233 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6234 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6235 | 0 \ |
| 6236 | -s "Async sign callback: using key slot 0," \ |
| 6237 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6238 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6239 | |
| 6240 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6241 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6242 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6243 | "$P_SRV \ |
| 6244 | async_operations=s async_private_delay2=1 \ |
| 6245 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6246 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6247 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6248 | 0 \ |
| 6249 | -s "Async sign callback: using key slot 0," \ |
| 6250 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6251 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6252 | |
| 6253 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6254 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6255 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6256 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6257 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6258 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6259 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6260 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6261 | 0 \ |
| 6262 | -s "Async sign callback: using key slot 1," \ |
| 6263 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6264 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6265 | |
| 6266 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6267 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6268 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6269 | "$P_SRV \ |
| 6270 | async_operations=s async_private_delay1=1 \ |
| 6271 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6272 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6273 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6274 | 0 \ |
| 6275 | -s "Async sign callback: no key matches this certificate." |
| 6276 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6277 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6278 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6279 | "$P_SRV \ |
| 6280 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6281 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6282 | "$P_CLI" \ |
| 6283 | 1 \ |
| 6284 | -s "Async sign callback: injected error" \ |
| 6285 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6286 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6287 | -s "! mbedtls_ssl_handshake returned" |
| 6288 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6289 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6290 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6291 | "$P_SRV \ |
| 6292 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6293 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6294 | "$P_CLI" \ |
| 6295 | 1 \ |
| 6296 | -s "Async sign callback: using key slot " \ |
| 6297 | -S "Async resume" \ |
| 6298 | -s "Async cancel" |
| 6299 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6300 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6301 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6302 | "$P_SRV \ |
| 6303 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6304 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6305 | "$P_CLI" \ |
| 6306 | 1 \ |
| 6307 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6308 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6309 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6310 | -s "! mbedtls_ssl_handshake returned" |
| 6311 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6312 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6313 | run_test "SSL async private: decrypt, error in start" \ |
| 6314 | "$P_SRV \ |
| 6315 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6316 | async_private_error=1" \ |
| 6317 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6318 | 1 \ |
| 6319 | -s "Async decrypt callback: injected error" \ |
| 6320 | -S "Async resume" \ |
| 6321 | -S "Async cancel" \ |
| 6322 | -s "! mbedtls_ssl_handshake returned" |
| 6323 | |
| 6324 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6325 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6326 | "$P_SRV \ |
| 6327 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6328 | async_private_error=2" \ |
| 6329 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6330 | 1 \ |
| 6331 | -s "Async decrypt callback: using key slot " \ |
| 6332 | -S "Async resume" \ |
| 6333 | -s "Async cancel" |
| 6334 | |
| 6335 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6336 | run_test "SSL async private: decrypt, error in resume" \ |
| 6337 | "$P_SRV \ |
| 6338 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6339 | async_private_error=3" \ |
| 6340 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6341 | 1 \ |
| 6342 | -s "Async decrypt callback: using key slot " \ |
| 6343 | -s "Async resume callback: decrypt done but injected error" \ |
| 6344 | -S "Async cancel" \ |
| 6345 | -s "! mbedtls_ssl_handshake returned" |
| 6346 | |
| 6347 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6348 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6349 | "$P_SRV \ |
| 6350 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6351 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6352 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6353 | 0 \ |
| 6354 | -s "Async cancel" \ |
| 6355 | -s "! mbedtls_ssl_handshake returned" \ |
| 6356 | -s "Async resume" \ |
| 6357 | -s "Successful connection" |
| 6358 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6359 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6360 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6361 | "$P_SRV \ |
| 6362 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6363 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6364 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6365 | 0 \ |
| 6366 | -s "! mbedtls_ssl_handshake returned" \ |
| 6367 | -s "Async resume" \ |
| 6368 | -s "Successful connection" |
| 6369 | |
| 6370 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6371 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6372 | 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] | 6373 | "$P_SRV \ |
| 6374 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6375 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6376 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6377 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6378 | [ \$? -eq 1 ] && |
| 6379 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6380 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6381 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6382 | -S "Async resume" \ |
| 6383 | -s "Async cancel" \ |
| 6384 | -s "! mbedtls_ssl_handshake returned" \ |
| 6385 | -s "Async sign callback: no key matches this certificate." \ |
| 6386 | -s "Successful connection" |
| 6387 | |
| 6388 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6389 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6390 | 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] | 6391 | "$P_SRV \ |
| 6392 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6393 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6394 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6395 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6396 | [ \$? -eq 1 ] && |
| 6397 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6398 | 0 \ |
| 6399 | -s "Async resume" \ |
| 6400 | -s "! mbedtls_ssl_handshake returned" \ |
| 6401 | -s "Async sign callback: no key matches this certificate." \ |
| 6402 | -s "Successful connection" |
| 6403 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6404 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6405 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6406 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6407 | "$P_SRV \ |
| 6408 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6409 | exchanges=2 renegotiation=1" \ |
| 6410 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6411 | 0 \ |
| 6412 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6413 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6414 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6415 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6416 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6417 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6418 | "$P_SRV \ |
| 6419 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6420 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6421 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6422 | 0 \ |
| 6423 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6424 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6425 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6426 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6427 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6428 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6429 | "$P_SRV \ |
| 6430 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6431 | exchanges=2 renegotiation=1" \ |
| 6432 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6433 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6434 | 0 \ |
| 6435 | -s "Async decrypt callback: using key slot " \ |
| 6436 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6437 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6438 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6439 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6440 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6441 | "$P_SRV \ |
| 6442 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6443 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6444 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6445 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6446 | 0 \ |
| 6447 | -s "Async decrypt callback: using key slot " \ |
| 6448 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6449 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6450 | # Tests for ECC extensions (rfc 4492) |
| 6451 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6452 | requires_config_enabled MBEDTLS_AES_C |
| 6453 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6454 | requires_config_enabled MBEDTLS_SHA256_C |
| 6455 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6456 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6457 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6458 | "$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] | 6459 | 0 \ |
| 6460 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6461 | -C "client hello, adding supported_point_formats extension" \ |
| 6462 | -S "found supported elliptic curves extension" \ |
| 6463 | -S "found supported point formats extension" |
| 6464 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6465 | requires_config_enabled MBEDTLS_AES_C |
| 6466 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6467 | requires_config_enabled MBEDTLS_SHA256_C |
| 6468 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6469 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6470 | "$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] | 6471 | "$P_CLI debug_level=3" \ |
| 6472 | 0 \ |
| 6473 | -C "found supported_point_formats extension" \ |
| 6474 | -S "server hello, supported_point_formats extension" |
| 6475 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6476 | requires_config_enabled MBEDTLS_AES_C |
| 6477 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6478 | requires_config_enabled MBEDTLS_SHA256_C |
| 6479 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6480 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6481 | "$P_SRV debug_level=3" \ |
| 6482 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6483 | 0 \ |
| 6484 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6485 | -c "client hello, adding supported_point_formats extension" \ |
| 6486 | -s "found supported elliptic curves extension" \ |
| 6487 | -s "found supported point formats extension" |
| 6488 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6489 | requires_config_enabled MBEDTLS_AES_C |
| 6490 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6491 | requires_config_enabled MBEDTLS_SHA256_C |
| 6492 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6493 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6494 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6495 | "$P_CLI debug_level=3" \ |
| 6496 | 0 \ |
| 6497 | -c "found supported_point_formats extension" \ |
| 6498 | -s "server hello, supported_point_formats extension" |
| 6499 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6500 | # Tests for DTLS HelloVerifyRequest |
| 6501 | |
| 6502 | run_test "DTLS cookie: enabled" \ |
| 6503 | "$P_SRV dtls=1 debug_level=2" \ |
| 6504 | "$P_CLI dtls=1 debug_level=2" \ |
| 6505 | 0 \ |
| 6506 | -s "cookie verification failed" \ |
| 6507 | -s "cookie verification passed" \ |
| 6508 | -S "cookie verification skipped" \ |
| 6509 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6510 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6511 | -S "SSL - The requested feature is not available" |
| 6512 | |
| 6513 | run_test "DTLS cookie: disabled" \ |
| 6514 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6515 | "$P_CLI dtls=1 debug_level=2" \ |
| 6516 | 0 \ |
| 6517 | -S "cookie verification failed" \ |
| 6518 | -S "cookie verification passed" \ |
| 6519 | -s "cookie verification skipped" \ |
| 6520 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6521 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6522 | -S "SSL - The requested feature is not available" |
| 6523 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6524 | run_test "DTLS cookie: default (failing)" \ |
| 6525 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6526 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6527 | 1 \ |
| 6528 | -s "cookie verification failed" \ |
| 6529 | -S "cookie verification passed" \ |
| 6530 | -S "cookie verification skipped" \ |
| 6531 | -C "received hello verify request" \ |
| 6532 | -S "hello verification requested" \ |
| 6533 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6534 | |
| 6535 | requires_ipv6 |
| 6536 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6537 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6538 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6539 | 0 \ |
| 6540 | -s "cookie verification failed" \ |
| 6541 | -s "cookie verification passed" \ |
| 6542 | -S "cookie verification skipped" \ |
| 6543 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6544 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6545 | -S "SSL - The requested feature is not available" |
| 6546 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6547 | run_test "DTLS cookie: enabled, nbio" \ |
| 6548 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6549 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6550 | 0 \ |
| 6551 | -s "cookie verification failed" \ |
| 6552 | -s "cookie verification passed" \ |
| 6553 | -S "cookie verification skipped" \ |
| 6554 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6555 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6556 | -S "SSL - The requested feature is not available" |
| 6557 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6558 | # Tests for client reconnecting from the same port with DTLS |
| 6559 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6560 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6561 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6562 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6563 | "$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] | 6564 | 0 \ |
| 6565 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6566 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6567 | -S "Client initiated reconnection from same port" |
| 6568 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6569 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6570 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6571 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6572 | "$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] | 6573 | 0 \ |
| 6574 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6575 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6576 | -s "Client initiated reconnection from same port" |
| 6577 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6578 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6579 | 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] | 6580 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6581 | "$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] | 6582 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6583 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6584 | -s "Client initiated reconnection from same port" |
| 6585 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6586 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6587 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6588 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6589 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6590 | 0 \ |
| 6591 | -S "The operation timed out" \ |
| 6592 | -s "Client initiated reconnection from same port" |
| 6593 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6594 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6595 | "$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] | 6596 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6597 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6598 | -s "The operation timed out" \ |
| 6599 | -S "Client initiated reconnection from same port" |
| 6600 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6601 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6602 | -p "$P_PXY inject_clihlo=1" \ |
| 6603 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6604 | "$P_CLI dtls=1 exchanges=2" \ |
| 6605 | 0 \ |
| 6606 | -s "possible client reconnect from the same port" \ |
| 6607 | -S "Client initiated reconnection from same port" |
| 6608 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6609 | # Tests for various cases of client authentication with DTLS |
| 6610 | # (focused on handshake flows and message parsing) |
| 6611 | |
| 6612 | run_test "DTLS client auth: required" \ |
| 6613 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6614 | "$P_CLI dtls=1" \ |
| 6615 | 0 \ |
| 6616 | -s "Verifying peer X.509 certificate... ok" |
| 6617 | |
| 6618 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6619 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6620 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6621 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6622 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6623 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6624 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6625 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6626 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6627 | 0 \ |
| 6628 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6629 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6630 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6631 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6632 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6633 | "$P_CLI dtls=1 psk=abc124" \ |
| 6634 | 1 \ |
| 6635 | -s "SSL - Verification of the message MAC failed" \ |
| 6636 | -c "SSL - A fatal alert message was received from our peer" |
| 6637 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6638 | # Tests for receiving fragmented handshake messages with DTLS |
| 6639 | |
| 6640 | requires_gnutls |
| 6641 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6642 | "$G_SRV -u --mtu 2048 -a" \ |
| 6643 | "$P_CLI dtls=1 debug_level=2" \ |
| 6644 | 0 \ |
| 6645 | -C "found fragmented DTLS handshake message" \ |
| 6646 | -C "error" |
| 6647 | |
| 6648 | requires_gnutls |
| 6649 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6650 | "$G_SRV -u --mtu 512" \ |
| 6651 | "$P_CLI dtls=1 debug_level=2" \ |
| 6652 | 0 \ |
| 6653 | -c "found fragmented DTLS handshake message" \ |
| 6654 | -C "error" |
| 6655 | |
| 6656 | requires_gnutls |
| 6657 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6658 | "$G_SRV -u --mtu 128" \ |
| 6659 | "$P_CLI dtls=1 debug_level=2" \ |
| 6660 | 0 \ |
| 6661 | -c "found fragmented DTLS handshake message" \ |
| 6662 | -C "error" |
| 6663 | |
| 6664 | requires_gnutls |
| 6665 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6666 | "$G_SRV -u --mtu 128" \ |
| 6667 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6668 | 0 \ |
| 6669 | -c "found fragmented DTLS handshake message" \ |
| 6670 | -C "error" |
| 6671 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6672 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6673 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6674 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6675 | "$G_SRV -u --mtu 256" \ |
| 6676 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6677 | 0 \ |
| 6678 | -c "found fragmented DTLS handshake message" \ |
| 6679 | -c "client hello, adding renegotiation extension" \ |
| 6680 | -c "found renegotiation extension" \ |
| 6681 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6682 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6683 | -C "error" \ |
| 6684 | -s "Extra-header:" |
| 6685 | |
| 6686 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6687 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6688 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6689 | "$G_SRV -u --mtu 256" \ |
| 6690 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6691 | 0 \ |
| 6692 | -c "found fragmented DTLS handshake message" \ |
| 6693 | -c "client hello, adding renegotiation extension" \ |
| 6694 | -c "found renegotiation extension" \ |
| 6695 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6696 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6697 | -C "error" \ |
| 6698 | -s "Extra-header:" |
| 6699 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6700 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6701 | "$O_SRV -dtls -mtu 2048" \ |
| 6702 | "$P_CLI dtls=1 debug_level=2" \ |
| 6703 | 0 \ |
| 6704 | -C "found fragmented DTLS handshake message" \ |
| 6705 | -C "error" |
| 6706 | |
| 6707 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6708 | "$O_SRV -dtls -mtu 768" \ |
| 6709 | "$P_CLI dtls=1 debug_level=2" \ |
| 6710 | 0 \ |
| 6711 | -c "found fragmented DTLS handshake message" \ |
| 6712 | -C "error" |
| 6713 | |
| 6714 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6715 | "$O_SRV -dtls -mtu 256" \ |
| 6716 | "$P_CLI dtls=1 debug_level=2" \ |
| 6717 | 0 \ |
| 6718 | -c "found fragmented DTLS handshake message" \ |
| 6719 | -C "error" |
| 6720 | |
| 6721 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6722 | "$O_SRV -dtls -mtu 256" \ |
| 6723 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6724 | 0 \ |
| 6725 | -c "found fragmented DTLS handshake message" \ |
| 6726 | -C "error" |
| 6727 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6728 | # Tests for sending fragmented handshake messages with DTLS |
| 6729 | # |
| 6730 | # Use client auth when we need the client to send large messages, |
| 6731 | # and use large cert chains on both sides too (the long chains we have all use |
| 6732 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6733 | # Sizes reached (UDP payload): |
| 6734 | # - 2037B for server certificate |
| 6735 | # - 1542B for client certificate |
| 6736 | # - 1013B for newsessionticket |
| 6737 | # - all others below 512B |
| 6738 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6739 | |
| 6740 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6741 | requires_config_enabled MBEDTLS_RSA_C |
| 6742 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6743 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6744 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6745 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6746 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6747 | crt_file=data_files/server7_int-ca.crt \ |
| 6748 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6749 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6750 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6751 | "$P_CLI dtls=1 debug_level=2 \ |
| 6752 | crt_file=data_files/server8_int-ca2.crt \ |
| 6753 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6754 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6755 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6756 | 0 \ |
| 6757 | -S "found fragmented DTLS handshake message" \ |
| 6758 | -C "found fragmented DTLS handshake message" \ |
| 6759 | -C "error" |
| 6760 | |
| 6761 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6762 | requires_config_enabled MBEDTLS_RSA_C |
| 6763 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6764 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6765 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6766 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6767 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6768 | crt_file=data_files/server7_int-ca.crt \ |
| 6769 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6770 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6771 | max_frag_len=1024" \ |
| 6772 | "$P_CLI dtls=1 debug_level=2 \ |
| 6773 | crt_file=data_files/server8_int-ca2.crt \ |
| 6774 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6775 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6776 | max_frag_len=2048" \ |
| 6777 | 0 \ |
| 6778 | -S "found fragmented DTLS handshake message" \ |
| 6779 | -c "found fragmented DTLS handshake message" \ |
| 6780 | -C "error" |
| 6781 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6782 | # With the MFL extension, the server has no way of forcing |
| 6783 | # the client to not exceed a certain MTU; hence, the following |
| 6784 | # test can't be replicated with an MTU proxy such as the one |
| 6785 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6786 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6787 | requires_config_enabled MBEDTLS_RSA_C |
| 6788 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6789 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6790 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6791 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6792 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6793 | crt_file=data_files/server7_int-ca.crt \ |
| 6794 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6795 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6796 | max_frag_len=512" \ |
| 6797 | "$P_CLI dtls=1 debug_level=2 \ |
| 6798 | crt_file=data_files/server8_int-ca2.crt \ |
| 6799 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6800 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6801 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6802 | 0 \ |
| 6803 | -S "found fragmented DTLS handshake message" \ |
| 6804 | -c "found fragmented DTLS handshake message" \ |
| 6805 | -C "error" |
| 6806 | |
| 6807 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6808 | requires_config_enabled MBEDTLS_RSA_C |
| 6809 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6810 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6811 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6812 | 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] | 6813 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6814 | crt_file=data_files/server7_int-ca.crt \ |
| 6815 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6816 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6817 | max_frag_len=2048" \ |
| 6818 | "$P_CLI dtls=1 debug_level=2 \ |
| 6819 | crt_file=data_files/server8_int-ca2.crt \ |
| 6820 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6821 | hs_timeout=2500-60000 \ |
| 6822 | max_frag_len=1024" \ |
| 6823 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6824 | -S "found fragmented DTLS handshake message" \ |
| 6825 | -c "found fragmented DTLS handshake message" \ |
| 6826 | -C "error" |
| 6827 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6828 | # While not required by the standard defining the MFL extension |
| 6829 | # (according to which it only applies to records, not to datagrams), |
| 6830 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6831 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6832 | # to the peer. |
| 6833 | # The next test checks that no datagrams significantly larger than the |
| 6834 | # negotiated MFL are sent. |
| 6835 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6836 | requires_config_enabled MBEDTLS_RSA_C |
| 6837 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6838 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6839 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6840 | 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] | 6841 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6842 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6843 | crt_file=data_files/server7_int-ca.crt \ |
| 6844 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6845 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6846 | max_frag_len=2048" \ |
| 6847 | "$P_CLI dtls=1 debug_level=2 \ |
| 6848 | crt_file=data_files/server8_int-ca2.crt \ |
| 6849 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6850 | hs_timeout=2500-60000 \ |
| 6851 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6852 | 0 \ |
| 6853 | -S "found fragmented DTLS handshake message" \ |
| 6854 | -c "found fragmented DTLS handshake message" \ |
| 6855 | -C "error" |
| 6856 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6857 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6858 | requires_config_enabled MBEDTLS_RSA_C |
| 6859 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6860 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6861 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6862 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6863 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6864 | crt_file=data_files/server7_int-ca.crt \ |
| 6865 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6866 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6867 | max_frag_len=2048" \ |
| 6868 | "$P_CLI dtls=1 debug_level=2 \ |
| 6869 | crt_file=data_files/server8_int-ca2.crt \ |
| 6870 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6871 | hs_timeout=2500-60000 \ |
| 6872 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6873 | 0 \ |
| 6874 | -s "found fragmented DTLS handshake message" \ |
| 6875 | -c "found fragmented DTLS handshake message" \ |
| 6876 | -C "error" |
| 6877 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6878 | # While not required by the standard defining the MFL extension |
| 6879 | # (according to which it only applies to records, not to datagrams), |
| 6880 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6881 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6882 | # to the peer. |
| 6883 | # The next test checks that no datagrams significantly larger than the |
| 6884 | # negotiated MFL are sent. |
| 6885 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6886 | requires_config_enabled MBEDTLS_RSA_C |
| 6887 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6888 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6889 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6890 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6891 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6892 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6893 | crt_file=data_files/server7_int-ca.crt \ |
| 6894 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6895 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6896 | max_frag_len=2048" \ |
| 6897 | "$P_CLI dtls=1 debug_level=2 \ |
| 6898 | crt_file=data_files/server8_int-ca2.crt \ |
| 6899 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6900 | hs_timeout=2500-60000 \ |
| 6901 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6902 | 0 \ |
| 6903 | -s "found fragmented DTLS handshake message" \ |
| 6904 | -c "found fragmented DTLS handshake message" \ |
| 6905 | -C "error" |
| 6906 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6907 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6908 | requires_config_enabled MBEDTLS_RSA_C |
| 6909 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6910 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6911 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6912 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6913 | crt_file=data_files/server7_int-ca.crt \ |
| 6914 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6915 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6916 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6917 | "$P_CLI dtls=1 debug_level=2 \ |
| 6918 | crt_file=data_files/server8_int-ca2.crt \ |
| 6919 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6920 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6921 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6922 | 0 \ |
| 6923 | -S "found fragmented DTLS handshake message" \ |
| 6924 | -C "found fragmented DTLS handshake message" \ |
| 6925 | -C "error" |
| 6926 | |
| 6927 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6928 | requires_config_enabled MBEDTLS_RSA_C |
| 6929 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6930 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6931 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6932 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6933 | crt_file=data_files/server7_int-ca.crt \ |
| 6934 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6935 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6936 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6937 | "$P_CLI dtls=1 debug_level=2 \ |
| 6938 | crt_file=data_files/server8_int-ca2.crt \ |
| 6939 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6940 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6941 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6942 | 0 \ |
| 6943 | -s "found fragmented DTLS handshake message" \ |
| 6944 | -C "found fragmented DTLS handshake message" \ |
| 6945 | -C "error" |
| 6946 | |
| 6947 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6948 | requires_config_enabled MBEDTLS_RSA_C |
| 6949 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6950 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6951 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6952 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6953 | crt_file=data_files/server7_int-ca.crt \ |
| 6954 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6955 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6956 | mtu=512" \ |
| 6957 | "$P_CLI dtls=1 debug_level=2 \ |
| 6958 | crt_file=data_files/server8_int-ca2.crt \ |
| 6959 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6960 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6961 | mtu=2048" \ |
| 6962 | 0 \ |
| 6963 | -S "found fragmented DTLS handshake message" \ |
| 6964 | -c "found fragmented DTLS handshake message" \ |
| 6965 | -C "error" |
| 6966 | |
| 6967 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6968 | requires_config_enabled MBEDTLS_RSA_C |
| 6969 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6970 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6971 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6972 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6973 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6974 | crt_file=data_files/server7_int-ca.crt \ |
| 6975 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6976 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6977 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6978 | "$P_CLI dtls=1 debug_level=2 \ |
| 6979 | crt_file=data_files/server8_int-ca2.crt \ |
| 6980 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6981 | hs_timeout=2500-60000 \ |
| 6982 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6983 | 0 \ |
| 6984 | -s "found fragmented DTLS handshake message" \ |
| 6985 | -c "found fragmented DTLS handshake message" \ |
| 6986 | -C "error" |
| 6987 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6988 | # 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] | 6989 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6990 | requires_config_enabled MBEDTLS_RSA_C |
| 6991 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6992 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6993 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 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 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6997 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6998 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 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 | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7002 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7003 | mtu=512" \ |
| 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 | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7007 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7008 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7009 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7010 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7011 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7012 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7013 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7014 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7015 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7016 | # 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] | 7017 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7018 | # retransmissions, but in some cases (like both the server and client using |
| 7019 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7020 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7021 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7022 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7023 | requires_config_enabled MBEDTLS_RSA_C |
| 7024 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7025 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7026 | requires_config_enabled MBEDTLS_AES_C |
| 7027 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7028 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7029 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7030 | -p "$P_PXY mtu=508" \ |
| 7031 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7032 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7033 | key_file=data_files/server7.key \ |
| 7034 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7035 | "$P_CLI dtls=1 debug_level=2 \ |
| 7036 | crt_file=data_files/server8_int-ca2.crt \ |
| 7037 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7038 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7039 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7040 | 0 \ |
| 7041 | -s "found fragmented DTLS handshake message" \ |
| 7042 | -c "found fragmented DTLS handshake message" \ |
| 7043 | -C "error" |
| 7044 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7045 | # 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] | 7046 | only_with_valgrind |
| 7047 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7048 | requires_config_enabled MBEDTLS_RSA_C |
| 7049 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7050 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7051 | requires_config_enabled MBEDTLS_AES_C |
| 7052 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7053 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7054 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7055 | -p "$P_PXY mtu=508" \ |
| 7056 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7057 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7058 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7059 | hs_timeout=250-10000" \ |
| 7060 | "$P_CLI dtls=1 debug_level=2 \ |
| 7061 | crt_file=data_files/server8_int-ca2.crt \ |
| 7062 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7063 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7064 | hs_timeout=250-10000" \ |
| 7065 | 0 \ |
| 7066 | -s "found fragmented DTLS handshake message" \ |
| 7067 | -c "found fragmented DTLS handshake message" \ |
| 7068 | -C "error" |
| 7069 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7070 | # 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] | 7071 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7072 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7073 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7074 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7075 | requires_config_enabled MBEDTLS_RSA_C |
| 7076 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7077 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7078 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7079 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7080 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7081 | crt_file=data_files/server7_int-ca.crt \ |
| 7082 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7083 | hs_timeout=10000-60000 \ |
| 7084 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7085 | "$P_CLI dtls=1 debug_level=2 \ |
| 7086 | crt_file=data_files/server8_int-ca2.crt \ |
| 7087 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7088 | hs_timeout=10000-60000 \ |
| 7089 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7090 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7091 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7092 | -s "found fragmented DTLS handshake message" \ |
| 7093 | -c "found fragmented DTLS handshake message" \ |
| 7094 | -C "error" |
| 7095 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7096 | # 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] | 7097 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7098 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7099 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7100 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7101 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7102 | requires_config_enabled MBEDTLS_RSA_C |
| 7103 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7104 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7105 | requires_config_enabled MBEDTLS_AES_C |
| 7106 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7107 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7108 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7109 | -p "$P_PXY mtu=512" \ |
| 7110 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7111 | crt_file=data_files/server7_int-ca.crt \ |
| 7112 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7113 | hs_timeout=10000-60000 \ |
| 7114 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7115 | "$P_CLI dtls=1 debug_level=2 \ |
| 7116 | crt_file=data_files/server8_int-ca2.crt \ |
| 7117 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7118 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7119 | hs_timeout=10000-60000 \ |
| 7120 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7121 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7122 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7123 | -s "found fragmented DTLS handshake message" \ |
| 7124 | -c "found fragmented DTLS handshake message" \ |
| 7125 | -C "error" |
| 7126 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7127 | not_with_valgrind # spurious autoreduction due to timeout |
| 7128 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7129 | requires_config_enabled MBEDTLS_RSA_C |
| 7130 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7131 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7132 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7133 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7134 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7135 | crt_file=data_files/server7_int-ca.crt \ |
| 7136 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7137 | hs_timeout=10000-60000 \ |
| 7138 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7139 | "$P_CLI dtls=1 debug_level=2 \ |
| 7140 | crt_file=data_files/server8_int-ca2.crt \ |
| 7141 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7142 | hs_timeout=10000-60000 \ |
| 7143 | mtu=1024 nbio=2" \ |
| 7144 | 0 \ |
| 7145 | -S "autoreduction" \ |
| 7146 | -s "found fragmented DTLS handshake message" \ |
| 7147 | -c "found fragmented DTLS handshake message" \ |
| 7148 | -C "error" |
| 7149 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7150 | # 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] | 7151 | not_with_valgrind # spurious autoreduction due to timeout |
| 7152 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7153 | requires_config_enabled MBEDTLS_RSA_C |
| 7154 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7155 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7156 | requires_config_enabled MBEDTLS_AES_C |
| 7157 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7158 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7159 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7160 | -p "$P_PXY mtu=512" \ |
| 7161 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7162 | crt_file=data_files/server7_int-ca.crt \ |
| 7163 | key_file=data_files/server7.key \ |
| 7164 | hs_timeout=10000-60000 \ |
| 7165 | mtu=512 nbio=2" \ |
| 7166 | "$P_CLI dtls=1 debug_level=2 \ |
| 7167 | crt_file=data_files/server8_int-ca2.crt \ |
| 7168 | key_file=data_files/server8.key \ |
| 7169 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7170 | hs_timeout=10000-60000 \ |
| 7171 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7172 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7173 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7174 | -s "found fragmented DTLS handshake message" \ |
| 7175 | -c "found fragmented DTLS handshake message" \ |
| 7176 | -C "error" |
| 7177 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7178 | # 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] | 7179 | # This ensures things still work after session_reset(). |
| 7180 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7181 | # Since we don't support reading fragmented ClientHello yet, |
| 7182 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7183 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7184 | # An autoreduction on the client-side might happen if the server is |
| 7185 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7186 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7187 | # resumed listening, which would result in a spurious autoreduction. |
| 7188 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7189 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7190 | requires_config_enabled MBEDTLS_RSA_C |
| 7191 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7192 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7193 | requires_config_enabled MBEDTLS_AES_C |
| 7194 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7195 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7196 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7197 | -p "$P_PXY mtu=1450" \ |
| 7198 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7199 | crt_file=data_files/server7_int-ca.crt \ |
| 7200 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7201 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7202 | mtu=1450" \ |
| 7203 | "$P_CLI dtls=1 debug_level=2 \ |
| 7204 | crt_file=data_files/server8_int-ca2.crt \ |
| 7205 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7206 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7207 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7208 | 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] | 7209 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7210 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7211 | -s "found fragmented DTLS handshake message" \ |
| 7212 | -c "found fragmented DTLS handshake message" \ |
| 7213 | -C "error" |
| 7214 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7215 | # An autoreduction on the client-side might happen if the server is |
| 7216 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7217 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7218 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7219 | requires_config_enabled MBEDTLS_RSA_C |
| 7220 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7221 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7222 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7223 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7224 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7225 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7226 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7227 | -p "$P_PXY mtu=512" \ |
| 7228 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7229 | crt_file=data_files/server7_int-ca.crt \ |
| 7230 | key_file=data_files/server7.key \ |
| 7231 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7232 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7233 | mtu=512" \ |
| 7234 | "$P_CLI dtls=1 debug_level=2 \ |
| 7235 | crt_file=data_files/server8_int-ca2.crt \ |
| 7236 | key_file=data_files/server8.key \ |
| 7237 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7238 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7239 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7240 | mtu=512" \ |
| 7241 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7242 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7243 | -s "found fragmented DTLS handshake message" \ |
| 7244 | -c "found fragmented DTLS handshake message" \ |
| 7245 | -C "error" |
| 7246 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7247 | # An autoreduction on the client-side might happen if the server is |
| 7248 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7249 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7250 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7251 | requires_config_enabled MBEDTLS_RSA_C |
| 7252 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7253 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7254 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7255 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7256 | requires_config_enabled MBEDTLS_AES_C |
| 7257 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7258 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7259 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7260 | -p "$P_PXY mtu=512" \ |
| 7261 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7262 | crt_file=data_files/server7_int-ca.crt \ |
| 7263 | key_file=data_files/server7.key \ |
| 7264 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7265 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7266 | mtu=512" \ |
| 7267 | "$P_CLI dtls=1 debug_level=2 \ |
| 7268 | crt_file=data_files/server8_int-ca2.crt \ |
| 7269 | key_file=data_files/server8.key \ |
| 7270 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7271 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7272 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7273 | mtu=512" \ |
| 7274 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7275 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7276 | -s "found fragmented DTLS handshake message" \ |
| 7277 | -c "found fragmented DTLS handshake message" \ |
| 7278 | -C "error" |
| 7279 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7280 | # An autoreduction on the client-side might happen if the server is |
| 7281 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7282 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7283 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7284 | requires_config_enabled MBEDTLS_RSA_C |
| 7285 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7286 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7287 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7288 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7289 | requires_config_enabled MBEDTLS_AES_C |
| 7290 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7291 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7292 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7293 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7294 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7295 | crt_file=data_files/server7_int-ca.crt \ |
| 7296 | key_file=data_files/server7.key \ |
| 7297 | exchanges=2 renegotiation=1 \ |
| 7298 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7299 | hs_timeout=10000-60000 \ |
| 7300 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7301 | "$P_CLI dtls=1 debug_level=2 \ |
| 7302 | crt_file=data_files/server8_int-ca2.crt \ |
| 7303 | key_file=data_files/server8.key \ |
| 7304 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7305 | hs_timeout=10000-60000 \ |
| 7306 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7307 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7308 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7309 | -s "found fragmented DTLS handshake message" \ |
| 7310 | -c "found fragmented DTLS handshake message" \ |
| 7311 | -C "error" |
| 7312 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7313 | # An autoreduction on the client-side might happen if the server is |
| 7314 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7315 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7316 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7317 | requires_config_enabled MBEDTLS_RSA_C |
| 7318 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7319 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7320 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7321 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7322 | requires_config_enabled MBEDTLS_AES_C |
| 7323 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7324 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7325 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7326 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7327 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7328 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7329 | crt_file=data_files/server7_int-ca.crt \ |
| 7330 | key_file=data_files/server7.key \ |
| 7331 | exchanges=2 renegotiation=1 \ |
| 7332 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7333 | hs_timeout=10000-60000 \ |
| 7334 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7335 | "$P_CLI dtls=1 debug_level=2 \ |
| 7336 | crt_file=data_files/server8_int-ca2.crt \ |
| 7337 | key_file=data_files/server8.key \ |
| 7338 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7339 | hs_timeout=10000-60000 \ |
| 7340 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7341 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7342 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7343 | -s "found fragmented DTLS handshake message" \ |
| 7344 | -c "found fragmented DTLS handshake message" \ |
| 7345 | -C "error" |
| 7346 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7347 | # An autoreduction on the client-side might happen if the server is |
| 7348 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7349 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7350 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7351 | requires_config_enabled MBEDTLS_RSA_C |
| 7352 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7353 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7354 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7355 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7356 | requires_config_enabled MBEDTLS_AES_C |
| 7357 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7358 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7359 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7360 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7361 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7362 | crt_file=data_files/server7_int-ca.crt \ |
| 7363 | key_file=data_files/server7.key \ |
| 7364 | exchanges=2 renegotiation=1 \ |
| 7365 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7366 | hs_timeout=10000-60000 \ |
| 7367 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7368 | "$P_CLI dtls=1 debug_level=2 \ |
| 7369 | crt_file=data_files/server8_int-ca2.crt \ |
| 7370 | key_file=data_files/server8.key \ |
| 7371 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7372 | hs_timeout=10000-60000 \ |
| 7373 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7374 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7375 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7376 | -s "found fragmented DTLS handshake message" \ |
| 7377 | -c "found fragmented DTLS handshake message" \ |
| 7378 | -C "error" |
| 7379 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7380 | # 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] | 7381 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7382 | requires_config_enabled MBEDTLS_RSA_C |
| 7383 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7384 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7385 | requires_config_enabled MBEDTLS_AES_C |
| 7386 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7387 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7388 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7389 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7390 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7391 | "$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] | 7392 | crt_file=data_files/server7_int-ca.crt \ |
| 7393 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7394 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7395 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7396 | crt_file=data_files/server8_int-ca2.crt \ |
| 7397 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7398 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7399 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7400 | 0 \ |
| 7401 | -s "found fragmented DTLS handshake message" \ |
| 7402 | -c "found fragmented DTLS handshake message" \ |
| 7403 | -C "error" |
| 7404 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7405 | # 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] | 7406 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7407 | requires_config_enabled MBEDTLS_RSA_C |
| 7408 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7409 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7410 | requires_config_enabled MBEDTLS_AES_C |
| 7411 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7412 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7413 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7414 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7415 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7416 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7417 | crt_file=data_files/server7_int-ca.crt \ |
| 7418 | key_file=data_files/server7.key \ |
| 7419 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7420 | "$P_CLI dtls=1 debug_level=2 \ |
| 7421 | crt_file=data_files/server8_int-ca2.crt \ |
| 7422 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7423 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7424 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7425 | 0 \ |
| 7426 | -s "found fragmented DTLS handshake message" \ |
| 7427 | -c "found fragmented DTLS handshake message" \ |
| 7428 | -C "error" |
| 7429 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7430 | # interop tests for DTLS fragmentating with reliable connection |
| 7431 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7432 | # here and below we just want to test that the we fragment in a way that |
| 7433 | # pleases other implementations, so we don't need the peer to fragment |
| 7434 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7435 | requires_config_enabled MBEDTLS_RSA_C |
| 7436 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7437 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7438 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7439 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7440 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7441 | "$G_SRV -u" \ |
| 7442 | "$P_CLI dtls=1 debug_level=2 \ |
| 7443 | crt_file=data_files/server8_int-ca2.crt \ |
| 7444 | key_file=data_files/server8.key \ |
| 7445 | mtu=512 force_version=dtls1_2" \ |
| 7446 | 0 \ |
| 7447 | -c "fragmenting handshake message" \ |
| 7448 | -C "error" |
| 7449 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7450 | # We use --insecure for the GnuTLS client because it expects |
| 7451 | # the hostname / IP it connects to to be the name used in the |
| 7452 | # certificate obtained from the server. Here, however, it |
| 7453 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7454 | # as the server name in the certificate. This will make the |
| 7455 | # certifiate validation fail, but passing --insecure makes |
| 7456 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7457 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7458 | requires_config_enabled MBEDTLS_RSA_C |
| 7459 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7460 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7461 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7462 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7463 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7464 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7465 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7466 | crt_file=data_files/server7_int-ca.crt \ |
| 7467 | key_file=data_files/server7.key \ |
| 7468 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7469 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7470 | 0 \ |
| 7471 | -s "fragmenting handshake message" |
| 7472 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7473 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7474 | requires_config_enabled MBEDTLS_RSA_C |
| 7475 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7477 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7478 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7479 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7480 | "$P_CLI dtls=1 debug_level=2 \ |
| 7481 | crt_file=data_files/server8_int-ca2.crt \ |
| 7482 | key_file=data_files/server8.key \ |
| 7483 | mtu=512 force_version=dtls1_2" \ |
| 7484 | 0 \ |
| 7485 | -c "fragmenting handshake message" \ |
| 7486 | -C "error" |
| 7487 | |
| 7488 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7489 | requires_config_enabled MBEDTLS_RSA_C |
| 7490 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7491 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7492 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7493 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7494 | "$P_SRV dtls=1 debug_level=2 \ |
| 7495 | crt_file=data_files/server7_int-ca.crt \ |
| 7496 | key_file=data_files/server7.key \ |
| 7497 | mtu=512 force_version=dtls1_2" \ |
| 7498 | "$O_CLI -dtls1_2" \ |
| 7499 | 0 \ |
| 7500 | -s "fragmenting handshake message" |
| 7501 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7502 | # interop tests for DTLS fragmentating with unreliable connection |
| 7503 | # |
| 7504 | # again we just want to test that the we fragment in a way that |
| 7505 | # pleases other implementations, so we don't need the peer to fragment |
| 7506 | requires_gnutls_next |
| 7507 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7508 | requires_config_enabled MBEDTLS_RSA_C |
| 7509 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7510 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7511 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7512 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7513 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7514 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7515 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7516 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7517 | crt_file=data_files/server8_int-ca2.crt \ |
| 7518 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7519 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7520 | 0 \ |
| 7521 | -c "fragmenting handshake message" \ |
| 7522 | -C "error" |
| 7523 | |
| 7524 | requires_gnutls_next |
| 7525 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7526 | requires_config_enabled MBEDTLS_RSA_C |
| 7527 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7528 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7529 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7530 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7531 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7532 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7533 | "$P_SRV dtls=1 debug_level=2 \ |
| 7534 | crt_file=data_files/server7_int-ca.crt \ |
| 7535 | key_file=data_files/server7.key \ |
| 7536 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7537 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7538 | 0 \ |
| 7539 | -s "fragmenting handshake message" |
| 7540 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7541 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7542 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7543 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7544 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7545 | ## (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] | 7546 | skip_next_test |
| 7547 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7548 | requires_config_enabled MBEDTLS_RSA_C |
| 7549 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7550 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7551 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7552 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7553 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7554 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7555 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7556 | "$P_CLI dtls=1 debug_level=2 \ |
| 7557 | crt_file=data_files/server8_int-ca2.crt \ |
| 7558 | key_file=data_files/server8.key \ |
| 7559 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7560 | 0 \ |
| 7561 | -c "fragmenting handshake message" \ |
| 7562 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7563 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7564 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7565 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7566 | requires_config_enabled MBEDTLS_RSA_C |
| 7567 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7568 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7569 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7570 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7571 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7572 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7573 | "$P_SRV dtls=1 debug_level=2 \ |
| 7574 | crt_file=data_files/server7_int-ca.crt \ |
| 7575 | key_file=data_files/server7.key \ |
| 7576 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7577 | "$O_CLI -dtls1_2" \ |
| 7578 | 0 \ |
| 7579 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7580 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7581 | # Tests for DTLS-SRTP (RFC 5764) |
| 7582 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7583 | run_test "DTLS-SRTP all profiles supported" \ |
| 7584 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7585 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7586 | 0 \ |
| 7587 | -s "found use_srtp extension" \ |
| 7588 | -s "found srtp profile" \ |
| 7589 | -s "selected srtp profile" \ |
| 7590 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7591 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7592 | -c "client hello, adding use_srtp extension" \ |
| 7593 | -c "found use_srtp extension" \ |
| 7594 | -c "found srtp profile" \ |
| 7595 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7596 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7597 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7598 | -C "error" |
| 7599 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7600 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7601 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7602 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7603 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7604 | "$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] | 7605 | 0 \ |
| 7606 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7607 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7608 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7609 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7610 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7611 | -c "client hello, adding use_srtp extension" \ |
| 7612 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7613 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7614 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7615 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7616 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7617 | -C "error" |
| 7618 | |
| 7619 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7620 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7621 | "$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] | 7622 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7623 | 0 \ |
| 7624 | -s "found use_srtp extension" \ |
| 7625 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7626 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7627 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7628 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7629 | -c "client hello, adding use_srtp extension" \ |
| 7630 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7631 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7632 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7633 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7634 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7635 | -C "error" |
| 7636 | |
| 7637 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7638 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7639 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7640 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7641 | 0 \ |
| 7642 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7643 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7644 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7645 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7646 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7647 | -c "client hello, adding use_srtp extension" \ |
| 7648 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7649 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7650 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7651 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7652 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7653 | -C "error" |
| 7654 | |
| 7655 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7656 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7657 | "$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] | 7658 | "$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] | 7659 | 0 \ |
| 7660 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7661 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7662 | -S "selected srtp profile" \ |
| 7663 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7664 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7665 | -c "client hello, adding use_srtp extension" \ |
| 7666 | -C "found use_srtp extension" \ |
| 7667 | -C "found srtp profile" \ |
| 7668 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7669 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7670 | -C "error" |
| 7671 | |
| 7672 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7673 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7674 | "$P_SRV dtls=1 debug_level=3" \ |
| 7675 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7676 | 0 \ |
| 7677 | -s "found use_srtp extension" \ |
| 7678 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7679 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7680 | -c "client hello, adding use_srtp extension" \ |
| 7681 | -C "found use_srtp extension" \ |
| 7682 | -C "found srtp profile" \ |
| 7683 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7684 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7685 | -C "error" |
| 7686 | |
| 7687 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7688 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 7689 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7690 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7691 | 0 \ |
| 7692 | -s "found use_srtp extension" \ |
| 7693 | -s "found srtp profile" \ |
| 7694 | -s "selected srtp profile" \ |
| 7695 | -s "server hello, adding use_srtp extension" \ |
| 7696 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7697 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7698 | -c "client hello, adding use_srtp extension" \ |
| 7699 | -c "found use_srtp extension" \ |
| 7700 | -c "found srtp profile" \ |
| 7701 | -c "selected srtp profile" \ |
| 7702 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7703 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7704 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7705 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7706 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7707 | -C "error" |
| 7708 | |
| 7709 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7710 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7711 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7712 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7713 | 0 \ |
| 7714 | -s "found use_srtp extension" \ |
| 7715 | -s "found srtp profile" \ |
| 7716 | -s "selected srtp profile" \ |
| 7717 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7718 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7719 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7720 | -S "dumping 'using mki' (8 bytes)" \ |
| 7721 | -c "client hello, adding use_srtp extension" \ |
| 7722 | -c "found use_srtp extension" \ |
| 7723 | -c "found srtp profile" \ |
| 7724 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7725 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7726 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7727 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7728 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7729 | -C "dumping 'received mki' (8 bytes)" \ |
| 7730 | -C "error" |
| 7731 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7732 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7733 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7734 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7735 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7736 | 0 \ |
| 7737 | -s "found use_srtp extension" \ |
| 7738 | -s "found srtp profile" \ |
| 7739 | -s "selected srtp profile" \ |
| 7740 | -s "server hello, adding use_srtp extension" \ |
| 7741 | -s "DTLS-SRTP key material is"\ |
| 7742 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7743 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7744 | |
| 7745 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7746 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7747 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7748 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7749 | 0 \ |
| 7750 | -s "found use_srtp extension" \ |
| 7751 | -s "found srtp profile" \ |
| 7752 | -s "selected srtp profile" \ |
| 7753 | -s "server hello, adding use_srtp extension" \ |
| 7754 | -s "DTLS-SRTP key material is"\ |
| 7755 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7756 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7757 | |
| 7758 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7759 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7760 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7761 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7762 | 0 \ |
| 7763 | -s "found use_srtp extension" \ |
| 7764 | -s "found srtp profile" \ |
| 7765 | -s "selected srtp profile" \ |
| 7766 | -s "server hello, adding use_srtp extension" \ |
| 7767 | -s "DTLS-SRTP key material is"\ |
| 7768 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7769 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7770 | |
| 7771 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7772 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7773 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7774 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7775 | 0 \ |
| 7776 | -s "found use_srtp extension" \ |
| 7777 | -s "found srtp profile" \ |
| 7778 | -s "selected srtp profile" \ |
| 7779 | -s "server hello, adding use_srtp extension" \ |
| 7780 | -s "DTLS-SRTP key material is"\ |
| 7781 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7782 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7783 | |
| 7784 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7785 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7786 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7787 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7788 | 0 \ |
| 7789 | -s "found use_srtp extension" \ |
| 7790 | -s "found srtp profile" \ |
| 7791 | -s "selected srtp profile" \ |
| 7792 | -s "server hello, adding use_srtp extension" \ |
| 7793 | -s "DTLS-SRTP key material is"\ |
| 7794 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7795 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7796 | |
| 7797 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7798 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7799 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7800 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7801 | 0 \ |
| 7802 | -s "found use_srtp extension" \ |
| 7803 | -s "found srtp profile" \ |
| 7804 | -S "selected srtp profile" \ |
| 7805 | -S "server hello, adding use_srtp extension" \ |
| 7806 | -S "DTLS-SRTP key material is"\ |
| 7807 | -C "SRTP Extension negotiated, profile" |
| 7808 | |
| 7809 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7810 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7811 | "$P_SRV dtls=1 debug_level=3" \ |
| 7812 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7813 | 0 \ |
| 7814 | -s "found use_srtp extension" \ |
| 7815 | -S "server hello, adding use_srtp extension" \ |
| 7816 | -S "DTLS-SRTP key material is"\ |
| 7817 | -C "SRTP Extension negotiated, profile" |
| 7818 | |
| 7819 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7820 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7821 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7822 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7823 | 0 \ |
| 7824 | -c "client hello, adding use_srtp extension" \ |
| 7825 | -c "found use_srtp extension" \ |
| 7826 | -c "found srtp profile" \ |
| 7827 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7828 | -c "DTLS-SRTP key material is"\ |
| 7829 | -C "error" |
| 7830 | |
| 7831 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7832 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7833 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7834 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7835 | 0 \ |
| 7836 | -c "client hello, adding use_srtp extension" \ |
| 7837 | -c "found use_srtp extension" \ |
| 7838 | -c "found srtp profile" \ |
| 7839 | -c "selected srtp profile" \ |
| 7840 | -c "DTLS-SRTP key material is"\ |
| 7841 | -C "error" |
| 7842 | |
| 7843 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7844 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7845 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7846 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7847 | 0 \ |
| 7848 | -c "client hello, adding use_srtp extension" \ |
| 7849 | -c "found use_srtp extension" \ |
| 7850 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7851 | -c "selected srtp profile" \ |
| 7852 | -c "DTLS-SRTP key material is"\ |
| 7853 | -C "error" |
| 7854 | |
| 7855 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7856 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7857 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7858 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7859 | 0 \ |
| 7860 | -c "client hello, adding use_srtp extension" \ |
| 7861 | -c "found use_srtp extension" \ |
| 7862 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7863 | -c "selected srtp profile" \ |
| 7864 | -c "DTLS-SRTP key material is"\ |
| 7865 | -C "error" |
| 7866 | |
| 7867 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7868 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7869 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7870 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7871 | 0 \ |
| 7872 | -c "client hello, adding use_srtp extension" \ |
| 7873 | -c "found use_srtp extension" \ |
| 7874 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7875 | -c "selected srtp profile" \ |
| 7876 | -c "DTLS-SRTP key material is"\ |
| 7877 | -C "error" |
| 7878 | |
| 7879 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7880 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 7881 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7882 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 7883 | 0 \ |
| 7884 | -c "client hello, adding use_srtp extension" \ |
| 7885 | -C "found use_srtp extension" \ |
| 7886 | -C "found srtp profile" \ |
| 7887 | -C "selected srtp profile" \ |
| 7888 | -C "DTLS-SRTP key material is"\ |
| 7889 | -C "error" |
| 7890 | |
| 7891 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7892 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 7893 | "$O_SRV -dtls" \ |
| 7894 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7895 | 0 \ |
| 7896 | -c "client hello, adding use_srtp extension" \ |
| 7897 | -C "found use_srtp extension" \ |
| 7898 | -C "found srtp profile" \ |
| 7899 | -C "selected srtp profile" \ |
| 7900 | -C "DTLS-SRTP key material is"\ |
| 7901 | -C "error" |
| 7902 | |
| 7903 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7904 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 7905 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7906 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7907 | 0 \ |
| 7908 | -c "client hello, adding use_srtp extension" \ |
| 7909 | -c "found use_srtp extension" \ |
| 7910 | -c "found srtp profile" \ |
| 7911 | -c "selected srtp profile" \ |
| 7912 | -c "DTLS-SRTP key material is"\ |
| 7913 | -c "DTLS-SRTP no mki value negotiated"\ |
| 7914 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7915 | -C "dumping 'received mki' (8 bytes)" \ |
| 7916 | -C "error" |
| 7917 | |
| 7918 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7919 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7920 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7921 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7922 | "$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] | 7923 | 0 \ |
| 7924 | -s "found use_srtp extension" \ |
| 7925 | -s "found srtp profile" \ |
| 7926 | -s "selected srtp profile" \ |
| 7927 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7928 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7929 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 7930 | |
| 7931 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7932 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7933 | 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] | 7934 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7935 | "$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] | 7936 | 0 \ |
| 7937 | -s "found use_srtp extension" \ |
| 7938 | -s "found srtp profile" \ |
| 7939 | -s "selected srtp profile" \ |
| 7940 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7941 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7942 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 7943 | |
| 7944 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7945 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7946 | 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] | 7947 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7948 | "$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] | 7949 | 0 \ |
| 7950 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7951 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7952 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7953 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7954 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7955 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7956 | |
| 7957 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7958 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7959 | 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] | 7960 | "$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] | 7961 | "$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] | 7962 | 0 \ |
| 7963 | -s "found use_srtp extension" \ |
| 7964 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7965 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7966 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7967 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7968 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 7969 | |
| 7970 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7971 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7972 | 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] | 7973 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7974 | "$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] | 7975 | 0 \ |
| 7976 | -s "found use_srtp extension" \ |
| 7977 | -s "found srtp profile" \ |
| 7978 | -s "selected srtp profile" \ |
| 7979 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7980 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7981 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7982 | |
| 7983 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7984 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7985 | 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] | 7986 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7987 | "$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] | 7988 | 0 \ |
| 7989 | -s "found use_srtp extension" \ |
| 7990 | -s "found srtp profile" \ |
| 7991 | -S "selected srtp profile" \ |
| 7992 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7993 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7994 | -C "SRTP profile:" |
| 7995 | |
| 7996 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7997 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7998 | 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] | 7999 | "$P_SRV dtls=1 debug_level=3" \ |
| 8000 | "$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] | 8001 | 0 \ |
| 8002 | -s "found use_srtp extension" \ |
| 8003 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8004 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8005 | -C "SRTP profile:" |
| 8006 | |
| 8007 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8008 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8009 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8010 | "$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" \ |
| 8011 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8012 | 0 \ |
| 8013 | -c "client hello, adding use_srtp extension" \ |
| 8014 | -c "found use_srtp extension" \ |
| 8015 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8016 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8017 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8018 | -C "error" |
| 8019 | |
| 8020 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8021 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8022 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8023 | "$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" \ |
| 8024 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8025 | 0 \ |
| 8026 | -c "client hello, adding use_srtp extension" \ |
| 8027 | -c "found use_srtp extension" \ |
| 8028 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8029 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8030 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8031 | -C "error" |
| 8032 | |
| 8033 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8034 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8035 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8036 | "$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" \ |
| 8037 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8038 | 0 \ |
| 8039 | -c "client hello, adding use_srtp extension" \ |
| 8040 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8041 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8042 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8043 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8044 | -C "error" |
| 8045 | |
| 8046 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8047 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8048 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8049 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8050 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8051 | 0 \ |
| 8052 | -c "client hello, adding use_srtp extension" \ |
| 8053 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8054 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8055 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8056 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8057 | -C "error" |
| 8058 | |
| 8059 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8060 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8061 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8062 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8063 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8064 | 0 \ |
| 8065 | -c "client hello, adding use_srtp extension" \ |
| 8066 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8067 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8068 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8069 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8070 | -C "error" |
| 8071 | |
| 8072 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8073 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8074 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8075 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8076 | "$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] | 8077 | 0 \ |
| 8078 | -c "client hello, adding use_srtp extension" \ |
| 8079 | -C "found use_srtp extension" \ |
| 8080 | -C "found srtp profile" \ |
| 8081 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8082 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8083 | -C "error" |
| 8084 | |
| 8085 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8086 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8087 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8088 | "$G_SRV -u" \ |
| 8089 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8090 | 0 \ |
| 8091 | -c "client hello, adding use_srtp extension" \ |
| 8092 | -C "found use_srtp extension" \ |
| 8093 | -C "found srtp profile" \ |
| 8094 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8095 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8096 | -C "error" |
| 8097 | |
| 8098 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8099 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8100 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8101 | "$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" \ |
| 8102 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8103 | 0 \ |
| 8104 | -c "client hello, adding use_srtp extension" \ |
| 8105 | -c "found use_srtp extension" \ |
| 8106 | -c "found srtp profile" \ |
| 8107 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8108 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8109 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8110 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8111 | -c "dumping 'received mki' (8 bytes)" \ |
| 8112 | -C "error" |
| 8113 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8114 | # Tests for specific things with "unreliable" UDP connection |
| 8115 | |
| 8116 | not_with_valgrind # spurious resend due to timeout |
| 8117 | run_test "DTLS proxy: reference" \ |
| 8118 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8119 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8120 | "$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] | 8121 | 0 \ |
| 8122 | -C "replayed record" \ |
| 8123 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8124 | -C "Buffer record from epoch" \ |
| 8125 | -S "Buffer record from epoch" \ |
| 8126 | -C "ssl_buffer_message" \ |
| 8127 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8128 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8129 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8130 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8131 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8132 | -c "HTTP/1.0 200 OK" |
| 8133 | |
| 8134 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8135 | run_test "DTLS proxy: duplicate every packet" \ |
| 8136 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8137 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8138 | "$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] | 8139 | 0 \ |
| 8140 | -c "replayed record" \ |
| 8141 | -s "replayed record" \ |
| 8142 | -c "record from another epoch" \ |
| 8143 | -s "record from another epoch" \ |
| 8144 | -S "resend" \ |
| 8145 | -s "Extra-header:" \ |
| 8146 | -c "HTTP/1.0 200 OK" |
| 8147 | |
| 8148 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8149 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8150 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8151 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8152 | 0 \ |
| 8153 | -c "replayed record" \ |
| 8154 | -S "replayed record" \ |
| 8155 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8156 | -s "record from another epoch" \ |
| 8157 | -c "resend" \ |
| 8158 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8159 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8160 | -c "HTTP/1.0 200 OK" |
| 8161 | |
| 8162 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8163 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8164 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8165 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8166 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8167 | -c "next record in same datagram" \ |
| 8168 | -s "next record in same datagram" |
| 8169 | |
| 8170 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8171 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8172 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8173 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8174 | 0 \ |
| 8175 | -c "next record in same datagram" \ |
| 8176 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8177 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8178 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8179 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8180 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8181 | "$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] | 8182 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8183 | -c "discarding invalid record (mac)" \ |
| 8184 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8185 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8186 | -c "HTTP/1.0 200 OK" \ |
| 8187 | -S "too many records with bad MAC" \ |
| 8188 | -S "Verification of the message MAC failed" |
| 8189 | |
| 8190 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8191 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8192 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8193 | "$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] | 8194 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8195 | -C "discarding invalid record (mac)" \ |
| 8196 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8197 | -S "Extra-header:" \ |
| 8198 | -C "HTTP/1.0 200 OK" \ |
| 8199 | -s "too many records with bad MAC" \ |
| 8200 | -s "Verification of the message MAC failed" |
| 8201 | |
| 8202 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8203 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8204 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8205 | "$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] | 8206 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8207 | -c "discarding invalid record (mac)" \ |
| 8208 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8209 | -s "Extra-header:" \ |
| 8210 | -c "HTTP/1.0 200 OK" \ |
| 8211 | -S "too many records with bad MAC" \ |
| 8212 | -S "Verification of the message MAC failed" |
| 8213 | |
| 8214 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8215 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8216 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8217 | "$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] | 8218 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8219 | -c "discarding invalid record (mac)" \ |
| 8220 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8221 | -s "Extra-header:" \ |
| 8222 | -c "HTTP/1.0 200 OK" \ |
| 8223 | -s "too many records with bad MAC" \ |
| 8224 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8225 | |
| 8226 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8227 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8228 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8229 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8230 | 0 \ |
| 8231 | -c "record from another epoch" \ |
| 8232 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8233 | -s "Extra-header:" \ |
| 8234 | -c "HTTP/1.0 200 OK" |
| 8235 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8236 | # Tests for reordering support with DTLS |
| 8237 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8238 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8239 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8240 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8241 | hs_timeout=2500-60000" \ |
| 8242 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8243 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8244 | 0 \ |
| 8245 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8246 | -c "Next handshake message has been buffered - load"\ |
| 8247 | -S "Buffering HS message" \ |
| 8248 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8249 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8250 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8251 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8252 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8253 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8254 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8255 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8256 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8257 | hs_timeout=2500-60000" \ |
| 8258 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8259 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8260 | 0 \ |
| 8261 | -c "Buffering HS message" \ |
| 8262 | -c "found fragmented DTLS handshake message"\ |
| 8263 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8264 | -c "Next handshake message has been buffered - load"\ |
| 8265 | -S "Buffering HS message" \ |
| 8266 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8267 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8268 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8269 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8270 | -S "Remember CCS message" |
| 8271 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8272 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8273 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8274 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8275 | # while keeping the ServerKeyExchange. |
| 8276 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8277 | 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] | 8278 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8279 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8280 | hs_timeout=2500-60000" \ |
| 8281 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8282 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8283 | 0 \ |
| 8284 | -c "Buffering HS message" \ |
| 8285 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8286 | -C "attempt to make space by freeing buffered messages" \ |
| 8287 | -S "Buffering HS message" \ |
| 8288 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8289 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8290 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8291 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8292 | -S "Remember CCS message" |
| 8293 | |
| 8294 | # The size constraints ensure that the delayed certificate message can't |
| 8295 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8296 | # when dropping it first. |
| 8297 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8298 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8299 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8300 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8301 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8302 | hs_timeout=2500-60000" \ |
| 8303 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8304 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8305 | 0 \ |
| 8306 | -c "Buffering HS message" \ |
| 8307 | -c "attempt to make space by freeing buffered future messages" \ |
| 8308 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8309 | -S "Buffering HS message" \ |
| 8310 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8311 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8312 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8313 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8314 | -S "Remember CCS message" |
| 8315 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8316 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8317 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8318 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8319 | hs_timeout=2500-60000" \ |
| 8320 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8321 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8322 | 0 \ |
| 8323 | -C "Buffering HS message" \ |
| 8324 | -C "Next handshake message has been buffered - load"\ |
| 8325 | -s "Buffering HS message" \ |
| 8326 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8327 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8328 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8329 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8330 | -S "Remember CCS message" |
| 8331 | |
| 8332 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8333 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8334 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8335 | hs_timeout=2500-60000" \ |
| 8336 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8337 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8338 | 0 \ |
| 8339 | -C "Buffering HS message" \ |
| 8340 | -C "Next handshake message has been buffered - load"\ |
| 8341 | -S "Buffering HS message" \ |
| 8342 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8343 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8344 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8345 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8346 | -S "Remember CCS message" |
| 8347 | |
| 8348 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8349 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8350 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8351 | hs_timeout=2500-60000" \ |
| 8352 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8353 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8354 | 0 \ |
| 8355 | -C "Buffering HS message" \ |
| 8356 | -C "Next handshake message has been buffered - load"\ |
| 8357 | -S "Buffering HS message" \ |
| 8358 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8359 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8360 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8361 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8362 | -s "Remember CCS message" |
| 8363 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8364 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8365 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8366 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8367 | hs_timeout=2500-60000" \ |
| 8368 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8369 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8370 | 0 \ |
| 8371 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8372 | -s "Found buffered record from current epoch - load" \ |
| 8373 | -c "Buffer record from epoch 1" \ |
| 8374 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8375 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8376 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8377 | # from the server are delayed, so that the encrypted Finished message |
| 8378 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8379 | # in afterwards, the encrypted Finished message must be freed in order |
| 8380 | # to make space for the NewSessionTicket to be reassembled. |
| 8381 | # This works only in very particular circumstances: |
| 8382 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8383 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8384 | # the encrypted Finished message. |
| 8385 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8386 | # needs to be fragmented. |
| 8387 | # - All messages sent by the server must be small enough to be either sent |
| 8388 | # without fragmentation or be reassembled within the bounds of |
| 8389 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8390 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8391 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8392 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8393 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8394 | -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] | 8395 | "$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] | 8396 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8397 | 0 \ |
| 8398 | -s "Buffer record from epoch 1" \ |
| 8399 | -s "Found buffered record from current epoch - load" \ |
| 8400 | -c "Buffer record from epoch 1" \ |
| 8401 | -C "Found buffered record from current epoch - load" \ |
| 8402 | -c "Enough space available after freeing future epoch record" |
| 8403 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8404 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8405 | |
| 8406 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8407 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8408 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8409 | "$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] | 8410 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8411 | "$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] | 8412 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8413 | 0 \ |
| 8414 | -s "Extra-header:" \ |
| 8415 | -c "HTTP/1.0 200 OK" |
| 8416 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8417 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8418 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8419 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8420 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8421 | "$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] | 8422 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8423 | 0 \ |
| 8424 | -s "Extra-header:" \ |
| 8425 | -c "HTTP/1.0 200 OK" |
| 8426 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8427 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8428 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8429 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8430 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8431 | "$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] | 8432 | 0 \ |
| 8433 | -s "Extra-header:" \ |
| 8434 | -c "HTTP/1.0 200 OK" |
| 8435 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8436 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8437 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8438 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8439 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8440 | "$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] | 8441 | 0 \ |
| 8442 | -s "Extra-header:" \ |
| 8443 | -c "HTTP/1.0 200 OK" |
| 8444 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8445 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8446 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8447 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8448 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8449 | "$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] | 8450 | 0 \ |
| 8451 | -s "Extra-header:" \ |
| 8452 | -c "HTTP/1.0 200 OK" |
| 8453 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8454 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8455 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8456 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8457 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8458 | "$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] | 8459 | 0 \ |
| 8460 | -s "Extra-header:" \ |
| 8461 | -c "HTTP/1.0 200 OK" |
| 8462 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8463 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8464 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8465 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8466 | "$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] | 8467 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8468 | "$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] | 8469 | 0 \ |
| 8470 | -s "Extra-header:" \ |
| 8471 | -c "HTTP/1.0 200 OK" |
| 8472 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8473 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8474 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8475 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8476 | "$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] | 8477 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8478 | "$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] | 8479 | 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] | 8480 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8481 | 0 \ |
| 8482 | -s "a session has been resumed" \ |
| 8483 | -c "a session has been resumed" \ |
| 8484 | -s "Extra-header:" \ |
| 8485 | -c "HTTP/1.0 200 OK" |
| 8486 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8487 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8488 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8489 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8490 | "$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] | 8491 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8492 | "$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] | 8493 | 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] | 8494 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8495 | 0 \ |
| 8496 | -s "a session has been resumed" \ |
| 8497 | -c "a session has been resumed" \ |
| 8498 | -s "Extra-header:" \ |
| 8499 | -c "HTTP/1.0 200 OK" |
| 8500 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8501 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8502 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8503 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8504 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8505 | "$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] | 8506 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8507 | "$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] | 8508 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8509 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8510 | 0 \ |
| 8511 | -c "=> renegotiate" \ |
| 8512 | -s "=> renegotiate" \ |
| 8513 | -s "Extra-header:" \ |
| 8514 | -c "HTTP/1.0 200 OK" |
| 8515 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8516 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8517 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8518 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8519 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8520 | "$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] | 8521 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8522 | "$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] | 8523 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8524 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8525 | 0 \ |
| 8526 | -c "=> renegotiate" \ |
| 8527 | -s "=> renegotiate" \ |
| 8528 | -s "Extra-header:" \ |
| 8529 | -c "HTTP/1.0 200 OK" |
| 8530 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8531 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8532 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8533 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8534 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8535 | "$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] | 8536 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8537 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8538 | "$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] | 8539 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8540 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8541 | 0 \ |
| 8542 | -c "=> renegotiate" \ |
| 8543 | -s "=> renegotiate" \ |
| 8544 | -s "Extra-header:" \ |
| 8545 | -c "HTTP/1.0 200 OK" |
| 8546 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8547 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8548 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8549 | 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] | 8550 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8551 | "$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] | 8552 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8553 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8554 | "$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] | 8555 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8556 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8557 | 0 \ |
| 8558 | -c "=> renegotiate" \ |
| 8559 | -s "=> renegotiate" \ |
| 8560 | -s "Extra-header:" \ |
| 8561 | -c "HTTP/1.0 200 OK" |
| 8562 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8563 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8564 | ## all versions installed on the CI machines), reported here: |
| 8565 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8566 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8567 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8568 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8569 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8570 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8571 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8572 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8573 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8574 | "$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] | 8575 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8576 | -c "HTTP/1.0 200 OK" |
| 8577 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8578 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8579 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8580 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8581 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8582 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8583 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8584 | "$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] | 8585 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8586 | -c "HTTP/1.0 200 OK" |
| 8587 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8588 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8589 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8590 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8591 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8592 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8593 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8594 | "$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] | 8595 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8596 | -c "HTTP/1.0 200 OK" |
| 8597 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8598 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8599 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8600 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8601 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8602 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8603 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8604 | "$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] | 8605 | 0 \ |
| 8606 | -s "Extra-header:" \ |
| 8607 | -c "Extra-header:" |
| 8608 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8609 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8610 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8611 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8612 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8613 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8614 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8615 | "$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] | 8616 | 0 \ |
| 8617 | -s "Extra-header:" \ |
| 8618 | -c "Extra-header:" |
| 8619 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8620 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8621 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8622 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8623 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8624 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8625 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8626 | "$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] | 8627 | 0 \ |
| 8628 | -s "Extra-header:" \ |
| 8629 | -c "Extra-header:" |
| 8630 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8631 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8632 | run_test "export keys functionality" \ |
| 8633 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8634 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8635 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8636 | -c "EAP-TLS key material is:"\ |
| 8637 | -s "EAP-TLS key material is:"\ |
| 8638 | -c "EAP-TLS IV is:" \ |
| 8639 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8640 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8641 | # openssl feature tests: check if tls1.3 exists. |
| 8642 | requires_openssl_tls1_3 |
| 8643 | run_test "TLS1.3: Test openssl tls1_3 feature" \ |
| 8644 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 8645 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 8646 | 0 \ |
| 8647 | -c "TLS 1.3" \ |
| 8648 | -s "TLS 1.3" |
| 8649 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 8650 | # gnutls feature tests: check if TLS 1.3 is supported as well as the NO_TICKETS and DISABLE_TLS13_COMPAT_MODE options. |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8651 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8652 | requires_gnutls_next_no_ticket |
| 8653 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8654 | run_test "TLS1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8655 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 8656 | "$G_NEXT_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE -V" \ |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8657 | 0 \ |
| 8658 | -s "Version: TLS1.3" \ |
| 8659 | -c "Version: TLS1.3" |
| 8660 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8661 | # TLS1.3 test cases |
| 8662 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 8663 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8664 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8665 | skip_handshake_stage_check |
| 8666 | run_test "TLS1.3: Not supported version check: tls1_2 and tls1_3" \ |
| 8667 | "$P_SRV debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8668 | "$P_CLI debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8669 | 1 \ |
| 8670 | -s "SSL - The requested feature is not available" \ |
| 8671 | -c "SSL - The requested feature is not available" \ |
| 8672 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 8673 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 8674 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8675 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8676 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8677 | run_test "TLS1.3: handshake dispatch test: tls1_3 only" \ |
Jerry Yu | 3523a3b | 2021-09-14 16:29:49 +0800 | [diff] [blame] | 8678 | "$P_SRV debug_level=2 min_version=tls1_3 max_version=tls1_3" \ |
| 8679 | "$P_CLI debug_level=2 min_version=tls1_3 max_version=tls1_3" \ |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8680 | 1 \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8681 | -s "tls1_3 server state: 0" \ |
| 8682 | -c "tls1_3 client state: 0" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8683 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8684 | requires_openssl_tls1_3 |
| 8685 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8686 | run_test "TLS1.3: Test client hello msg work - openssl" \ |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8687 | "$O_NEXT_SRV -tls1_3 -msg" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8688 | "$P_CLI debug_level=2 min_version=tls1_3 max_version=tls1_3" \ |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8689 | 1 \ |
| 8690 | -c "SSL - The requested feature is not available" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8691 | -s "ServerHello" \ |
| 8692 | -c "tls1_3 client state: 0" \ |
| 8693 | -c "tls1_3 client state: 2" \ |
| 8694 | -c "tls1_3 client state: 19" \ |
| 8695 | -c "tls1_3 client state: 5" \ |
| 8696 | -c "tls1_3 client state: 3" \ |
| 8697 | -c "tls1_3 client state: 9" \ |
| 8698 | -c "tls1_3 client state: 13" \ |
| 8699 | -c "tls1_3 client state: 7" \ |
| 8700 | -c "tls1_3 client state: 20" \ |
| 8701 | -c "tls1_3 client state: 11" \ |
| 8702 | -c "tls1_3 client state: 14" \ |
| 8703 | -c "tls1_3 client state: 15" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8704 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8705 | requires_gnutls_tls1_3 |
| 8706 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8707 | run_test "TLS1.3: Test client hello msg work - gnutls" \ |
| 8708 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --debug=4" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8709 | "$P_CLI debug_level=2 min_version=tls1_3 max_version=tls1_3" \ |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8710 | 1 \ |
| 8711 | -c "SSL - The requested feature is not available" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8712 | -s "SERVER HELLO was queued" \ |
| 8713 | -c "tls1_3 client state: 0" \ |
| 8714 | -c "tls1_3 client state: 2" \ |
| 8715 | -c "tls1_3 client state: 19" \ |
| 8716 | -c "tls1_3 client state: 5" \ |
| 8717 | -c "tls1_3 client state: 3" \ |
| 8718 | -c "tls1_3 client state: 9" \ |
| 8719 | -c "tls1_3 client state: 13" \ |
| 8720 | -c "tls1_3 client state: 7" \ |
| 8721 | -c "tls1_3 client state: 20" \ |
| 8722 | -c "tls1_3 client state: 11" \ |
| 8723 | -c "tls1_3 client state: 14" \ |
| 8724 | -c "tls1_3 client state: 15" |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8725 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8726 | # Test heap memory usage after handshake |
| 8727 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8728 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8729 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8730 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8731 | run_tests_memory_after_hanshake |
| 8732 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8733 | # Final report |
| 8734 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8735 | echo "------------------------------------------------------------------------" |
| 8736 | |
| 8737 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8738 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8739 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8740 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8741 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8742 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8743 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8744 | |
| 8745 | exit $FAILS |