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 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1447 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1448 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1449 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1450 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1451 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1452 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1453 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1454 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1455 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1456 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1457 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1458 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1459 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1460 | run_test_psa_force_curve "secp521r1" |
| 1461 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1462 | run_test_psa_force_curve "brainpoolP512r1" |
| 1463 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1464 | run_test_psa_force_curve "secp384r1" |
| 1465 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1466 | run_test_psa_force_curve "brainpoolP384r1" |
| 1467 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1468 | run_test_psa_force_curve "secp256r1" |
| 1469 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1470 | run_test_psa_force_curve "secp256k1" |
| 1471 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1472 | run_test_psa_force_curve "brainpoolP256r1" |
| 1473 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1474 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1475 | ## SECP224K1 is buggy via the PSA API |
| 1476 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1477 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1478 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1479 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1480 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1481 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1482 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1483 | run_test_psa_force_curve "secp192r1" |
| 1484 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1485 | run_test_psa_force_curve "secp192k1" |
| 1486 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1487 | # Test current time in ServerHello |
| 1488 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1489 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1490 | "$P_SRV debug_level=3" \ |
| 1491 | "$P_CLI debug_level=3" \ |
| 1492 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1493 | -f "check_server_hello_time" \ |
| 1494 | -F "check_server_hello_time" |
| 1495 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1496 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1497 | run_test "Unique IV in GCM" \ |
| 1498 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1499 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1500 | 0 \ |
| 1501 | -u "IV used" \ |
| 1502 | -U "IV used" |
| 1503 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1504 | # Tests for certificate verification callback |
| 1505 | run_test "Configuration-specific CRT verification callback" \ |
| 1506 | "$P_SRV debug_level=3" \ |
| 1507 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1508 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1509 | -S "error" \ |
| 1510 | -c "Verify requested for " \ |
| 1511 | -c "Use configuration-specific verification callback" \ |
| 1512 | -C "Use context-specific verification callback" \ |
| 1513 | -C "error" |
| 1514 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1515 | run_test "Context-specific CRT verification callback" \ |
| 1516 | "$P_SRV debug_level=3" \ |
| 1517 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1518 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1519 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1520 | -c "Verify requested for " \ |
| 1521 | -c "Use context-specific verification callback" \ |
| 1522 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1523 | -C "error" |
| 1524 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1525 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1526 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1527 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1528 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1529 | 1 \ |
| 1530 | -c "The certificate is signed with an unacceptable hash" |
| 1531 | |
| 1532 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1533 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1534 | "$P_CLI allow_sha1=1" \ |
| 1535 | 0 |
| 1536 | |
| 1537 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1538 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1539 | "$P_CLI allow_sha1=0" \ |
| 1540 | 0 |
| 1541 | |
| 1542 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1543 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1544 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1545 | 1 \ |
| 1546 | -s "The certificate is signed with an unacceptable hash" |
| 1547 | |
| 1548 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1549 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1550 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1551 | 0 |
| 1552 | |
| 1553 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1554 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1555 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1556 | 0 |
| 1557 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1558 | # Dummy TLS 1.3 test |
| 1559 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1560 | # ssl_client2/ssl_server2 example programs works. |
| 1561 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1562 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1563 | "$P_SRV tls13_kex_modes=psk" \ |
| 1564 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1565 | 0 |
| 1566 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1567 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1568 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1569 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1570 | 0 |
| 1571 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1572 | 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] | 1573 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1574 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1575 | 0 |
| 1576 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1577 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1578 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1579 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1580 | 0 |
| 1581 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1582 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1583 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1584 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1585 | 0 |
| 1586 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1587 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1588 | "$P_SRV tls13_kex_modes=all" \ |
| 1589 | "$P_CLI tls13_kex_modes=all" \ |
| 1590 | 0 |
| 1591 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1592 | # Tests for datagram packing |
| 1593 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1594 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1595 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1596 | 0 \ |
| 1597 | -c "next record in same datagram" \ |
| 1598 | -s "next record in same datagram" |
| 1599 | |
| 1600 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1601 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1602 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1603 | 0 \ |
| 1604 | -s "next record in same datagram" \ |
| 1605 | -C "next record in same datagram" |
| 1606 | |
| 1607 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1608 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1609 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1610 | 0 \ |
| 1611 | -S "next record in same datagram" \ |
| 1612 | -c "next record in same datagram" |
| 1613 | |
| 1614 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1615 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1616 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1617 | 0 \ |
| 1618 | -S "next record in same datagram" \ |
| 1619 | -C "next record in same datagram" |
| 1620 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1621 | # Tests for Context serialization |
| 1622 | |
| 1623 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1624 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1625 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1626 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1627 | 0 \ |
| 1628 | -c "Deserializing connection..." \ |
| 1629 | -S "Deserializing connection..." |
| 1630 | |
| 1631 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1632 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1633 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1634 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1635 | 0 \ |
| 1636 | -c "Deserializing connection..." \ |
| 1637 | -S "Deserializing connection..." |
| 1638 | |
| 1639 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1640 | run_test "Context serialization, client serializes, GCM" \ |
| 1641 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1642 | "$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] | 1643 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1644 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1645 | -S "Deserializing connection..." |
| 1646 | |
| 1647 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1648 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1649 | run_test "Context serialization, client serializes, with CID" \ |
| 1650 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1651 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1652 | 0 \ |
| 1653 | -c "Deserializing connection..." \ |
| 1654 | -S "Deserializing connection..." |
| 1655 | |
| 1656 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1657 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1658 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1659 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1660 | 0 \ |
| 1661 | -C "Deserializing connection..." \ |
| 1662 | -s "Deserializing connection..." |
| 1663 | |
| 1664 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1665 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1666 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1667 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1668 | 0 \ |
| 1669 | -C "Deserializing connection..." \ |
| 1670 | -s "Deserializing connection..." |
| 1671 | |
| 1672 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1673 | run_test "Context serialization, server serializes, GCM" \ |
| 1674 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1675 | "$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] | 1676 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1677 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1678 | -s "Deserializing connection..." |
| 1679 | |
| 1680 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1681 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1682 | run_test "Context serialization, server serializes, with CID" \ |
| 1683 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1684 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1685 | 0 \ |
| 1686 | -C "Deserializing connection..." \ |
| 1687 | -s "Deserializing connection..." |
| 1688 | |
| 1689 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1690 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1691 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1692 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1693 | 0 \ |
| 1694 | -c "Deserializing connection..." \ |
| 1695 | -s "Deserializing connection..." |
| 1696 | |
| 1697 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1698 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1699 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1700 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1701 | 0 \ |
| 1702 | -c "Deserializing connection..." \ |
| 1703 | -s "Deserializing connection..." |
| 1704 | |
| 1705 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1706 | run_test "Context serialization, both serialize, GCM" \ |
| 1707 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1708 | "$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] | 1709 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1710 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1711 | -s "Deserializing connection..." |
| 1712 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1713 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1714 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1715 | run_test "Context serialization, both serialize, with CID" \ |
| 1716 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1717 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1718 | 0 \ |
| 1719 | -c "Deserializing connection..." \ |
| 1720 | -s "Deserializing connection..." |
| 1721 | |
| 1722 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1723 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1724 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1725 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1726 | 0 \ |
| 1727 | -c "Deserializing connection..." \ |
| 1728 | -S "Deserializing connection..." |
| 1729 | |
| 1730 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1731 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1732 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1733 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1734 | 0 \ |
| 1735 | -c "Deserializing connection..." \ |
| 1736 | -S "Deserializing connection..." |
| 1737 | |
| 1738 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1739 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1740 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1741 | "$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] | 1742 | 0 \ |
| 1743 | -c "Deserializing connection..." \ |
| 1744 | -S "Deserializing connection..." |
| 1745 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1746 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1747 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1748 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1749 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1750 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1751 | 0 \ |
| 1752 | -c "Deserializing connection..." \ |
| 1753 | -S "Deserializing connection..." |
| 1754 | |
| 1755 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1756 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1757 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1758 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1759 | 0 \ |
| 1760 | -C "Deserializing connection..." \ |
| 1761 | -s "Deserializing connection..." |
| 1762 | |
| 1763 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1764 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1765 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1766 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1767 | 0 \ |
| 1768 | -C "Deserializing connection..." \ |
| 1769 | -s "Deserializing connection..." |
| 1770 | |
| 1771 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1772 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1773 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1774 | "$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] | 1775 | 0 \ |
| 1776 | -C "Deserializing connection..." \ |
| 1777 | -s "Deserializing connection..." |
| 1778 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1779 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1780 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1781 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1782 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1783 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1784 | 0 \ |
| 1785 | -C "Deserializing connection..." \ |
| 1786 | -s "Deserializing connection..." |
| 1787 | |
| 1788 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1789 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1790 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1791 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1792 | 0 \ |
| 1793 | -c "Deserializing connection..." \ |
| 1794 | -s "Deserializing connection..." |
| 1795 | |
| 1796 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1797 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1798 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1799 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1800 | 0 \ |
| 1801 | -c "Deserializing connection..." \ |
| 1802 | -s "Deserializing connection..." |
| 1803 | |
| 1804 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1805 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1806 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1807 | "$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] | 1808 | 0 \ |
| 1809 | -c "Deserializing connection..." \ |
| 1810 | -s "Deserializing connection..." |
| 1811 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1812 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1813 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1814 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1815 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1816 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1817 | 0 \ |
| 1818 | -c "Deserializing connection..." \ |
| 1819 | -s "Deserializing connection..." |
| 1820 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1821 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1822 | run_test "Saving the serialized context to a file" \ |
| 1823 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1824 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1825 | 0 \ |
| 1826 | -s "Save serialized context to a file... ok" \ |
| 1827 | -c "Save serialized context to a file... ok" |
| 1828 | rm -f context_srv.txt |
| 1829 | rm -f context_cli.txt |
| 1830 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1831 | # Tests for DTLS Connection ID extension |
| 1832 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1833 | # So far, the CID API isn't implemented, so we can't |
| 1834 | # grep for output witnessing its use. This needs to be |
| 1835 | # changed once the CID extension is implemented. |
| 1836 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1837 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1838 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1839 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1840 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1841 | 0 \ |
| 1842 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1843 | -s "found CID extension" \ |
| 1844 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1845 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1846 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1847 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1848 | -C "found CID extension" \ |
| 1849 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1850 | -C "Copy CIDs into SSL transform" \ |
| 1851 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1852 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1853 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1854 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1855 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1856 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1857 | 0 \ |
| 1858 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1859 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1860 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1861 | -s "Enable use of 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" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1866 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1867 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1868 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1869 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1870 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1871 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1872 | 0 \ |
| 1873 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1874 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1875 | -c "client hello, adding CID extension" \ |
| 1876 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1877 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1878 | -s "server hello, adding CID extension" \ |
| 1879 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1880 | -c "Use of CID extension negotiated" \ |
| 1881 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1882 | -c "Copy CIDs into SSL transform" \ |
| 1883 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1884 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1885 | -s "Use of Connection ID has been negotiated" \ |
| 1886 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1887 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1888 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1889 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1890 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1891 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1892 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1893 | 0 \ |
| 1894 | -c "Enable use of CID extension." \ |
| 1895 | -s "Enable use of CID extension." \ |
| 1896 | -c "client hello, adding CID extension" \ |
| 1897 | -s "found CID extension" \ |
| 1898 | -s "Use of CID extension negotiated" \ |
| 1899 | -s "server hello, adding CID extension" \ |
| 1900 | -c "found CID extension" \ |
| 1901 | -c "Use of CID extension negotiated" \ |
| 1902 | -s "Copy CIDs into SSL transform" \ |
| 1903 | -c "Copy CIDs into SSL transform" \ |
| 1904 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1905 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1906 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1907 | -c "Use of Connection ID has been negotiated" \ |
| 1908 | -c "ignoring unexpected CID" \ |
| 1909 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1910 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1911 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1912 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1913 | -p "$P_PXY mtu=800" \ |
| 1914 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1915 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1916 | 0 \ |
| 1917 | -c "Enable use of CID extension." \ |
| 1918 | -s "Enable use of CID extension." \ |
| 1919 | -c "client hello, adding CID extension" \ |
| 1920 | -s "found CID extension" \ |
| 1921 | -s "Use of CID extension negotiated" \ |
| 1922 | -s "server hello, adding CID extension" \ |
| 1923 | -c "found CID extension" \ |
| 1924 | -c "Use of CID extension negotiated" \ |
| 1925 | -s "Copy CIDs into SSL transform" \ |
| 1926 | -c "Copy CIDs into SSL transform" \ |
| 1927 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1928 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1929 | -s "Use of Connection ID has been negotiated" \ |
| 1930 | -c "Use of Connection ID has been negotiated" |
| 1931 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1932 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1933 | 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] | 1934 | -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] | 1935 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1936 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1937 | 0 \ |
| 1938 | -c "Enable use of CID extension." \ |
| 1939 | -s "Enable use of CID extension." \ |
| 1940 | -c "client hello, adding CID extension" \ |
| 1941 | -s "found CID extension" \ |
| 1942 | -s "Use of CID extension negotiated" \ |
| 1943 | -s "server hello, adding CID extension" \ |
| 1944 | -c "found CID extension" \ |
| 1945 | -c "Use of CID extension negotiated" \ |
| 1946 | -s "Copy CIDs into SSL transform" \ |
| 1947 | -c "Copy CIDs into SSL transform" \ |
| 1948 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1949 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1950 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1951 | -c "Use of Connection ID has been negotiated" \ |
| 1952 | -c "ignoring unexpected CID" \ |
| 1953 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1954 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1955 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1956 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1957 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1958 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1959 | 0 \ |
| 1960 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1961 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1962 | -c "client hello, adding CID extension" \ |
| 1963 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1964 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1965 | -s "server hello, adding CID extension" \ |
| 1966 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1967 | -c "Use of CID extension negotiated" \ |
| 1968 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1969 | -c "Copy CIDs into SSL transform" \ |
| 1970 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1971 | -s "Peer CID (length 0 Bytes):" \ |
| 1972 | -s "Use of Connection ID has been negotiated" \ |
| 1973 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1974 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1975 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1976 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1977 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1978 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1979 | 0 \ |
| 1980 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1981 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1982 | -c "client hello, adding CID extension" \ |
| 1983 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1984 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1985 | -s "server hello, adding CID extension" \ |
| 1986 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1987 | -c "Use of CID extension negotiated" \ |
| 1988 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1989 | -c "Copy CIDs into SSL transform" \ |
| 1990 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 1991 | -c "Peer CID (length 0 Bytes):" \ |
| 1992 | -s "Use of Connection ID has been negotiated" \ |
| 1993 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1994 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1995 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1996 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1997 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 1998 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 1999 | 0 \ |
| 2000 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2001 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2002 | -c "client hello, adding CID extension" \ |
| 2003 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2004 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2005 | -s "server hello, adding CID extension" \ |
| 2006 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2007 | -c "Use of CID extension negotiated" \ |
| 2008 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2009 | -c "Copy CIDs into SSL transform" \ |
| 2010 | -S "Use of Connection ID has been negotiated" \ |
| 2011 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2012 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2013 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2014 | 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] | 2015 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2016 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2017 | 0 \ |
| 2018 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2019 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2020 | -c "client hello, adding CID extension" \ |
| 2021 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2022 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2023 | -s "server hello, adding CID extension" \ |
| 2024 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2025 | -c "Use of CID extension negotiated" \ |
| 2026 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2027 | -c "Copy CIDs into SSL transform" \ |
| 2028 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2029 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2030 | -s "Use of Connection ID has been negotiated" \ |
| 2031 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2032 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2033 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2034 | 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] | 2035 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2036 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2037 | 0 \ |
| 2038 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2039 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2040 | -c "client hello, adding CID extension" \ |
| 2041 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2042 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2043 | -s "server hello, adding CID extension" \ |
| 2044 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2045 | -c "Use of CID extension negotiated" \ |
| 2046 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2047 | -c "Copy CIDs into SSL transform" \ |
| 2048 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2049 | -s "Peer CID (length 0 Bytes):" \ |
| 2050 | -s "Use of Connection ID has been negotiated" \ |
| 2051 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2052 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2053 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2054 | 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] | 2055 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2056 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2057 | 0 \ |
| 2058 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2059 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2060 | -c "client hello, adding CID extension" \ |
| 2061 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2062 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2063 | -s "server hello, adding CID extension" \ |
| 2064 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2065 | -c "Use of CID extension negotiated" \ |
| 2066 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2067 | -c "Copy CIDs into SSL transform" \ |
| 2068 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2069 | -c "Peer CID (length 0 Bytes):" \ |
| 2070 | -s "Use of Connection ID has been negotiated" \ |
| 2071 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2072 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2073 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2074 | 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] | 2075 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2076 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2077 | 0 \ |
| 2078 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2079 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2080 | -c "client hello, adding CID extension" \ |
| 2081 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2082 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2083 | -s "server hello, adding CID extension" \ |
| 2084 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2085 | -c "Use of CID extension negotiated" \ |
| 2086 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2087 | -c "Copy CIDs into SSL transform" \ |
| 2088 | -S "Use of Connection ID has been negotiated" \ |
| 2089 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2090 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2091 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2092 | 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] | 2093 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2094 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2095 | 0 \ |
| 2096 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2097 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2098 | -c "client hello, adding CID extension" \ |
| 2099 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2100 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2101 | -s "server hello, adding CID extension" \ |
| 2102 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2103 | -c "Use of CID extension negotiated" \ |
| 2104 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2105 | -c "Copy CIDs into SSL transform" \ |
| 2106 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2107 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2108 | -s "Use of Connection ID has been negotiated" \ |
| 2109 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2110 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2111 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2112 | 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] | 2113 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2114 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2115 | 0 \ |
| 2116 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2117 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2118 | -c "client hello, adding CID extension" \ |
| 2119 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2120 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2121 | -s "server hello, adding CID extension" \ |
| 2122 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2123 | -c "Use of CID extension negotiated" \ |
| 2124 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2125 | -c "Copy CIDs into SSL transform" \ |
| 2126 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2127 | -s "Peer CID (length 0 Bytes):" \ |
| 2128 | -s "Use of Connection ID has been negotiated" \ |
| 2129 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2130 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2131 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2132 | 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] | 2133 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2134 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2135 | 0 \ |
| 2136 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2137 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2138 | -c "client hello, adding CID extension" \ |
| 2139 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2140 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2141 | -s "server hello, adding CID extension" \ |
| 2142 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2143 | -c "Use of CID extension negotiated" \ |
| 2144 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2145 | -c "Copy CIDs into SSL transform" \ |
| 2146 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2147 | -c "Peer CID (length 0 Bytes):" \ |
| 2148 | -s "Use of Connection ID has been negotiated" \ |
| 2149 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2150 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2151 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2152 | 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] | 2153 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2154 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2155 | 0 \ |
| 2156 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2157 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2158 | -c "client hello, adding CID extension" \ |
| 2159 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2160 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2161 | -s "server hello, adding CID extension" \ |
| 2162 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2163 | -c "Use of CID extension negotiated" \ |
| 2164 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2165 | -c "Copy CIDs into SSL transform" \ |
| 2166 | -S "Use of Connection ID has been negotiated" \ |
| 2167 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2168 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2169 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2170 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2171 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2172 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2173 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2174 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2175 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2176 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2177 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2178 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2179 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2180 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2181 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2182 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2183 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2184 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2185 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2186 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2187 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2188 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2189 | 0 \ |
| 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): be ef" \ |
| 2195 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2201 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate with different CID" \ |
| 2202 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2203 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2215 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2216 | 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] | 2217 | -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] | 2218 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2219 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead renegotiation=1 renegotiate=1" \ |
| 2220 | 0 \ |
| 2221 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2222 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2223 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2224 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2225 | -c "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2226 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2227 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2228 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2229 | -c "ignoring unexpected CID" \ |
| 2230 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2231 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2232 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2233 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2234 | run_test "Connection ID: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2235 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2236 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2237 | 0 \ |
| 2238 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2239 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2240 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2241 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2242 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2243 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2244 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2245 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2246 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2247 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2248 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2249 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2250 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2251 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 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 | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2263 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2264 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2265 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2266 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2267 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2268 | 0 \ |
| 2269 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2270 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2271 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2272 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2273 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2274 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2275 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2276 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2277 | -c "ignoring unexpected CID" \ |
| 2278 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2279 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2280 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2281 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2282 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2283 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2284 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2285 | 0 \ |
| 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" \ |
| 2291 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2292 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2293 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2294 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2295 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2296 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2297 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2298 | 0 \ |
| 2299 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2300 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2301 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2302 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2303 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2304 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2305 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2306 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2307 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2308 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2309 | -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] | 2310 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2311 | "$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" \ |
| 2312 | 0 \ |
| 2313 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2314 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2315 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2316 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2317 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2318 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2319 | -c "ignoring unexpected CID" \ |
| 2320 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2321 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2322 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2323 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2324 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2325 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2326 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2327 | 0 \ |
| 2328 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2329 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2330 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2331 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2332 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2333 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2334 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2335 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2336 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2337 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2338 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2339 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2340 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2341 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2342 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2343 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2344 | 0 \ |
| 2345 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2346 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2347 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2348 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2349 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2350 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2351 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2352 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2353 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2354 | -c "ignoring unexpected CID" \ |
| 2355 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2356 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2357 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2358 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2359 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2360 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2361 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2362 | 0 \ |
| 2363 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2364 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2365 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2366 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2367 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2368 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2369 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2370 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2371 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2372 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2373 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2374 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2375 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2376 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2377 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2378 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2379 | 0 \ |
| 2380 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2381 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2382 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2383 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2384 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2385 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2386 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2387 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2388 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2389 | -c "ignoring unexpected CID" \ |
| 2390 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2391 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2392 | # 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] | 2393 | # tests check that the buffer contents are reallocated when the message is |
| 2394 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2395 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2396 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2397 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2398 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2399 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2400 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2401 | 0 \ |
| 2402 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2403 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2404 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2405 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2406 | -s "Reallocating in_buf" \ |
| 2407 | -s "Reallocating out_buf" |
| 2408 | |
| 2409 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2410 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2411 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2412 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2413 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2414 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2415 | 0 \ |
| 2416 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2417 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2418 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2419 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2420 | -s "Reallocating in_buf" \ |
| 2421 | -s "Reallocating out_buf" |
| 2422 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2423 | # Tests for Encrypt-then-MAC extension |
| 2424 | |
| 2425 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2426 | "$P_SRV debug_level=3 \ |
| 2427 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2428 | "$P_CLI debug_level=3" \ |
| 2429 | 0 \ |
| 2430 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2431 | -s "found encrypt then mac extension" \ |
| 2432 | -s "server hello, adding encrypt then mac extension" \ |
| 2433 | -c "found encrypt_then_mac extension" \ |
| 2434 | -c "using encrypt then mac" \ |
| 2435 | -s "using encrypt then mac" |
| 2436 | |
| 2437 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2438 | "$P_SRV debug_level=3 etm=0 \ |
| 2439 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2440 | "$P_CLI debug_level=3 etm=1" \ |
| 2441 | 0 \ |
| 2442 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2443 | -s "found encrypt then mac extension" \ |
| 2444 | -S "server hello, adding encrypt then mac extension" \ |
| 2445 | -C "found encrypt_then_mac extension" \ |
| 2446 | -C "using encrypt then mac" \ |
| 2447 | -S "using encrypt then mac" |
| 2448 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2449 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2450 | "$P_SRV debug_level=3 etm=1 \ |
| 2451 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2452 | "$P_CLI debug_level=3 etm=1" \ |
| 2453 | 0 \ |
| 2454 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2455 | -s "found encrypt then mac extension" \ |
| 2456 | -S "server hello, adding encrypt then mac extension" \ |
| 2457 | -C "found encrypt_then_mac extension" \ |
| 2458 | -C "using encrypt then mac" \ |
| 2459 | -S "using encrypt then mac" |
| 2460 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2461 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2462 | "$P_SRV debug_level=3 etm=1 \ |
| 2463 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2464 | "$P_CLI debug_level=3 etm=0" \ |
| 2465 | 0 \ |
| 2466 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2467 | -S "found encrypt then mac extension" \ |
| 2468 | -S "server hello, adding encrypt then mac extension" \ |
| 2469 | -C "found encrypt_then_mac extension" \ |
| 2470 | -C "using encrypt then mac" \ |
| 2471 | -S "using encrypt then mac" |
| 2472 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2473 | # Tests for Extended Master Secret extension |
| 2474 | |
| 2475 | run_test "Extended Master Secret: default" \ |
| 2476 | "$P_SRV debug_level=3" \ |
| 2477 | "$P_CLI debug_level=3" \ |
| 2478 | 0 \ |
| 2479 | -c "client hello, adding extended_master_secret extension" \ |
| 2480 | -s "found extended master secret extension" \ |
| 2481 | -s "server hello, adding extended master secret extension" \ |
| 2482 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2483 | -c "session hash for extended master secret" \ |
| 2484 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2485 | |
| 2486 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2487 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2488 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2489 | 0 \ |
| 2490 | -c "client hello, adding extended_master_secret extension" \ |
| 2491 | -s "found extended master secret extension" \ |
| 2492 | -S "server hello, adding extended master secret extension" \ |
| 2493 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2494 | -C "session hash for extended master secret" \ |
| 2495 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2496 | |
| 2497 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2498 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2499 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2500 | 0 \ |
| 2501 | -C "client hello, adding extended_master_secret extension" \ |
| 2502 | -S "found extended master secret extension" \ |
| 2503 | -S "server hello, adding extended master secret extension" \ |
| 2504 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2505 | -C "session hash for extended master secret" \ |
| 2506 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2507 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2508 | # Test sending and receiving empty application data records |
| 2509 | |
| 2510 | run_test "Encrypt then MAC: empty application data record" \ |
| 2511 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2512 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2513 | 0 \ |
| 2514 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2515 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2516 | -c "0 bytes written in 1 fragments" |
| 2517 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2518 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2519 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2520 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2521 | 0 \ |
| 2522 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2523 | -c "0 bytes written in 1 fragments" |
| 2524 | |
| 2525 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2526 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2527 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 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, DTLS: 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 dtls=1" \ |
| 2535 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2536 | 0 \ |
| 2537 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2538 | -c "0 bytes written in 1 fragments" |
| 2539 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2540 | # Tests for CBC 1/n-1 record splitting |
| 2541 | |
| 2542 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2543 | "$P_SRV" \ |
| 2544 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2545 | request_size=123 force_version=tls1_2" \ |
| 2546 | 0 \ |
| 2547 | -s "Read from client: 123 bytes read" \ |
| 2548 | -S "Read from client: 1 bytes read" \ |
| 2549 | -S "122 bytes read" |
| 2550 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2551 | # Tests for Session Tickets |
| 2552 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2553 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2554 | "$P_SRV debug_level=3 tickets=1" \ |
| 2555 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2556 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2557 | -c "client hello, adding session ticket extension" \ |
| 2558 | -s "found session ticket extension" \ |
| 2559 | -s "server hello, adding session ticket extension" \ |
| 2560 | -c "found session_ticket extension" \ |
| 2561 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2562 | -S "session successfully restored from cache" \ |
| 2563 | -s "session successfully restored from ticket" \ |
| 2564 | -s "a session has been resumed" \ |
| 2565 | -c "a session has been resumed" |
| 2566 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2567 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2568 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2569 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2570 | 0 \ |
| 2571 | -c "client hello, adding session ticket extension" \ |
| 2572 | -s "found session ticket extension" \ |
| 2573 | -s "server hello, adding session ticket extension" \ |
| 2574 | -c "found session_ticket extension" \ |
| 2575 | -c "parse new session ticket" \ |
| 2576 | -S "session successfully restored from cache" \ |
| 2577 | -s "session successfully restored from ticket" \ |
| 2578 | -s "a session has been resumed" \ |
| 2579 | -c "a session has been resumed" |
| 2580 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2581 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2582 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2583 | "$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] | 2584 | 0 \ |
| 2585 | -c "client hello, adding session ticket extension" \ |
| 2586 | -s "found session ticket extension" \ |
| 2587 | -s "server hello, adding session ticket extension" \ |
| 2588 | -c "found session_ticket extension" \ |
| 2589 | -c "parse new session ticket" \ |
| 2590 | -S "session successfully restored from cache" \ |
| 2591 | -S "session successfully restored from ticket" \ |
| 2592 | -S "a session has been resumed" \ |
| 2593 | -C "a session has been resumed" |
| 2594 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2595 | run_test "Session resume using tickets: session copy" \ |
| 2596 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2597 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2598 | 0 \ |
| 2599 | -c "client hello, adding session ticket extension" \ |
| 2600 | -s "found session ticket extension" \ |
| 2601 | -s "server hello, adding session ticket extension" \ |
| 2602 | -c "found session_ticket extension" \ |
| 2603 | -c "parse new session ticket" \ |
| 2604 | -S "session successfully restored from cache" \ |
| 2605 | -s "session successfully restored from ticket" \ |
| 2606 | -s "a session has been resumed" \ |
| 2607 | -c "a session has been resumed" |
| 2608 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2609 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2610 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2611 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2612 | 0 \ |
| 2613 | -c "client hello, adding session ticket extension" \ |
| 2614 | -c "found session_ticket extension" \ |
| 2615 | -c "parse new session ticket" \ |
| 2616 | -c "a session has been resumed" |
| 2617 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2618 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2619 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2620 | "( $O_CLI -sess_out $SESSION; \ |
| 2621 | $O_CLI -sess_in $SESSION; \ |
| 2622 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2623 | 0 \ |
| 2624 | -s "found session ticket extension" \ |
| 2625 | -s "server hello, adding session ticket extension" \ |
| 2626 | -S "session successfully restored from cache" \ |
| 2627 | -s "session successfully restored from ticket" \ |
| 2628 | -s "a session has been resumed" |
| 2629 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2630 | # Tests for Session Tickets with DTLS |
| 2631 | |
| 2632 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2633 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2634 | "$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] | 2635 | 0 \ |
| 2636 | -c "client hello, adding session ticket extension" \ |
| 2637 | -s "found session ticket extension" \ |
| 2638 | -s "server hello, adding session ticket extension" \ |
| 2639 | -c "found session_ticket extension" \ |
| 2640 | -c "parse new session ticket" \ |
| 2641 | -S "session successfully restored from cache" \ |
| 2642 | -s "session successfully restored from ticket" \ |
| 2643 | -s "a session has been resumed" \ |
| 2644 | -c "a session has been resumed" |
| 2645 | |
| 2646 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2647 | "$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] | 2648 | "$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] | 2649 | 0 \ |
| 2650 | -c "client hello, adding session ticket extension" \ |
| 2651 | -s "found session ticket extension" \ |
| 2652 | -s "server hello, adding session ticket extension" \ |
| 2653 | -c "found session_ticket extension" \ |
| 2654 | -c "parse new session ticket" \ |
| 2655 | -S "session successfully restored from cache" \ |
| 2656 | -s "session successfully restored from ticket" \ |
| 2657 | -s "a session has been resumed" \ |
| 2658 | -c "a session has been resumed" |
| 2659 | |
| 2660 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2661 | "$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] | 2662 | "$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] | 2663 | 0 \ |
| 2664 | -c "client hello, adding session ticket extension" \ |
| 2665 | -s "found session ticket extension" \ |
| 2666 | -s "server hello, adding session ticket extension" \ |
| 2667 | -c "found session_ticket extension" \ |
| 2668 | -c "parse new session ticket" \ |
| 2669 | -S "session successfully restored from cache" \ |
| 2670 | -S "session successfully restored from ticket" \ |
| 2671 | -S "a session has been resumed" \ |
| 2672 | -C "a session has been resumed" |
| 2673 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2674 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2675 | "$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] | 2676 | "$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] | 2677 | 0 \ |
| 2678 | -c "client hello, adding session ticket extension" \ |
| 2679 | -s "found session ticket extension" \ |
| 2680 | -s "server hello, adding session ticket extension" \ |
| 2681 | -c "found session_ticket extension" \ |
| 2682 | -c "parse new session ticket" \ |
| 2683 | -S "session successfully restored from cache" \ |
| 2684 | -s "session successfully restored from ticket" \ |
| 2685 | -s "a session has been resumed" \ |
| 2686 | -c "a session has been resumed" |
| 2687 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2688 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2689 | "$O_SRV -dtls" \ |
| 2690 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2691 | 0 \ |
| 2692 | -c "client hello, adding session ticket extension" \ |
| 2693 | -c "found session_ticket extension" \ |
| 2694 | -c "parse new session ticket" \ |
| 2695 | -c "a session has been resumed" |
| 2696 | |
| 2697 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2698 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
| 2699 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2700 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2701 | rm -f $SESSION )" \ |
| 2702 | 0 \ |
| 2703 | -s "found session ticket extension" \ |
| 2704 | -s "server hello, adding session ticket extension" \ |
| 2705 | -S "session successfully restored from cache" \ |
| 2706 | -s "session successfully restored from ticket" \ |
| 2707 | -s "a session has been resumed" |
| 2708 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2709 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2710 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2711 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2712 | "$P_SRV debug_level=3 tickets=0" \ |
| 2713 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2714 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2715 | -c "client hello, adding session ticket extension" \ |
| 2716 | -s "found session ticket extension" \ |
| 2717 | -S "server hello, adding session ticket extension" \ |
| 2718 | -C "found session_ticket extension" \ |
| 2719 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2720 | -s "session successfully restored from cache" \ |
| 2721 | -S "session successfully restored from ticket" \ |
| 2722 | -s "a session has been resumed" \ |
| 2723 | -c "a session has been resumed" |
| 2724 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2725 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2726 | "$P_SRV debug_level=3 tickets=1" \ |
| 2727 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2728 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2729 | -C "client hello, adding session ticket extension" \ |
| 2730 | -S "found session ticket extension" \ |
| 2731 | -S "server hello, adding session ticket extension" \ |
| 2732 | -C "found session_ticket extension" \ |
| 2733 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2734 | -s "session successfully restored from cache" \ |
| 2735 | -S "session successfully restored from ticket" \ |
| 2736 | -s "a session has been resumed" \ |
| 2737 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2738 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2739 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2740 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2741 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2742 | 0 \ |
| 2743 | -S "session successfully restored from cache" \ |
| 2744 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2745 | -S "a session has been resumed" \ |
| 2746 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2747 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2748 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2749 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2750 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2751 | 0 \ |
| 2752 | -s "session successfully restored from cache" \ |
| 2753 | -S "session successfully restored from ticket" \ |
| 2754 | -s "a session has been resumed" \ |
| 2755 | -c "a session has been resumed" |
| 2756 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2757 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2758 | "$P_SRV debug_level=3 tickets=0" \ |
| 2759 | "$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] | 2760 | 0 \ |
| 2761 | -s "session successfully restored from cache" \ |
| 2762 | -S "session successfully restored from ticket" \ |
| 2763 | -s "a session has been resumed" \ |
| 2764 | -c "a session has been resumed" |
| 2765 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2766 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2767 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2768 | "$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] | 2769 | 0 \ |
| 2770 | -S "session successfully restored from cache" \ |
| 2771 | -S "session successfully restored from ticket" \ |
| 2772 | -S "a session has been resumed" \ |
| 2773 | -C "a session has been resumed" |
| 2774 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2775 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2776 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2777 | "$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] | 2778 | 0 \ |
| 2779 | -s "session successfully restored from cache" \ |
| 2780 | -S "session successfully restored from ticket" \ |
| 2781 | -s "a session has been resumed" \ |
| 2782 | -c "a session has been resumed" |
| 2783 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2784 | run_test "Session resume using cache: session copy" \ |
| 2785 | "$P_SRV debug_level=3 tickets=0" \ |
| 2786 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2787 | 0 \ |
| 2788 | -s "session successfully restored from cache" \ |
| 2789 | -S "session successfully restored from ticket" \ |
| 2790 | -s "a session has been resumed" \ |
| 2791 | -c "a session has been resumed" |
| 2792 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2793 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2794 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2795 | "( $O_CLI -sess_out $SESSION; \ |
| 2796 | $O_CLI -sess_in $SESSION; \ |
| 2797 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2798 | 0 \ |
| 2799 | -s "found session ticket extension" \ |
| 2800 | -S "server hello, adding session ticket extension" \ |
| 2801 | -s "session successfully restored from cache" \ |
| 2802 | -S "session successfully restored from ticket" \ |
| 2803 | -s "a session has been resumed" |
| 2804 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2805 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2806 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2807 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2808 | 0 \ |
| 2809 | -C "found session_ticket extension" \ |
| 2810 | -C "parse new session ticket" \ |
| 2811 | -c "a session has been resumed" |
| 2812 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2813 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2814 | |
| 2815 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2816 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2817 | "$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] | 2818 | 0 \ |
| 2819 | -c "client hello, adding session ticket extension" \ |
| 2820 | -s "found session ticket extension" \ |
| 2821 | -S "server hello, adding session ticket extension" \ |
| 2822 | -C "found session_ticket extension" \ |
| 2823 | -C "parse new session ticket" \ |
| 2824 | -s "session successfully restored from cache" \ |
| 2825 | -S "session successfully restored from ticket" \ |
| 2826 | -s "a session has been resumed" \ |
| 2827 | -c "a session has been resumed" |
| 2828 | |
| 2829 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2830 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2831 | "$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] | 2832 | 0 \ |
| 2833 | -C "client hello, adding session ticket extension" \ |
| 2834 | -S "found session ticket extension" \ |
| 2835 | -S "server hello, adding session ticket extension" \ |
| 2836 | -C "found session_ticket extension" \ |
| 2837 | -C "parse new session ticket" \ |
| 2838 | -s "session successfully restored from cache" \ |
| 2839 | -S "session successfully restored from ticket" \ |
| 2840 | -s "a session has been resumed" \ |
| 2841 | -c "a session has been resumed" |
| 2842 | |
| 2843 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2844 | "$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] | 2845 | "$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] | 2846 | 0 \ |
| 2847 | -S "session successfully restored from cache" \ |
| 2848 | -S "session successfully restored from ticket" \ |
| 2849 | -S "a session has been resumed" \ |
| 2850 | -C "a session has been resumed" |
| 2851 | |
| 2852 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2853 | "$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] | 2854 | "$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] | 2855 | 0 \ |
| 2856 | -s "session successfully restored from cache" \ |
| 2857 | -S "session successfully restored from ticket" \ |
| 2858 | -s "a session has been resumed" \ |
| 2859 | -c "a session has been resumed" |
| 2860 | |
| 2861 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2862 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2863 | "$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] | 2864 | 0 \ |
| 2865 | -s "session successfully restored from cache" \ |
| 2866 | -S "session successfully restored from ticket" \ |
| 2867 | -s "a session has been resumed" \ |
| 2868 | -c "a session has been resumed" |
| 2869 | |
| 2870 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2871 | "$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] | 2872 | "$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] | 2873 | 0 \ |
| 2874 | -S "session successfully restored from cache" \ |
| 2875 | -S "session successfully restored from ticket" \ |
| 2876 | -S "a session has been resumed" \ |
| 2877 | -C "a session has been resumed" |
| 2878 | |
| 2879 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2880 | "$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] | 2881 | "$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] | 2882 | 0 \ |
| 2883 | -s "session successfully restored from cache" \ |
| 2884 | -S "session successfully restored from ticket" \ |
| 2885 | -s "a session has been resumed" \ |
| 2886 | -c "a session has been resumed" |
| 2887 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2888 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2889 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2890 | "$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] | 2891 | 0 \ |
| 2892 | -s "session successfully restored from cache" \ |
| 2893 | -S "session successfully restored from ticket" \ |
| 2894 | -s "a session has been resumed" \ |
| 2895 | -c "a session has been resumed" |
| 2896 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2897 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2898 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
| 2899 | "( $O_CLI -dtls -sess_out $SESSION; \ |
| 2900 | $O_CLI -dtls -sess_in $SESSION; \ |
| 2901 | rm -f $SESSION )" \ |
| 2902 | 0 \ |
| 2903 | -s "found session ticket extension" \ |
| 2904 | -S "server hello, adding session ticket extension" \ |
| 2905 | -s "session successfully restored from cache" \ |
| 2906 | -S "session successfully restored from ticket" \ |
| 2907 | -s "a session has been resumed" |
| 2908 | |
| 2909 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2910 | "$O_SRV -dtls" \ |
| 2911 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2912 | 0 \ |
| 2913 | -C "found session_ticket extension" \ |
| 2914 | -C "parse new session ticket" \ |
| 2915 | -c "a session has been resumed" |
| 2916 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2917 | # Tests for Max Fragment Length extension |
| 2918 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2919 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2920 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2921 | "$P_SRV debug_level=3" \ |
| 2922 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2923 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2924 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2925 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2926 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2927 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2928 | -C "client hello, adding max_fragment_length extension" \ |
| 2929 | -S "found max fragment length extension" \ |
| 2930 | -S "server hello, max_fragment_length extension" \ |
| 2931 | -C "found max_fragment_length extension" |
| 2932 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2933 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2934 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2935 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2936 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2937 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2938 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2939 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2940 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2941 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2942 | -C "client hello, adding max_fragment_length extension" \ |
| 2943 | -S "found max fragment length extension" \ |
| 2944 | -S "server hello, max_fragment_length extension" \ |
| 2945 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2946 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2947 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2948 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2949 | |
| 2950 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2951 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 2952 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2953 | "$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] | 2954 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2955 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2956 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2957 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2958 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2959 | -C "client hello, adding max_fragment_length extension" \ |
| 2960 | -S "found max fragment length extension" \ |
| 2961 | -S "server hello, max_fragment_length extension" \ |
| 2962 | -C "found max_fragment_length extension" \ |
| 2963 | -c "fragment larger than.*maximum " |
| 2964 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2965 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 2966 | # (session fragment length will be 16384 regardless of mbedtls |
| 2967 | # content length configuration.) |
| 2968 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2969 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 2970 | run_test "Max fragment length: disabled, larger message" \ |
| 2971 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2972 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2973 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2974 | -C "Maximum incoming record payload length is 16384" \ |
| 2975 | -C "Maximum outgoing record payload length is 16384" \ |
| 2976 | -S "Maximum incoming record payload length is 16384" \ |
| 2977 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2978 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 2979 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 2980 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2981 | |
| 2982 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 2983 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2984 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2985 | "$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] | 2986 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2987 | -C "Maximum incoming record payload length is 16384" \ |
| 2988 | -C "Maximum outgoing record payload length is 16384" \ |
| 2989 | -S "Maximum incoming record payload length is 16384" \ |
| 2990 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2991 | -c "fragment larger than.*maximum " |
| 2992 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 2993 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2994 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2995 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2996 | "$P_SRV debug_level=3" \ |
| 2997 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2998 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2999 | -c "Maximum incoming record payload length is 4096" \ |
| 3000 | -c "Maximum outgoing record payload length is 4096" \ |
| 3001 | -s "Maximum incoming record payload length is 4096" \ |
| 3002 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3003 | -c "client hello, adding max_fragment_length extension" \ |
| 3004 | -s "found max fragment length extension" \ |
| 3005 | -s "server hello, max_fragment_length extension" \ |
| 3006 | -c "found max_fragment_length extension" |
| 3007 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3008 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3009 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3010 | run_test "Max fragment length: client 512, server 1024" \ |
| 3011 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3012 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3013 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3014 | -c "Maximum incoming record payload length is 512" \ |
| 3015 | -c "Maximum outgoing record payload length is 512" \ |
| 3016 | -s "Maximum incoming record payload length is 512" \ |
| 3017 | -s "Maximum outgoing record payload length is 512" \ |
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 2048 |
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 2048" \ |
| 3026 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 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 4096 |
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 4096" \ |
| 3041 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 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 1024 |
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 1024, server 512" \ |
| 3056 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3057 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3058 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3059 | -c "Maximum incoming record payload length is 1024" \ |
| 3060 | -c "Maximum outgoing record payload length is 1024" \ |
| 3061 | -s "Maximum incoming record payload length is 1024" \ |
| 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 2048 |
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 2048" \ |
| 3071 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 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 1024" \ |
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 4096 |
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 4096" \ |
| 3086 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 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 2048 |
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 2048, server 512" \ |
| 3101 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3102 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3103 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3104 | -c "Maximum incoming record payload length is 2048" \ |
| 3105 | -c "Maximum outgoing record payload length is 2048" \ |
| 3106 | -s "Maximum incoming record payload length is 2048" \ |
| 3107 | -s "Maximum outgoing record payload length is 512" \ |
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 1024" \ |
| 3116 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 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 1024" \ |
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 4096 |
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 4096" \ |
| 3131 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 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 2048" \ |
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 4096, server 512" \ |
| 3146 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3147 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3148 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3149 | -c "Maximum incoming record payload length is 4096" \ |
| 3150 | -c "Maximum outgoing record payload length is 4096" \ |
| 3151 | -s "Maximum incoming record payload length is 4096" \ |
| 3152 | -s "Maximum outgoing record payload length is 512" \ |
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 1024" \ |
| 3161 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 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 1024" \ |
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 2048" \ |
| 3176 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 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 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [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 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3189 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3190 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3191 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3192 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3193 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3194 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3195 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3196 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3197 | -s "Maximum outgoing record payload length is 4096" \ |
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" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 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 | requires_gnutls |
| 3206 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3207 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3208 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3209 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3210 | -c "Maximum incoming record payload length is 4096" \ |
| 3211 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3212 | -c "client hello, adding max_fragment_length extension" \ |
| 3213 | -c "found max_fragment_length extension" |
| 3214 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3215 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3216 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3217 | run_test "Max fragment length: client, message just fits" \ |
| 3218 | "$P_SRV debug_level=3" \ |
| 3219 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3220 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3221 | -c "Maximum incoming record payload length is 2048" \ |
| 3222 | -c "Maximum outgoing record payload length is 2048" \ |
| 3223 | -s "Maximum incoming record payload length is 2048" \ |
| 3224 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3225 | -c "client hello, adding max_fragment_length extension" \ |
| 3226 | -s "found max fragment length extension" \ |
| 3227 | -s "server hello, max_fragment_length extension" \ |
| 3228 | -c "found max_fragment_length extension" \ |
| 3229 | -c "2048 bytes written in 1 fragments" \ |
| 3230 | -s "2048 bytes read" |
| 3231 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3232 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3233 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3234 | run_test "Max fragment length: client, larger message" \ |
| 3235 | "$P_SRV debug_level=3" \ |
| 3236 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3237 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3238 | -c "Maximum incoming record payload length is 2048" \ |
| 3239 | -c "Maximum outgoing record payload length is 2048" \ |
| 3240 | -s "Maximum incoming record payload length is 2048" \ |
| 3241 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3242 | -c "client hello, adding max_fragment_length extension" \ |
| 3243 | -s "found max fragment length extension" \ |
| 3244 | -s "server hello, max_fragment_length extension" \ |
| 3245 | -c "found max_fragment_length extension" \ |
| 3246 | -c "2345 bytes written in 2 fragments" \ |
| 3247 | -s "2048 bytes read" \ |
| 3248 | -s "297 bytes read" |
| 3249 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3250 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3251 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3252 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3253 | "$P_SRV debug_level=3 dtls=1" \ |
| 3254 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3255 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3256 | -c "Maximum incoming record payload length is 2048" \ |
| 3257 | -c "Maximum outgoing record payload length is 2048" \ |
| 3258 | -s "Maximum incoming record payload length is 2048" \ |
| 3259 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3260 | -c "client hello, adding max_fragment_length extension" \ |
| 3261 | -s "found max fragment length extension" \ |
| 3262 | -s "server hello, max_fragment_length extension" \ |
| 3263 | -c "found max_fragment_length extension" \ |
| 3264 | -c "fragment larger than.*maximum" |
| 3265 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3266 | # Tests for renegotiation |
| 3267 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3268 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3269 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3270 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3271 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3272 | 0 \ |
| 3273 | -C "client hello, adding renegotiation extension" \ |
| 3274 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3275 | -S "found renegotiation extension" \ |
| 3276 | -s "server hello, secure renegotiation extension" \ |
| 3277 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3278 | -C "=> renegotiate" \ |
| 3279 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3280 | -S "write hello request" |
| 3281 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3282 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3283 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3284 | "$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] | 3285 | "$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] | 3286 | 0 \ |
| 3287 | -c "client hello, adding renegotiation extension" \ |
| 3288 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3289 | -s "found renegotiation extension" \ |
| 3290 | -s "server hello, secure renegotiation extension" \ |
| 3291 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3292 | -c "=> renegotiate" \ |
| 3293 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3294 | -S "write hello request" |
| 3295 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3296 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3297 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3298 | "$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] | 3299 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3300 | 0 \ |
| 3301 | -c "client hello, adding renegotiation extension" \ |
| 3302 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3303 | -s "found renegotiation extension" \ |
| 3304 | -s "server hello, secure renegotiation extension" \ |
| 3305 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3306 | -c "=> renegotiate" \ |
| 3307 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3308 | -s "write hello request" |
| 3309 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3310 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3311 | # 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] | 3312 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3313 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3314 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3315 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3316 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3317 | 0 \ |
| 3318 | -c "client hello, adding renegotiation extension" \ |
| 3319 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3320 | -s "found renegotiation extension" \ |
| 3321 | -s "server hello, secure renegotiation extension" \ |
| 3322 | -c "found renegotiation extension" \ |
| 3323 | -c "=> renegotiate" \ |
| 3324 | -s "=> renegotiate" \ |
| 3325 | -S "write hello request" \ |
| 3326 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3327 | |
| 3328 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3329 | # 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] | 3330 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3331 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3332 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3333 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3334 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3335 | 0 \ |
| 3336 | -c "client hello, adding renegotiation extension" \ |
| 3337 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3338 | -s "found renegotiation extension" \ |
| 3339 | -s "server hello, secure renegotiation extension" \ |
| 3340 | -c "found renegotiation extension" \ |
| 3341 | -c "=> renegotiate" \ |
| 3342 | -s "=> renegotiate" \ |
| 3343 | -s "write hello request" \ |
| 3344 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3345 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3346 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3347 | run_test "Renegotiation: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3348 | "$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] | 3349 | "$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] | 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" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3356 | -c "=> renegotiate" \ |
| 3357 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3358 | -s "write hello request" |
| 3359 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3360 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3361 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3362 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3363 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3364 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3365 | "$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" \ |
| 3366 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3367 | -c "Maximum incoming record payload length is 2048" \ |
| 3368 | -c "Maximum outgoing record payload length is 2048" \ |
| 3369 | -s "Maximum incoming record payload length is 2048" \ |
| 3370 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3371 | -c "client hello, adding max_fragment_length extension" \ |
| 3372 | -s "found max fragment length extension" \ |
| 3373 | -s "server hello, max_fragment_length extension" \ |
| 3374 | -c "found max_fragment_length extension" \ |
| 3375 | -c "client hello, adding renegotiation extension" \ |
| 3376 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3377 | -s "found renegotiation extension" \ |
| 3378 | -s "server hello, secure renegotiation extension" \ |
| 3379 | -c "found renegotiation extension" \ |
| 3380 | -c "=> renegotiate" \ |
| 3381 | -s "=> renegotiate" \ |
| 3382 | -s "write hello request" |
| 3383 | |
| 3384 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3385 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3386 | "$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] | 3387 | "$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] | 3388 | 1 \ |
| 3389 | -c "client hello, adding renegotiation extension" \ |
| 3390 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3391 | -S "found renegotiation extension" \ |
| 3392 | -s "server hello, secure renegotiation extension" \ |
| 3393 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3394 | -c "=> renegotiate" \ |
| 3395 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3396 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3397 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3398 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3399 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3400 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3401 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3402 | "$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] | 3403 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3404 | 0 \ |
| 3405 | -C "client hello, adding renegotiation extension" \ |
| 3406 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3407 | -S "found renegotiation extension" \ |
| 3408 | -s "server hello, secure renegotiation extension" \ |
| 3409 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3410 | -C "=> renegotiate" \ |
| 3411 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3412 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3413 | -S "SSL - An unexpected message was received from our peer" \ |
| 3414 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3415 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3416 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3417 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3418 | "$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] | 3419 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3420 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3421 | 0 \ |
| 3422 | -C "client hello, adding renegotiation extension" \ |
| 3423 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3424 | -S "found renegotiation extension" \ |
| 3425 | -s "server hello, secure renegotiation extension" \ |
| 3426 | -c "found renegotiation extension" \ |
| 3427 | -C "=> renegotiate" \ |
| 3428 | -S "=> renegotiate" \ |
| 3429 | -s "write hello request" \ |
| 3430 | -S "SSL - An unexpected message was received from our peer" \ |
| 3431 | -S "failed" |
| 3432 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3433 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3434 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3435 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3436 | "$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] | 3437 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3438 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3439 | 0 \ |
| 3440 | -C "client hello, adding renegotiation extension" \ |
| 3441 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3442 | -S "found renegotiation extension" \ |
| 3443 | -s "server hello, secure renegotiation extension" \ |
| 3444 | -c "found renegotiation extension" \ |
| 3445 | -C "=> renegotiate" \ |
| 3446 | -S "=> renegotiate" \ |
| 3447 | -s "write hello request" \ |
| 3448 | -S "SSL - An unexpected message was received from our peer" \ |
| 3449 | -S "failed" |
| 3450 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3451 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3452 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3453 | "$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] | 3454 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3455 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3456 | 0 \ |
| 3457 | -C "client hello, adding renegotiation extension" \ |
| 3458 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3459 | -S "found renegotiation extension" \ |
| 3460 | -s "server hello, secure renegotiation extension" \ |
| 3461 | -c "found renegotiation extension" \ |
| 3462 | -C "=> renegotiate" \ |
| 3463 | -S "=> renegotiate" \ |
| 3464 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3465 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3466 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3467 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3468 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3469 | "$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] | 3470 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3471 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3472 | 0 \ |
| 3473 | -c "client hello, adding renegotiation extension" \ |
| 3474 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3475 | -s "found renegotiation extension" \ |
| 3476 | -s "server hello, secure renegotiation extension" \ |
| 3477 | -c "found renegotiation extension" \ |
| 3478 | -c "=> renegotiate" \ |
| 3479 | -s "=> renegotiate" \ |
| 3480 | -s "write hello request" \ |
| 3481 | -S "SSL - An unexpected message was received from our peer" \ |
| 3482 | -S "failed" |
| 3483 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3484 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3485 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3486 | "$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] | 3487 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3488 | 0 \ |
| 3489 | -C "client hello, adding renegotiation extension" \ |
| 3490 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3491 | -S "found renegotiation extension" \ |
| 3492 | -s "server hello, secure renegotiation extension" \ |
| 3493 | -c "found renegotiation extension" \ |
| 3494 | -S "record counter limit reached: renegotiate" \ |
| 3495 | -C "=> renegotiate" \ |
| 3496 | -S "=> renegotiate" \ |
| 3497 | -S "write hello request" \ |
| 3498 | -S "SSL - An unexpected message was received from our peer" \ |
| 3499 | -S "failed" |
| 3500 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3501 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3502 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3503 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3504 | "$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] | 3505 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3506 | 0 \ |
| 3507 | -c "client hello, adding renegotiation extension" \ |
| 3508 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3509 | -s "found renegotiation extension" \ |
| 3510 | -s "server hello, secure renegotiation extension" \ |
| 3511 | -c "found renegotiation extension" \ |
| 3512 | -s "record counter limit reached: renegotiate" \ |
| 3513 | -c "=> renegotiate" \ |
| 3514 | -s "=> renegotiate" \ |
| 3515 | -s "write hello request" \ |
| 3516 | -S "SSL - An unexpected message was received from our peer" \ |
| 3517 | -S "failed" |
| 3518 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3519 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3520 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3521 | "$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] | 3522 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3523 | 0 \ |
| 3524 | -c "client hello, adding renegotiation extension" \ |
| 3525 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3526 | -s "found renegotiation extension" \ |
| 3527 | -s "server hello, secure renegotiation extension" \ |
| 3528 | -c "found renegotiation extension" \ |
| 3529 | -s "record counter limit reached: renegotiate" \ |
| 3530 | -c "=> renegotiate" \ |
| 3531 | -s "=> renegotiate" \ |
| 3532 | -s "write hello request" \ |
| 3533 | -S "SSL - An unexpected message was received from our peer" \ |
| 3534 | -S "failed" |
| 3535 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3536 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3537 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3538 | "$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] | 3539 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3540 | 0 \ |
| 3541 | -C "client hello, adding renegotiation extension" \ |
| 3542 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3543 | -S "found renegotiation extension" \ |
| 3544 | -s "server hello, secure renegotiation extension" \ |
| 3545 | -c "found renegotiation extension" \ |
| 3546 | -S "record counter limit reached: renegotiate" \ |
| 3547 | -C "=> renegotiate" \ |
| 3548 | -S "=> renegotiate" \ |
| 3549 | -S "write hello request" \ |
| 3550 | -S "SSL - An unexpected message was received from our peer" \ |
| 3551 | -S "failed" |
| 3552 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3553 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3554 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3555 | "$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] | 3556 | "$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] | 3557 | 0 \ |
| 3558 | -c "client hello, adding renegotiation extension" \ |
| 3559 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3560 | -s "found renegotiation extension" \ |
| 3561 | -s "server hello, secure renegotiation extension" \ |
| 3562 | -c "found renegotiation extension" \ |
| 3563 | -c "=> renegotiate" \ |
| 3564 | -s "=> renegotiate" \ |
| 3565 | -S "write hello request" |
| 3566 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3567 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3568 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3569 | "$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] | 3570 | "$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] | 3571 | 0 \ |
| 3572 | -c "client hello, adding renegotiation extension" \ |
| 3573 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3574 | -s "found renegotiation extension" \ |
| 3575 | -s "server hello, secure renegotiation extension" \ |
| 3576 | -c "found renegotiation extension" \ |
| 3577 | -c "=> renegotiate" \ |
| 3578 | -s "=> renegotiate" \ |
| 3579 | -s "write hello request" |
| 3580 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3581 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3582 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3583 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3584 | "$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] | 3585 | 0 \ |
| 3586 | -c "client hello, adding renegotiation extension" \ |
| 3587 | -c "found renegotiation extension" \ |
| 3588 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3589 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3590 | -C "error" \ |
| 3591 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3592 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3593 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3594 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3595 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3596 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3597 | "$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] | 3598 | 0 \ |
| 3599 | -c "client hello, adding renegotiation extension" \ |
| 3600 | -c "found renegotiation extension" \ |
| 3601 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3602 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3603 | -C "error" \ |
| 3604 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3605 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3606 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3607 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3608 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3609 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3610 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3611 | 1 \ |
| 3612 | -c "client hello, adding renegotiation extension" \ |
| 3613 | -C "found renegotiation extension" \ |
| 3614 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3615 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3616 | -c "error" \ |
| 3617 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3618 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3619 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3620 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3621 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3622 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3623 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3624 | allow_legacy=0" \ |
| 3625 | 1 \ |
| 3626 | -c "client hello, adding renegotiation extension" \ |
| 3627 | -C "found renegotiation extension" \ |
| 3628 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3629 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3630 | -c "error" \ |
| 3631 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3632 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3633 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3634 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3635 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3636 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3637 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3638 | allow_legacy=1" \ |
| 3639 | 0 \ |
| 3640 | -c "client hello, adding renegotiation extension" \ |
| 3641 | -C "found renegotiation extension" \ |
| 3642 | -c "=> renegotiate" \ |
| 3643 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3644 | -C "error" \ |
| 3645 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3646 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3647 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3648 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3649 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3650 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3651 | 0 \ |
| 3652 | -c "client hello, adding renegotiation extension" \ |
| 3653 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3654 | -s "found renegotiation extension" \ |
| 3655 | -s "server hello, secure renegotiation extension" \ |
| 3656 | -c "found renegotiation extension" \ |
| 3657 | -c "=> renegotiate" \ |
| 3658 | -s "=> renegotiate" \ |
| 3659 | -S "write hello request" |
| 3660 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3661 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3662 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3663 | "$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] | 3664 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3665 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 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 |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3677 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3678 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3679 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3680 | 0 \ |
| 3681 | -c "client hello, adding renegotiation extension" \ |
| 3682 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3683 | -s "found renegotiation extension" \ |
| 3684 | -s "server hello, secure renegotiation extension" \ |
| 3685 | -s "record counter limit reached: renegotiate" \ |
| 3686 | -c "=> renegotiate" \ |
| 3687 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3688 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3689 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3690 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3691 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3692 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3693 | "$G_SRV -u --mtu 4096" \ |
| 3694 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3695 | 0 \ |
| 3696 | -c "client hello, adding renegotiation extension" \ |
| 3697 | -c "found renegotiation extension" \ |
| 3698 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3699 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3700 | -C "error" \ |
| 3701 | -s "Extra-header:" |
| 3702 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3703 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3704 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3705 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3706 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3707 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3708 | "$P_CLI debug_level=3" \ |
| 3709 | 0 \ |
| 3710 | -c "found renegotiation extension" \ |
| 3711 | -C "error" \ |
| 3712 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3713 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3714 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3715 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3716 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3717 | "$P_CLI debug_level=3" \ |
| 3718 | 0 \ |
| 3719 | -C "found renegotiation extension" \ |
| 3720 | -C "error" \ |
| 3721 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3722 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3723 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3724 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3725 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3726 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3727 | 1 \ |
| 3728 | -C "found renegotiation extension" \ |
| 3729 | -c "error" \ |
| 3730 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3731 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3732 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3733 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3734 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3735 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3736 | 0 \ |
| 3737 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3738 | -s "server hello, secure renegotiation extension" |
| 3739 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3740 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3741 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3742 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3743 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3744 | 0 \ |
| 3745 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3746 | -S "server hello, secure renegotiation extension" |
| 3747 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3748 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3749 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3750 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3751 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3752 | 1 \ |
| 3753 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3754 | -S "server hello, secure renegotiation extension" |
| 3755 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3756 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3757 | |
| 3758 | requires_gnutls |
| 3759 | run_test "DER format: no trailing bytes" \ |
| 3760 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3761 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3762 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3763 | 0 \ |
| 3764 | -c "Handshake was completed" \ |
| 3765 | |
| 3766 | requires_gnutls |
| 3767 | run_test "DER format: with a trailing zero byte" \ |
| 3768 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3769 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3770 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3771 | 0 \ |
| 3772 | -c "Handshake was completed" \ |
| 3773 | |
| 3774 | requires_gnutls |
| 3775 | run_test "DER format: with a trailing random byte" \ |
| 3776 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3777 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3778 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3779 | 0 \ |
| 3780 | -c "Handshake was completed" \ |
| 3781 | |
| 3782 | requires_gnutls |
| 3783 | run_test "DER format: with 2 trailing random bytes" \ |
| 3784 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3785 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3786 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3787 | 0 \ |
| 3788 | -c "Handshake was completed" \ |
| 3789 | |
| 3790 | requires_gnutls |
| 3791 | run_test "DER format: with 4 trailing random bytes" \ |
| 3792 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3793 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3794 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3795 | 0 \ |
| 3796 | -c "Handshake was completed" \ |
| 3797 | |
| 3798 | requires_gnutls |
| 3799 | run_test "DER format: with 8 trailing random bytes" \ |
| 3800 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3801 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3802 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3803 | 0 \ |
| 3804 | -c "Handshake was completed" \ |
| 3805 | |
| 3806 | requires_gnutls |
| 3807 | run_test "DER format: with 9 trailing random bytes" \ |
| 3808 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3809 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3810 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3811 | 0 \ |
| 3812 | -c "Handshake was completed" \ |
| 3813 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3814 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3815 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3816 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3817 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3818 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3819 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3820 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3821 | 1 \ |
| 3822 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3823 | -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] | 3824 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3825 | -c "X509 - Certificate verification failed" |
| 3826 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3827 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3828 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3829 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3830 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3831 | 0 \ |
| 3832 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3833 | -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] | 3834 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3835 | -C "X509 - Certificate verification failed" |
| 3836 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3837 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3838 | "$P_SRV" \ |
| 3839 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3840 | 0 \ |
| 3841 | -c "x509_verify_cert() returned" \ |
| 3842 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3843 | -c "! Certificate verification flags"\ |
| 3844 | -C "! mbedtls_ssl_handshake returned" \ |
| 3845 | -C "X509 - Certificate verification failed" \ |
| 3846 | -C "SSL - No CA Chain is set, but required to operate" |
| 3847 | |
| 3848 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3849 | "$P_SRV" \ |
| 3850 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3851 | 1 \ |
| 3852 | -c "x509_verify_cert() returned" \ |
| 3853 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3854 | -c "! Certificate verification flags"\ |
| 3855 | -c "! mbedtls_ssl_handshake returned" \ |
| 3856 | -c "SSL - No CA Chain is set, but required to operate" |
| 3857 | |
| 3858 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3859 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3860 | # the client informs the server about the supported curves - it does, though, in the |
| 3861 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3862 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3863 | # different means to have the server ignoring the client's supported curve list. |
| 3864 | |
| 3865 | requires_config_enabled MBEDTLS_ECP_C |
| 3866 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3867 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3868 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3869 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3870 | 1 \ |
| 3871 | -c "bad certificate (EC key curve)"\ |
| 3872 | -c "! Certificate verification flags"\ |
| 3873 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3874 | |
| 3875 | requires_config_enabled MBEDTLS_ECP_C |
| 3876 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3877 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3878 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3879 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3880 | 1 \ |
| 3881 | -c "bad certificate (EC key curve)"\ |
| 3882 | -c "! Certificate verification flags"\ |
| 3883 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3884 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3885 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3886 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3887 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3888 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3889 | 0 \ |
| 3890 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3891 | -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] | 3892 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3893 | -C "X509 - Certificate verification failed" |
| 3894 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3895 | run_test "Authentication: client SHA256, server required" \ |
| 3896 | "$P_SRV auth_mode=required" \ |
| 3897 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3898 | key_file=data_files/server6.key \ |
| 3899 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3900 | 0 \ |
| 3901 | -c "Supported Signature Algorithm found: 4," \ |
| 3902 | -c "Supported Signature Algorithm found: 5," |
| 3903 | |
| 3904 | run_test "Authentication: client SHA384, server required" \ |
| 3905 | "$P_SRV auth_mode=required" \ |
| 3906 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3907 | key_file=data_files/server6.key \ |
| 3908 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3909 | 0 \ |
| 3910 | -c "Supported Signature Algorithm found: 4," \ |
| 3911 | -c "Supported Signature Algorithm found: 5," |
| 3912 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3913 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3914 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3915 | "$P_CLI debug_level=3 crt_file=none \ |
| 3916 | key_file=data_files/server5.key" \ |
| 3917 | 1 \ |
| 3918 | -S "skip write certificate request" \ |
| 3919 | -C "skip parse certificate request" \ |
| 3920 | -c "got a certificate request" \ |
| 3921 | -c "= write certificate$" \ |
| 3922 | -C "skip write certificate$" \ |
| 3923 | -S "x509_verify_cert() returned" \ |
| 3924 | -s "client has no certificate" \ |
| 3925 | -s "! mbedtls_ssl_handshake returned" \ |
| 3926 | -c "! mbedtls_ssl_handshake returned" \ |
| 3927 | -s "No client certification received from the client, but required by the authentication mode" |
| 3928 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3929 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3930 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3931 | "$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] | 3932 | key_file=data_files/server5.key" \ |
| 3933 | 1 \ |
| 3934 | -S "skip write certificate request" \ |
| 3935 | -C "skip parse certificate request" \ |
| 3936 | -c "got a certificate request" \ |
| 3937 | -C "skip write certificate" \ |
| 3938 | -C "skip write certificate verify" \ |
| 3939 | -S "skip parse certificate verify" \ |
| 3940 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3941 | -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] | 3942 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3943 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3944 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3945 | -s "X509 - Certificate verification failed" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3946 | # We don't check that the client receives the alert because it might |
| 3947 | # detect that its write end of the connection is closed and abort |
| 3948 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3949 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 3950 | run_test "Authentication: client cert not trusted, server required" \ |
| 3951 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3952 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 3953 | key_file=data_files/server5.key" \ |
| 3954 | 1 \ |
| 3955 | -S "skip write certificate request" \ |
| 3956 | -C "skip parse certificate request" \ |
| 3957 | -c "got a certificate request" \ |
| 3958 | -C "skip write certificate" \ |
| 3959 | -C "skip write certificate verify" \ |
| 3960 | -S "skip parse certificate verify" \ |
| 3961 | -s "x509_verify_cert() returned" \ |
| 3962 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 3963 | -s "! mbedtls_ssl_handshake returned" \ |
| 3964 | -c "! mbedtls_ssl_handshake returned" \ |
| 3965 | -s "X509 - Certificate verification failed" |
| 3966 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3967 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3968 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 3969 | "$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] | 3970 | key_file=data_files/server5.key" \ |
| 3971 | 0 \ |
| 3972 | -S "skip write certificate request" \ |
| 3973 | -C "skip parse certificate request" \ |
| 3974 | -c "got a certificate request" \ |
| 3975 | -C "skip write certificate" \ |
| 3976 | -C "skip write certificate verify" \ |
| 3977 | -S "skip parse certificate verify" \ |
| 3978 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3979 | -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] | 3980 | -S "! mbedtls_ssl_handshake returned" \ |
| 3981 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3982 | -S "X509 - Certificate verification failed" |
| 3983 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3984 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3985 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 3986 | "$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] | 3987 | key_file=data_files/server5.key" \ |
| 3988 | 0 \ |
| 3989 | -s "skip write certificate request" \ |
| 3990 | -C "skip parse certificate request" \ |
| 3991 | -c "got no certificate request" \ |
| 3992 | -c "skip write certificate" \ |
| 3993 | -c "skip write certificate verify" \ |
| 3994 | -s "skip parse certificate verify" \ |
| 3995 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3996 | -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] | 3997 | -S "! mbedtls_ssl_handshake returned" \ |
| 3998 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3999 | -S "X509 - Certificate verification failed" |
| 4000 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4001 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4002 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4003 | "$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] | 4004 | 0 \ |
| 4005 | -S "skip write certificate request" \ |
| 4006 | -C "skip parse certificate request" \ |
| 4007 | -c "got a certificate request" \ |
| 4008 | -C "skip write certificate$" \ |
| 4009 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4010 | -c "skip write certificate verify" \ |
| 4011 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4012 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4013 | -S "! mbedtls_ssl_handshake returned" \ |
| 4014 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4015 | -S "X509 - Certificate verification failed" |
| 4016 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4017 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4018 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4019 | "$O_CLI" \ |
| 4020 | 0 \ |
| 4021 | -S "skip write certificate request" \ |
| 4022 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4023 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4024 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4025 | -S "X509 - Certificate verification failed" |
| 4026 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4027 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4028 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4029 | "$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] | 4030 | 0 \ |
| 4031 | -C "skip parse certificate request" \ |
| 4032 | -c "got a certificate request" \ |
| 4033 | -C "skip write certificate$" \ |
| 4034 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4035 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4036 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4037 | run_test "Authentication: client no cert, openssl server required" \ |
| 4038 | "$O_SRV -Verify 10" \ |
| 4039 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4040 | 1 \ |
| 4041 | -C "skip parse certificate request" \ |
| 4042 | -c "got a certificate request" \ |
| 4043 | -C "skip write certificate$" \ |
| 4044 | -c "skip write certificate verify" \ |
| 4045 | -c "! mbedtls_ssl_handshake returned" |
| 4046 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4047 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4048 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4049 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4050 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4051 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4052 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4053 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4054 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4055 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4056 | # 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] | 4057 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4058 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4059 | run_test "Authentication: server max_int chain, client default" \ |
| 4060 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4061 | key_file=data_files/dir-maxpath/09.key" \ |
| 4062 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4063 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4064 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4065 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4066 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4067 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4068 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4069 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4070 | key_file=data_files/dir-maxpath/10.key" \ |
| 4071 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4072 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4073 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4074 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4075 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4076 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4077 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4078 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4079 | key_file=data_files/dir-maxpath/10.key" \ |
| 4080 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4081 | auth_mode=optional" \ |
| 4082 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4083 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4084 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4085 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4086 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4087 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4088 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4089 | key_file=data_files/dir-maxpath/10.key" \ |
| 4090 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4091 | auth_mode=none" \ |
| 4092 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4093 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4094 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4095 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4096 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4097 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4098 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4099 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4100 | key_file=data_files/dir-maxpath/10.key" \ |
| 4101 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4102 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4103 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4104 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4105 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4106 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4107 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4108 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4109 | key_file=data_files/dir-maxpath/10.key" \ |
| 4110 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4111 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4112 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4113 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4114 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4115 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4116 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4117 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4118 | key_file=data_files/dir-maxpath/10.key" \ |
| 4119 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4120 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4121 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4122 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4123 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4124 | run_test "Authentication: client max_int chain, server required" \ |
| 4125 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4126 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4127 | key_file=data_files/dir-maxpath/09.key" \ |
| 4128 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4129 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4130 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4131 | # Tests for CA list in CertificateRequest messages |
| 4132 | |
| 4133 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4134 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4135 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4136 | key_file=data_files/server6.key" \ |
| 4137 | 0 \ |
| 4138 | -s "requested DN" |
| 4139 | |
| 4140 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4141 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4142 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4143 | key_file=data_files/server6.key" \ |
| 4144 | 0 \ |
| 4145 | -S "requested DN" |
| 4146 | |
| 4147 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4148 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4149 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4150 | key_file=data_files/server5.key" \ |
| 4151 | 1 \ |
| 4152 | -S "requested DN" \ |
| 4153 | -s "x509_verify_cert() returned" \ |
| 4154 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4155 | -s "! mbedtls_ssl_handshake returned" \ |
| 4156 | -c "! mbedtls_ssl_handshake returned" \ |
| 4157 | -s "X509 - Certificate verification failed" |
| 4158 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4159 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4160 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4161 | |
| 4162 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4163 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4164 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4165 | key_file=data_files/server5.key" \ |
| 4166 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4167 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4168 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4169 | -c "x509_verify_cert() returned" \ |
| 4170 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4171 | -c "! mbedtls_ssl_handshake returned" \ |
| 4172 | -c "X509 - Certificate verification failed" |
| 4173 | |
| 4174 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4175 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4176 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4177 | key_file=data_files/server5.key" \ |
| 4178 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4179 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4180 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4181 | -c "x509_verify_cert() returned" \ |
| 4182 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4183 | -C "! mbedtls_ssl_handshake returned" \ |
| 4184 | -C "X509 - Certificate verification failed" |
| 4185 | |
| 4186 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4187 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4188 | # the client informs the server about the supported curves - it does, though, in the |
| 4189 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4190 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4191 | # different means to have the server ignoring the client's supported curve list. |
| 4192 | |
| 4193 | requires_config_enabled MBEDTLS_ECP_C |
| 4194 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4195 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4196 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4197 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4198 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4199 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4200 | -c "use CA callback for X.509 CRT verification" \ |
| 4201 | -c "bad certificate (EC key curve)" \ |
| 4202 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4203 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4204 | |
| 4205 | requires_config_enabled MBEDTLS_ECP_C |
| 4206 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4207 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4208 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4209 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4210 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4211 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4212 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4213 | -c "bad certificate (EC key curve)"\ |
| 4214 | -c "! Certificate verification flags"\ |
| 4215 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4216 | |
| 4217 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4218 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4219 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4220 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4221 | key_file=data_files/server6.key \ |
| 4222 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4223 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4224 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4225 | -c "Supported Signature Algorithm found: 4," \ |
| 4226 | -c "Supported Signature Algorithm found: 5," |
| 4227 | |
| 4228 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4229 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4230 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4231 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4232 | key_file=data_files/server6.key \ |
| 4233 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4234 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4235 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4236 | -c "Supported Signature Algorithm found: 4," \ |
| 4237 | -c "Supported Signature Algorithm found: 5," |
| 4238 | |
| 4239 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4240 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4241 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4242 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4243 | key_file=data_files/server5.key" \ |
| 4244 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4245 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4246 | -S "skip write certificate request" \ |
| 4247 | -C "skip parse certificate request" \ |
| 4248 | -c "got a certificate request" \ |
| 4249 | -C "skip write certificate" \ |
| 4250 | -C "skip write certificate verify" \ |
| 4251 | -S "skip parse certificate verify" \ |
| 4252 | -s "x509_verify_cert() returned" \ |
| 4253 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4254 | -s "! mbedtls_ssl_handshake returned" \ |
| 4255 | -s "send alert level=2 message=48" \ |
| 4256 | -c "! mbedtls_ssl_handshake returned" \ |
| 4257 | -s "X509 - Certificate verification failed" |
| 4258 | # We don't check that the client receives the alert because it might |
| 4259 | # detect that its write end of the connection is closed and abort |
| 4260 | # before reading the alert message. |
| 4261 | |
| 4262 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4263 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4264 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4265 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4266 | key_file=data_files/server5.key" \ |
| 4267 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4268 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4269 | -S "skip write certificate request" \ |
| 4270 | -C "skip parse certificate request" \ |
| 4271 | -c "got a certificate request" \ |
| 4272 | -C "skip write certificate" \ |
| 4273 | -C "skip write certificate verify" \ |
| 4274 | -S "skip parse certificate verify" \ |
| 4275 | -s "x509_verify_cert() returned" \ |
| 4276 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4277 | -s "! mbedtls_ssl_handshake returned" \ |
| 4278 | -c "! mbedtls_ssl_handshake returned" \ |
| 4279 | -s "X509 - Certificate verification failed" |
| 4280 | |
| 4281 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4282 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4283 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4284 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4285 | key_file=data_files/server5.key" \ |
| 4286 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4287 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4288 | -S "skip write certificate request" \ |
| 4289 | -C "skip parse certificate request" \ |
| 4290 | -c "got a certificate request" \ |
| 4291 | -C "skip write certificate" \ |
| 4292 | -C "skip write certificate verify" \ |
| 4293 | -S "skip parse certificate verify" \ |
| 4294 | -s "x509_verify_cert() returned" \ |
| 4295 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4296 | -S "! mbedtls_ssl_handshake returned" \ |
| 4297 | -C "! mbedtls_ssl_handshake returned" \ |
| 4298 | -S "X509 - Certificate verification failed" |
| 4299 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4300 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4301 | requires_full_size_output_buffer |
| 4302 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4303 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4304 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4305 | key_file=data_files/dir-maxpath/09.key" \ |
| 4306 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4307 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4308 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4309 | -C "X509 - A fatal error occurred" |
| 4310 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4311 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4312 | requires_full_size_output_buffer |
| 4313 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4314 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4315 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4316 | key_file=data_files/dir-maxpath/10.key" \ |
| 4317 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4318 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4319 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4320 | -c "X509 - A fatal error occurred" |
| 4321 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4322 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4323 | requires_full_size_output_buffer |
| 4324 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4325 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4326 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4327 | key_file=data_files/dir-maxpath/10.key" \ |
| 4328 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4329 | debug_level=3 auth_mode=optional" \ |
| 4330 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4331 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4332 | -c "X509 - A fatal error occurred" |
| 4333 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4334 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4335 | requires_full_size_output_buffer |
| 4336 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4337 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4338 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4339 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4340 | key_file=data_files/dir-maxpath/10.key" \ |
| 4341 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4342 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4343 | -s "X509 - A fatal error occurred" |
| 4344 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4345 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4346 | requires_full_size_output_buffer |
| 4347 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4348 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4349 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4350 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4351 | key_file=data_files/dir-maxpath/10.key" \ |
| 4352 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4353 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4354 | -s "X509 - A fatal error occurred" |
| 4355 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4356 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4357 | requires_full_size_output_buffer |
| 4358 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4359 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4360 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4361 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4362 | key_file=data_files/dir-maxpath/09.key" \ |
| 4363 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4364 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4365 | -S "X509 - A fatal error occurred" |
| 4366 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4367 | # Tests for certificate selection based on SHA verson |
| 4368 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4369 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4370 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4371 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4372 | key_file=data_files/server5.key \ |
| 4373 | crt_file2=data_files/server5-sha1.crt \ |
| 4374 | key_file2=data_files/server5.key" \ |
| 4375 | "$P_CLI force_version=tls1_2" \ |
| 4376 | 0 \ |
| 4377 | -c "signed using.*ECDSA with SHA256" \ |
| 4378 | -C "signed using.*ECDSA with SHA1" |
| 4379 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4380 | # tests for SNI |
| 4381 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4382 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4383 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4384 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4385 | 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] | 4386 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4387 | 0 \ |
| 4388 | -S "parse ServerName extension" \ |
| 4389 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4390 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4391 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4392 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4393 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4394 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4395 | 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] | 4396 | 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] | 4397 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4398 | 0 \ |
| 4399 | -s "parse ServerName extension" \ |
| 4400 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4401 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4402 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4403 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4404 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4405 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4406 | 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] | 4407 | 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] | 4408 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4409 | 0 \ |
| 4410 | -s "parse ServerName extension" \ |
| 4411 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4412 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4413 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4414 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4415 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4416 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4417 | 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] | 4418 | 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] | 4419 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4420 | 1 \ |
| 4421 | -s "parse ServerName extension" \ |
| 4422 | -s "ssl_sni_wrapper() returned" \ |
| 4423 | -s "mbedtls_ssl_handshake returned" \ |
| 4424 | -c "mbedtls_ssl_handshake returned" \ |
| 4425 | -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] | 4426 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4427 | run_test "SNI: client auth no override: optional" \ |
| 4428 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4429 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4430 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4431 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4432 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4433 | -S "skip write certificate request" \ |
| 4434 | -C "skip parse certificate request" \ |
| 4435 | -c "got a certificate request" \ |
| 4436 | -C "skip write certificate" \ |
| 4437 | -C "skip write certificate verify" \ |
| 4438 | -S "skip parse certificate verify" |
| 4439 | |
| 4440 | run_test "SNI: client auth override: none -> optional" \ |
| 4441 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4442 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4443 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4444 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4445 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4446 | -S "skip write certificate request" \ |
| 4447 | -C "skip parse certificate request" \ |
| 4448 | -c "got a certificate request" \ |
| 4449 | -C "skip write certificate" \ |
| 4450 | -C "skip write certificate verify" \ |
| 4451 | -S "skip parse certificate verify" |
| 4452 | |
| 4453 | run_test "SNI: client auth override: optional -> none" \ |
| 4454 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4455 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4456 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4457 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4458 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4459 | -s "skip write certificate request" \ |
| 4460 | -C "skip parse certificate request" \ |
| 4461 | -c "got no certificate request" \ |
| 4462 | -c "skip write certificate" \ |
| 4463 | -c "skip write certificate verify" \ |
| 4464 | -s "skip parse certificate verify" |
| 4465 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4466 | run_test "SNI: CA no override" \ |
| 4467 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4468 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4469 | ca_file=data_files/test-ca.crt \ |
| 4470 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4471 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4472 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4473 | 1 \ |
| 4474 | -S "skip write certificate request" \ |
| 4475 | -C "skip parse certificate request" \ |
| 4476 | -c "got a certificate request" \ |
| 4477 | -C "skip write certificate" \ |
| 4478 | -C "skip write certificate verify" \ |
| 4479 | -S "skip parse certificate verify" \ |
| 4480 | -s "x509_verify_cert() returned" \ |
| 4481 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4482 | -S "The certificate has been revoked (is on a CRL)" |
| 4483 | |
| 4484 | run_test "SNI: CA override" \ |
| 4485 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4486 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4487 | ca_file=data_files/test-ca.crt \ |
| 4488 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4489 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4490 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4491 | 0 \ |
| 4492 | -S "skip write certificate request" \ |
| 4493 | -C "skip parse certificate request" \ |
| 4494 | -c "got a certificate request" \ |
| 4495 | -C "skip write certificate" \ |
| 4496 | -C "skip write certificate verify" \ |
| 4497 | -S "skip parse certificate verify" \ |
| 4498 | -S "x509_verify_cert() returned" \ |
| 4499 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4500 | -S "The certificate has been revoked (is on a CRL)" |
| 4501 | |
| 4502 | run_test "SNI: CA override with CRL" \ |
| 4503 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4504 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4505 | ca_file=data_files/test-ca.crt \ |
| 4506 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4507 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4508 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4509 | 1 \ |
| 4510 | -S "skip write certificate request" \ |
| 4511 | -C "skip parse certificate request" \ |
| 4512 | -c "got a certificate request" \ |
| 4513 | -C "skip write certificate" \ |
| 4514 | -C "skip write certificate verify" \ |
| 4515 | -S "skip parse certificate verify" \ |
| 4516 | -s "x509_verify_cert() returned" \ |
| 4517 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4518 | -s "The certificate has been revoked (is on a CRL)" |
| 4519 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4520 | # Tests for SNI and DTLS |
| 4521 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4522 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4523 | run_test "SNI: DTLS, no SNI callback" \ |
| 4524 | "$P_SRV debug_level=3 dtls=1 \ |
| 4525 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4526 | "$P_CLI server_name=localhost dtls=1" \ |
| 4527 | 0 \ |
| 4528 | -S "parse ServerName extension" \ |
| 4529 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4530 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4531 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4532 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4533 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4534 | "$P_SRV debug_level=3 dtls=1 \ |
| 4535 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4536 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4537 | "$P_CLI server_name=localhost dtls=1" \ |
| 4538 | 0 \ |
| 4539 | -s "parse ServerName extension" \ |
| 4540 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4541 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4542 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4543 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4544 | run_test "SNI: DTLS, matching cert 2" \ |
| 4545 | "$P_SRV debug_level=3 dtls=1 \ |
| 4546 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4547 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4548 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4549 | 0 \ |
| 4550 | -s "parse ServerName extension" \ |
| 4551 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4552 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4553 | |
| 4554 | run_test "SNI: DTLS, no matching cert" \ |
| 4555 | "$P_SRV debug_level=3 dtls=1 \ |
| 4556 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4557 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4558 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4559 | 1 \ |
| 4560 | -s "parse ServerName extension" \ |
| 4561 | -s "ssl_sni_wrapper() returned" \ |
| 4562 | -s "mbedtls_ssl_handshake returned" \ |
| 4563 | -c "mbedtls_ssl_handshake returned" \ |
| 4564 | -c "SSL - A fatal alert message was received from our peer" |
| 4565 | |
| 4566 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4567 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4568 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4569 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4570 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4571 | 0 \ |
| 4572 | -S "skip write certificate request" \ |
| 4573 | -C "skip parse certificate request" \ |
| 4574 | -c "got a certificate request" \ |
| 4575 | -C "skip write certificate" \ |
| 4576 | -C "skip write certificate verify" \ |
| 4577 | -S "skip parse certificate verify" |
| 4578 | |
| 4579 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4580 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4581 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4582 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4583 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4584 | 0 \ |
| 4585 | -S "skip write certificate request" \ |
| 4586 | -C "skip parse certificate request" \ |
| 4587 | -c "got a certificate request" \ |
| 4588 | -C "skip write certificate" \ |
| 4589 | -C "skip write certificate verify" \ |
| 4590 | -S "skip parse certificate verify" |
| 4591 | |
| 4592 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4593 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4594 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4595 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4596 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4597 | 0 \ |
| 4598 | -s "skip write certificate request" \ |
| 4599 | -C "skip parse certificate request" \ |
| 4600 | -c "got no certificate request" \ |
| 4601 | -c "skip write certificate" \ |
| 4602 | -c "skip write certificate verify" \ |
| 4603 | -s "skip parse certificate verify" |
| 4604 | |
| 4605 | run_test "SNI: DTLS, CA no override" \ |
| 4606 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4607 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4608 | ca_file=data_files/test-ca.crt \ |
| 4609 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4610 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4611 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4612 | 1 \ |
| 4613 | -S "skip write certificate request" \ |
| 4614 | -C "skip parse certificate request" \ |
| 4615 | -c "got a certificate request" \ |
| 4616 | -C "skip write certificate" \ |
| 4617 | -C "skip write certificate verify" \ |
| 4618 | -S "skip parse certificate verify" \ |
| 4619 | -s "x509_verify_cert() returned" \ |
| 4620 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4621 | -S "The certificate has been revoked (is on a CRL)" |
| 4622 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4623 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4624 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4625 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4626 | ca_file=data_files/test-ca.crt \ |
| 4627 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4628 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4629 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4630 | 0 \ |
| 4631 | -S "skip write certificate request" \ |
| 4632 | -C "skip parse certificate request" \ |
| 4633 | -c "got a certificate request" \ |
| 4634 | -C "skip write certificate" \ |
| 4635 | -C "skip write certificate verify" \ |
| 4636 | -S "skip parse certificate verify" \ |
| 4637 | -S "x509_verify_cert() returned" \ |
| 4638 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4639 | -S "The certificate has been revoked (is on a CRL)" |
| 4640 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4641 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4642 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4643 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4644 | ca_file=data_files/test-ca.crt \ |
| 4645 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4646 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4647 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4648 | 1 \ |
| 4649 | -S "skip write certificate request" \ |
| 4650 | -C "skip parse certificate request" \ |
| 4651 | -c "got a certificate request" \ |
| 4652 | -C "skip write certificate" \ |
| 4653 | -C "skip write certificate verify" \ |
| 4654 | -S "skip parse certificate verify" \ |
| 4655 | -s "x509_verify_cert() returned" \ |
| 4656 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4657 | -s "The certificate has been revoked (is on a CRL)" |
| 4658 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4659 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4660 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4661 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4662 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4663 | "$P_CLI nbio=2 tickets=0" \ |
| 4664 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4665 | -S "mbedtls_ssl_handshake returned" \ |
| 4666 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4667 | -c "Read from server: .* bytes read" |
| 4668 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4669 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4670 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4671 | "$P_CLI nbio=2 tickets=0" \ |
| 4672 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4673 | -S "mbedtls_ssl_handshake returned" \ |
| 4674 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4675 | -c "Read from server: .* bytes read" |
| 4676 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4677 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4678 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4679 | "$P_CLI nbio=2 tickets=1" \ |
| 4680 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4681 | -S "mbedtls_ssl_handshake returned" \ |
| 4682 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4683 | -c "Read from server: .* bytes read" |
| 4684 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4685 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4686 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4687 | "$P_CLI nbio=2 tickets=1" \ |
| 4688 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4689 | -S "mbedtls_ssl_handshake returned" \ |
| 4690 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4691 | -c "Read from server: .* bytes read" |
| 4692 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4693 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4694 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4695 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4696 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4697 | -S "mbedtls_ssl_handshake returned" \ |
| 4698 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4699 | -c "Read from server: .* bytes read" |
| 4700 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4701 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4702 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4703 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4704 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4705 | -S "mbedtls_ssl_handshake returned" \ |
| 4706 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4707 | -c "Read from server: .* bytes read" |
| 4708 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4709 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4710 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4711 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4712 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4713 | -S "mbedtls_ssl_handshake returned" \ |
| 4714 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4715 | -c "Read from server: .* bytes read" |
| 4716 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4717 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4718 | |
| 4719 | run_test "Event-driven I/O: basic handshake" \ |
| 4720 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4721 | "$P_CLI event=1 tickets=0" \ |
| 4722 | 0 \ |
| 4723 | -S "mbedtls_ssl_handshake returned" \ |
| 4724 | -C "mbedtls_ssl_handshake returned" \ |
| 4725 | -c "Read from server: .* bytes read" |
| 4726 | |
| 4727 | run_test "Event-driven I/O: client auth" \ |
| 4728 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4729 | "$P_CLI event=1 tickets=0" \ |
| 4730 | 0 \ |
| 4731 | -S "mbedtls_ssl_handshake returned" \ |
| 4732 | -C "mbedtls_ssl_handshake returned" \ |
| 4733 | -c "Read from server: .* bytes read" |
| 4734 | |
| 4735 | run_test "Event-driven I/O: ticket" \ |
| 4736 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4737 | "$P_CLI event=1 tickets=1" \ |
| 4738 | 0 \ |
| 4739 | -S "mbedtls_ssl_handshake returned" \ |
| 4740 | -C "mbedtls_ssl_handshake returned" \ |
| 4741 | -c "Read from server: .* bytes read" |
| 4742 | |
| 4743 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4744 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4745 | "$P_CLI event=1 tickets=1" \ |
| 4746 | 0 \ |
| 4747 | -S "mbedtls_ssl_handshake returned" \ |
| 4748 | -C "mbedtls_ssl_handshake returned" \ |
| 4749 | -c "Read from server: .* bytes read" |
| 4750 | |
| 4751 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4752 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4753 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4754 | 0 \ |
| 4755 | -S "mbedtls_ssl_handshake returned" \ |
| 4756 | -C "mbedtls_ssl_handshake returned" \ |
| 4757 | -c "Read from server: .* bytes read" |
| 4758 | |
| 4759 | run_test "Event-driven I/O: ticket + resume" \ |
| 4760 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4761 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4762 | 0 \ |
| 4763 | -S "mbedtls_ssl_handshake returned" \ |
| 4764 | -C "mbedtls_ssl_handshake returned" \ |
| 4765 | -c "Read from server: .* bytes read" |
| 4766 | |
| 4767 | run_test "Event-driven I/O: session-id resume" \ |
| 4768 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4769 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4770 | 0 \ |
| 4771 | -S "mbedtls_ssl_handshake returned" \ |
| 4772 | -C "mbedtls_ssl_handshake returned" \ |
| 4773 | -c "Read from server: .* bytes read" |
| 4774 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4775 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4776 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4777 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4778 | 0 \ |
| 4779 | -c "Read from server: .* bytes read" |
| 4780 | |
| 4781 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4782 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4783 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4784 | 0 \ |
| 4785 | -c "Read from server: .* bytes read" |
| 4786 | |
| 4787 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4788 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4789 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4790 | 0 \ |
| 4791 | -c "Read from server: .* bytes read" |
| 4792 | |
| 4793 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4794 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4795 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4796 | 0 \ |
| 4797 | -c "Read from server: .* bytes read" |
| 4798 | |
| 4799 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4800 | "$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] | 4801 | "$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] | 4802 | 0 \ |
| 4803 | -c "Read from server: .* bytes read" |
| 4804 | |
| 4805 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4806 | "$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] | 4807 | "$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] | 4808 | 0 \ |
| 4809 | -c "Read from server: .* bytes read" |
| 4810 | |
| 4811 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4812 | "$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] | 4813 | "$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] | 4814 | 0 \ |
| 4815 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4816 | |
| 4817 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4818 | # During session resumption, the client will send its ApplicationData record |
| 4819 | # within the same datagram as the Finished messages. In this situation, the |
| 4820 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4821 | # because the ApplicationData request has already been queued internally. |
| 4822 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4823 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4824 | "$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] | 4825 | "$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] | 4826 | 0 \ |
| 4827 | -c "Read from server: .* bytes read" |
| 4828 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4829 | # Tests for version negotiation |
| 4830 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4831 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4832 | "$P_SRV" \ |
| 4833 | "$P_CLI" \ |
| 4834 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4835 | -S "mbedtls_ssl_handshake returned" \ |
| 4836 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4837 | -s "Protocol is TLSv1.2" \ |
| 4838 | -c "Protocol is TLSv1.2" |
| 4839 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 4840 | run_test "Not supported version check: cli TLS 1.0" \ |
| 4841 | "$P_SRV" \ |
| 4842 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 4843 | 1 \ |
| 4844 | -s "Handshake protocol not within min/max boundaries" \ |
| 4845 | -c "Error in protocol version" \ |
| 4846 | -S "Protocol is TLSv1.0" \ |
| 4847 | -C "Handshake was completed" |
| 4848 | |
| 4849 | run_test "Not supported version check: cli TLS 1.1" \ |
| 4850 | "$P_SRV" \ |
| 4851 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 4852 | 1 \ |
| 4853 | -s "Handshake protocol not within min/max boundaries" \ |
| 4854 | -c "Error in protocol version" \ |
| 4855 | -S "Protocol is TLSv1.1" \ |
| 4856 | -C "Handshake was completed" |
| 4857 | |
| 4858 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 4859 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 4860 | "$P_CLI" \ |
| 4861 | 1 \ |
| 4862 | -s "Error in protocol version" \ |
| 4863 | -c "Handshake protocol not within min/max boundaries" \ |
| 4864 | -S "Version: TLS1.0" \ |
| 4865 | -C "Protocol is TLSv1.0" |
| 4866 | |
| 4867 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 4868 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 4869 | "$P_CLI" \ |
| 4870 | 1 \ |
| 4871 | -s "Error in protocol version" \ |
| 4872 | -c "Handshake protocol not within min/max boundaries" \ |
| 4873 | -S "Version: TLS1.1" \ |
| 4874 | -C "Protocol is TLSv1.1" |
| 4875 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4876 | # Tests for ALPN extension |
| 4877 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4878 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4879 | "$P_SRV debug_level=3" \ |
| 4880 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4881 | 0 \ |
| 4882 | -C "client hello, adding alpn extension" \ |
| 4883 | -S "found alpn extension" \ |
| 4884 | -C "got an alert message, type: \\[2:120]" \ |
| 4885 | -S "server hello, adding alpn extension" \ |
| 4886 | -C "found alpn extension " \ |
| 4887 | -C "Application Layer Protocol is" \ |
| 4888 | -S "Application Layer Protocol is" |
| 4889 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4890 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4891 | "$P_SRV debug_level=3" \ |
| 4892 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4893 | 0 \ |
| 4894 | -c "client hello, adding alpn extension" \ |
| 4895 | -s "found alpn extension" \ |
| 4896 | -C "got an alert message, type: \\[2:120]" \ |
| 4897 | -S "server hello, adding alpn extension" \ |
| 4898 | -C "found alpn extension " \ |
| 4899 | -c "Application Layer Protocol is (none)" \ |
| 4900 | -S "Application Layer Protocol is" |
| 4901 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4902 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4903 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4904 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4905 | 0 \ |
| 4906 | -C "client hello, adding alpn extension" \ |
| 4907 | -S "found alpn extension" \ |
| 4908 | -C "got an alert message, type: \\[2:120]" \ |
| 4909 | -S "server hello, adding alpn extension" \ |
| 4910 | -C "found alpn extension " \ |
| 4911 | -C "Application Layer Protocol is" \ |
| 4912 | -s "Application Layer Protocol is (none)" |
| 4913 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4914 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4915 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4916 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4917 | 0 \ |
| 4918 | -c "client hello, adding alpn extension" \ |
| 4919 | -s "found alpn extension" \ |
| 4920 | -C "got an alert message, type: \\[2:120]" \ |
| 4921 | -s "server hello, adding alpn extension" \ |
| 4922 | -c "found alpn extension" \ |
| 4923 | -c "Application Layer Protocol is abc" \ |
| 4924 | -s "Application Layer Protocol is abc" |
| 4925 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4926 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4927 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4928 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4929 | 0 \ |
| 4930 | -c "client hello, adding alpn extension" \ |
| 4931 | -s "found alpn extension" \ |
| 4932 | -C "got an alert message, type: \\[2:120]" \ |
| 4933 | -s "server hello, adding alpn extension" \ |
| 4934 | -c "found alpn extension" \ |
| 4935 | -c "Application Layer Protocol is abc" \ |
| 4936 | -s "Application Layer Protocol is abc" |
| 4937 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4938 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4939 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4940 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4941 | 0 \ |
| 4942 | -c "client hello, adding alpn extension" \ |
| 4943 | -s "found alpn extension" \ |
| 4944 | -C "got an alert message, type: \\[2:120]" \ |
| 4945 | -s "server hello, adding alpn extension" \ |
| 4946 | -c "found alpn extension" \ |
| 4947 | -c "Application Layer Protocol is 1234" \ |
| 4948 | -s "Application Layer Protocol is 1234" |
| 4949 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4950 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4951 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 4952 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4953 | 1 \ |
| 4954 | -c "client hello, adding alpn extension" \ |
| 4955 | -s "found alpn extension" \ |
| 4956 | -c "got an alert message, type: \\[2:120]" \ |
| 4957 | -S "server hello, adding alpn extension" \ |
| 4958 | -C "found alpn extension" \ |
| 4959 | -C "Application Layer Protocol is 1234" \ |
| 4960 | -S "Application Layer Protocol is 1234" |
| 4961 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 4962 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4963 | # Tests for keyUsage in leaf certificates, part 1: |
| 4964 | # server-side certificate/suite selection |
| 4965 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4966 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4967 | "$P_SRV key_file=data_files/server2.key \ |
| 4968 | crt_file=data_files/server2.ku-ds.crt" \ |
| 4969 | "$P_CLI" \ |
| 4970 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 4971 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4972 | |
| 4973 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4974 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4975 | "$P_SRV key_file=data_files/server2.key \ |
| 4976 | crt_file=data_files/server2.ku-ke.crt" \ |
| 4977 | "$P_CLI" \ |
| 4978 | 0 \ |
| 4979 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 4980 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4981 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4982 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4983 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 4984 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4985 | 1 \ |
| 4986 | -C "Ciphersuite is " |
| 4987 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4988 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4989 | "$P_SRV key_file=data_files/server5.key \ |
| 4990 | crt_file=data_files/server5.ku-ds.crt" \ |
| 4991 | "$P_CLI" \ |
| 4992 | 0 \ |
| 4993 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 4994 | |
| 4995 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4996 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 4997 | "$P_SRV key_file=data_files/server5.key \ |
| 4998 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4999 | "$P_CLI" \ |
| 5000 | 0 \ |
| 5001 | -c "Ciphersuite is TLS-ECDH-" |
| 5002 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5003 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5004 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5005 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5006 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5007 | 1 \ |
| 5008 | -C "Ciphersuite is " |
| 5009 | |
| 5010 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5011 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5012 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5013 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5014 | "$O_SRV -key data_files/server2.key \ |
| 5015 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5016 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5017 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5018 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5019 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5020 | -C "Processing of the Certificate handshake message failed" \ |
| 5021 | -c "Ciphersuite is TLS-" |
| 5022 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5023 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5024 | "$O_SRV -key data_files/server2.key \ |
| 5025 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5026 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5027 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5028 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5029 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5030 | -C "Processing of the Certificate handshake message failed" \ |
| 5031 | -c "Ciphersuite is TLS-" |
| 5032 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5033 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5034 | "$O_SRV -key data_files/server2.key \ |
| 5035 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5036 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5037 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5038 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5039 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5040 | -C "Processing of the Certificate handshake message failed" \ |
| 5041 | -c "Ciphersuite is TLS-" |
| 5042 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5043 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5044 | "$O_SRV -key data_files/server2.key \ |
| 5045 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5046 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5047 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5048 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5049 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5050 | -c "Processing of the Certificate handshake message failed" \ |
| 5051 | -C "Ciphersuite is TLS-" |
| 5052 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5053 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5054 | "$O_SRV -key data_files/server2.key \ |
| 5055 | -cert data_files/server2.ku-ke.crt" \ |
| 5056 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5057 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5058 | 0 \ |
| 5059 | -c "bad certificate (usage extensions)" \ |
| 5060 | -C "Processing of the Certificate handshake message failed" \ |
| 5061 | -c "Ciphersuite is TLS-" \ |
| 5062 | -c "! Usage does not match the keyUsage extension" |
| 5063 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5064 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5065 | "$O_SRV -key data_files/server2.key \ |
| 5066 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5067 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5068 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5069 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5070 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5071 | -C "Processing of the Certificate handshake message failed" \ |
| 5072 | -c "Ciphersuite is TLS-" |
| 5073 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5074 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5075 | "$O_SRV -key data_files/server2.key \ |
| 5076 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5077 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5078 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5079 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5080 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5081 | -c "Processing of the Certificate handshake message failed" \ |
| 5082 | -C "Ciphersuite is TLS-" |
| 5083 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5084 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5085 | "$O_SRV -key data_files/server2.key \ |
| 5086 | -cert data_files/server2.ku-ds.crt" \ |
| 5087 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5088 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5089 | 0 \ |
| 5090 | -c "bad certificate (usage extensions)" \ |
| 5091 | -C "Processing of the Certificate handshake message failed" \ |
| 5092 | -c "Ciphersuite is TLS-" \ |
| 5093 | -c "! Usage does not match the keyUsage extension" |
| 5094 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5095 | # Tests for keyUsage in leaf certificates, part 3: |
| 5096 | # server-side checking of client cert |
| 5097 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5098 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5099 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5100 | "$O_CLI -key data_files/server2.key \ |
| 5101 | -cert data_files/server2.ku-ds.crt" \ |
| 5102 | 0 \ |
| 5103 | -S "bad certificate (usage extensions)" \ |
| 5104 | -S "Processing of the Certificate handshake message failed" |
| 5105 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5106 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5107 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5108 | "$O_CLI -key data_files/server2.key \ |
| 5109 | -cert data_files/server2.ku-ke.crt" \ |
| 5110 | 0 \ |
| 5111 | -s "bad certificate (usage extensions)" \ |
| 5112 | -S "Processing of the Certificate handshake message failed" |
| 5113 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5114 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5115 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5116 | "$O_CLI -key data_files/server2.key \ |
| 5117 | -cert data_files/server2.ku-ke.crt" \ |
| 5118 | 1 \ |
| 5119 | -s "bad certificate (usage extensions)" \ |
| 5120 | -s "Processing of the Certificate handshake message failed" |
| 5121 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5122 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5123 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5124 | "$O_CLI -key data_files/server5.key \ |
| 5125 | -cert data_files/server5.ku-ds.crt" \ |
| 5126 | 0 \ |
| 5127 | -S "bad certificate (usage extensions)" \ |
| 5128 | -S "Processing of the Certificate handshake message failed" |
| 5129 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5130 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5131 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5132 | "$O_CLI -key data_files/server5.key \ |
| 5133 | -cert data_files/server5.ku-ka.crt" \ |
| 5134 | 0 \ |
| 5135 | -s "bad certificate (usage extensions)" \ |
| 5136 | -S "Processing of the Certificate handshake message failed" |
| 5137 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5138 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5139 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5140 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5141 | "$P_SRV key_file=data_files/server5.key \ |
| 5142 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5143 | "$P_CLI" \ |
| 5144 | 0 |
| 5145 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5146 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5147 | "$P_SRV key_file=data_files/server5.key \ |
| 5148 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5149 | "$P_CLI" \ |
| 5150 | 0 |
| 5151 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5152 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5153 | "$P_SRV key_file=data_files/server5.key \ |
| 5154 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5155 | "$P_CLI" \ |
| 5156 | 0 |
| 5157 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5158 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5159 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5160 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5161 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5162 | 1 |
| 5163 | |
| 5164 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5165 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5166 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5167 | "$O_SRV -key data_files/server5.key \ |
| 5168 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5169 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5170 | 0 \ |
| 5171 | -C "bad certificate (usage extensions)" \ |
| 5172 | -C "Processing of the Certificate handshake message failed" \ |
| 5173 | -c "Ciphersuite is TLS-" |
| 5174 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5175 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5176 | "$O_SRV -key data_files/server5.key \ |
| 5177 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5178 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5179 | 0 \ |
| 5180 | -C "bad certificate (usage extensions)" \ |
| 5181 | -C "Processing of the Certificate handshake message failed" \ |
| 5182 | -c "Ciphersuite is TLS-" |
| 5183 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5184 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5185 | "$O_SRV -key data_files/server5.key \ |
| 5186 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5187 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5188 | 0 \ |
| 5189 | -C "bad certificate (usage extensions)" \ |
| 5190 | -C "Processing of the Certificate handshake message failed" \ |
| 5191 | -c "Ciphersuite is TLS-" |
| 5192 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5193 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5194 | "$O_SRV -key data_files/server5.key \ |
| 5195 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5196 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5197 | 1 \ |
| 5198 | -c "bad certificate (usage extensions)" \ |
| 5199 | -c "Processing of the Certificate handshake message failed" \ |
| 5200 | -C "Ciphersuite is TLS-" |
| 5201 | |
| 5202 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5203 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5204 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5205 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5206 | "$O_CLI -key data_files/server5.key \ |
| 5207 | -cert data_files/server5.eku-cli.crt" \ |
| 5208 | 0 \ |
| 5209 | -S "bad certificate (usage extensions)" \ |
| 5210 | -S "Processing of the Certificate handshake message failed" |
| 5211 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5212 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5213 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5214 | "$O_CLI -key data_files/server5.key \ |
| 5215 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5216 | 0 \ |
| 5217 | -S "bad certificate (usage extensions)" \ |
| 5218 | -S "Processing of the Certificate handshake message failed" |
| 5219 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5220 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5221 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5222 | "$O_CLI -key data_files/server5.key \ |
| 5223 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5224 | 0 \ |
| 5225 | -S "bad certificate (usage extensions)" \ |
| 5226 | -S "Processing of the Certificate handshake message failed" |
| 5227 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5228 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5229 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5230 | "$O_CLI -key data_files/server5.key \ |
| 5231 | -cert data_files/server5.eku-cs.crt" \ |
| 5232 | 0 \ |
| 5233 | -s "bad certificate (usage extensions)" \ |
| 5234 | -S "Processing of the Certificate handshake message failed" |
| 5235 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5236 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5237 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5238 | "$O_CLI -key data_files/server5.key \ |
| 5239 | -cert data_files/server5.eku-cs.crt" \ |
| 5240 | 1 \ |
| 5241 | -s "bad certificate (usage extensions)" \ |
| 5242 | -s "Processing of the Certificate handshake message failed" |
| 5243 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5244 | # Tests for DHM parameters loading |
| 5245 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5246 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5247 | "$P_SRV" \ |
| 5248 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5249 | debug_level=3" \ |
| 5250 | 0 \ |
| 5251 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5252 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5253 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5254 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5255 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5256 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5257 | debug_level=3" \ |
| 5258 | 0 \ |
| 5259 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5260 | -c "value of 'DHM: G ' (2 bits)" |
| 5261 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5262 | # Tests for DHM client-side size checking |
| 5263 | |
| 5264 | run_test "DHM size: server default, client default, OK" \ |
| 5265 | "$P_SRV" \ |
| 5266 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5267 | debug_level=1" \ |
| 5268 | 0 \ |
| 5269 | -C "DHM prime too short:" |
| 5270 | |
| 5271 | run_test "DHM size: server default, client 2048, OK" \ |
| 5272 | "$P_SRV" \ |
| 5273 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5274 | debug_level=1 dhmlen=2048" \ |
| 5275 | 0 \ |
| 5276 | -C "DHM prime too short:" |
| 5277 | |
| 5278 | run_test "DHM size: server 1024, client default, OK" \ |
| 5279 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5280 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5281 | debug_level=1" \ |
| 5282 | 0 \ |
| 5283 | -C "DHM prime too short:" |
| 5284 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5285 | run_test "DHM size: server 999, client 999, OK" \ |
| 5286 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5287 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5288 | debug_level=1 dhmlen=999" \ |
| 5289 | 0 \ |
| 5290 | -C "DHM prime too short:" |
| 5291 | |
| 5292 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5293 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5294 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5295 | debug_level=1 dhmlen=1000" \ |
| 5296 | 0 \ |
| 5297 | -C "DHM prime too short:" |
| 5298 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5299 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5300 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5301 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5302 | debug_level=1" \ |
| 5303 | 1 \ |
| 5304 | -c "DHM prime too short:" |
| 5305 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5306 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5307 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5308 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5309 | debug_level=1 dhmlen=1001" \ |
| 5310 | 1 \ |
| 5311 | -c "DHM prime too short:" |
| 5312 | |
| 5313 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5314 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5315 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5316 | debug_level=1 dhmlen=1000" \ |
| 5317 | 1 \ |
| 5318 | -c "DHM prime too short:" |
| 5319 | |
| 5320 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5321 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5322 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5323 | debug_level=1 dhmlen=999" \ |
| 5324 | 1 \ |
| 5325 | -c "DHM prime too short:" |
| 5326 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5327 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5328 | "$P_SRV" \ |
| 5329 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5330 | debug_level=1 dhmlen=2049" \ |
| 5331 | 1 \ |
| 5332 | -c "DHM prime too short:" |
| 5333 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5334 | # Tests for PSK callback |
| 5335 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5336 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5337 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5338 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5339 | psk_identity=foo psk=abc123" \ |
| 5340 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5341 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5342 | -S "SSL - Unknown identity received" \ |
| 5343 | -S "SSL - Verification of the message MAC failed" |
| 5344 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5345 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5346 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5347 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5348 | "$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] | 5349 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5350 | 0 \ |
| 5351 | -c "skip PMS generation for opaque PSK"\ |
| 5352 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5353 | -C "session hash for extended master secret"\ |
| 5354 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5355 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5356 | -S "SSL - Unknown identity received" \ |
| 5357 | -S "SSL - Verification of the message MAC failed" |
| 5358 | |
| 5359 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5360 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5361 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5362 | "$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] | 5363 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5364 | 0 \ |
| 5365 | -c "skip PMS generation for opaque PSK"\ |
| 5366 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5367 | -C "session hash for extended master secret"\ |
| 5368 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5369 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5370 | -S "SSL - Unknown identity received" \ |
| 5371 | -S "SSL - Verification of the message MAC failed" |
| 5372 | |
| 5373 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5374 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5375 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5376 | "$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] | 5377 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5378 | 0 \ |
| 5379 | -c "skip PMS generation for opaque PSK"\ |
| 5380 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5381 | -c "session hash for extended master secret"\ |
| 5382 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5383 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5384 | -S "SSL - Unknown identity received" \ |
| 5385 | -S "SSL - Verification of the message MAC failed" |
| 5386 | |
| 5387 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5388 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5389 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5390 | "$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] | 5391 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5392 | 0 \ |
| 5393 | -c "skip PMS generation for opaque PSK"\ |
| 5394 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5395 | -c "session hash for extended master secret"\ |
| 5396 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5397 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5398 | -S "SSL - Unknown identity received" \ |
| 5399 | -S "SSL - Verification of the message MAC failed" |
| 5400 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5401 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5402 | 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] | 5403 | "$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] | 5404 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5405 | psk_identity=foo psk=abc123" \ |
| 5406 | 0 \ |
| 5407 | -C "skip PMS generation for opaque PSK"\ |
| 5408 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5409 | -C "session hash for extended master secret"\ |
| 5410 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5411 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5412 | -S "SSL - Unknown identity received" \ |
| 5413 | -S "SSL - Verification of the message MAC failed" |
| 5414 | |
| 5415 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5416 | 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] | 5417 | "$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] | 5418 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5419 | psk_identity=foo psk=abc123" \ |
| 5420 | 0 \ |
| 5421 | -C "skip PMS generation for opaque PSK"\ |
| 5422 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5423 | -C "session hash for extended master secret"\ |
| 5424 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5425 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5426 | -S "SSL - Unknown identity received" \ |
| 5427 | -S "SSL - Verification of the message MAC failed" |
| 5428 | |
| 5429 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5430 | 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] | 5431 | "$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] | 5432 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5433 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5434 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5435 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5436 | -c "session hash for extended master secret"\ |
| 5437 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5438 | -C "skip PMS generation for opaque PSK"\ |
| 5439 | -s "skip PMS generation for opaque PSK"\ |
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, SHA384" \ |
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-256-CBC-SHA384 extended_ms=1" \ |
| 5448 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 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, no static PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5461 | "$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] | 5462 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5463 | psk_identity=def psk=beef" \ |
| 5464 | 0 \ |
| 5465 | -C "skip PMS generation for opaque PSK"\ |
| 5466 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5467 | -C "session hash for extended master secret"\ |
| 5468 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5469 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5470 | -S "SSL - Unknown identity received" \ |
| 5471 | -S "SSL - Verification of the message MAC failed" |
| 5472 | |
| 5473 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5474 | 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] | 5475 | "$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] | 5476 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5477 | psk_identity=def psk=beef" \ |
| 5478 | 0 \ |
| 5479 | -C "skip PMS generation for opaque PSK"\ |
| 5480 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5481 | -C "session hash for extended master secret"\ |
| 5482 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5483 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5484 | -S "SSL - Unknown identity received" \ |
| 5485 | -S "SSL - Verification of the message MAC failed" |
| 5486 | |
| 5487 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5488 | 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] | 5489 | "$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] | 5490 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5491 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5492 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5493 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5494 | -c "session hash for extended master secret"\ |
| 5495 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5496 | -C "skip PMS generation for opaque PSK"\ |
| 5497 | -s "skip PMS generation for opaque PSK"\ |
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, SHA384" \ |
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-256-CBC-SHA384 extended_ms=1" \ |
| 5506 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 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, mismatching static raw PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5519 | "$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] | 5520 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5521 | psk_identity=def psk=beef" \ |
| 5522 | 0 \ |
| 5523 | -C "skip PMS generation for opaque PSK"\ |
| 5524 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5525 | -C "session hash for extended master secret"\ |
| 5526 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5527 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5528 | -S "SSL - Unknown identity received" \ |
| 5529 | -S "SSL - Verification of the message MAC failed" |
| 5530 | |
| 5531 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5532 | 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] | 5533 | "$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] | 5534 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5535 | psk_identity=def psk=beef" \ |
| 5536 | 0 \ |
| 5537 | -C "skip PMS generation for opaque PSK"\ |
| 5538 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5539 | -C "session hash for extended master secret"\ |
| 5540 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5541 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5542 | -S "SSL - Unknown identity received" \ |
| 5543 | -S "SSL - Verification of the message MAC failed" |
| 5544 | |
| 5545 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5546 | 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] | 5547 | "$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] | 5548 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5549 | psk_identity=def psk=beef" \ |
| 5550 | 0 \ |
| 5551 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5552 | -C "session hash for extended master secret"\ |
| 5553 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5554 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5555 | -S "SSL - Unknown identity received" \ |
| 5556 | -S "SSL - Verification of the message MAC failed" |
| 5557 | |
| 5558 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5559 | 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] | 5560 | "$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] | 5561 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5562 | psk_identity=def psk=beef" \ |
| 5563 | 0 \ |
| 5564 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5565 | -C "session hash for extended master secret"\ |
| 5566 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5567 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5568 | -S "SSL - Unknown identity received" \ |
| 5569 | -S "SSL - Verification of the message MAC failed" |
| 5570 | |
| 5571 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5572 | 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] | 5573 | "$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] | 5574 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5575 | psk_identity=def psk=beef" \ |
| 5576 | 1 \ |
| 5577 | -s "SSL - Verification of the message MAC failed" |
| 5578 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5579 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5580 | "$P_SRV" \ |
| 5581 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5582 | psk_identity=foo psk=abc123" \ |
| 5583 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5584 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5585 | -S "SSL - Unknown identity received" \ |
| 5586 | -S "SSL - Verification of the message MAC failed" |
| 5587 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5588 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5589 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5590 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5591 | psk_identity=foo psk=abc123" \ |
| 5592 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5593 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5594 | -s "SSL - Unknown identity received" \ |
| 5595 | -S "SSL - Verification of the message MAC failed" |
| 5596 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5597 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5598 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5599 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5600 | psk_identity=abc psk=dead" \ |
| 5601 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5602 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5603 | -S "SSL - Unknown identity received" \ |
| 5604 | -S "SSL - Verification of the message MAC failed" |
| 5605 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5606 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5607 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5608 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5609 | psk_identity=def psk=beef" \ |
| 5610 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5611 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5612 | -S "SSL - Unknown identity received" \ |
| 5613 | -S "SSL - Verification of the message MAC failed" |
| 5614 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5615 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5616 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5617 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5618 | psk_identity=ghi psk=beef" \ |
| 5619 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5620 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5621 | -s "SSL - Unknown identity received" \ |
| 5622 | -S "SSL - Verification of the message MAC failed" |
| 5623 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5624 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5625 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5626 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5627 | psk_identity=abc psk=beef" \ |
| 5628 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5629 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5630 | -S "SSL - Unknown identity received" \ |
| 5631 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5632 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5633 | # Tests for EC J-PAKE |
| 5634 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5635 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5636 | run_test "ECJPAKE: client not configured" \ |
| 5637 | "$P_SRV debug_level=3" \ |
| 5638 | "$P_CLI debug_level=3" \ |
| 5639 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5640 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5641 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5642 | -S "found ecjpake kkpp extension" \ |
| 5643 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5644 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5645 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5646 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5647 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5648 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5649 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5650 | run_test "ECJPAKE: server not configured" \ |
| 5651 | "$P_SRV debug_level=3" \ |
| 5652 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5653 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5654 | 1 \ |
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 | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5665 | run_test "ECJPAKE: working, TLS" \ |
| 5666 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5667 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5668 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5669 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5670 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5671 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5672 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5673 | -s "found ecjpake kkpp extension" \ |
| 5674 | -S "skip ecjpake kkpp extension" \ |
| 5675 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5676 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5677 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5678 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5679 | -S "SSL - Verification of the message MAC failed" |
| 5680 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5681 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5682 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5683 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5684 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5685 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5686 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5687 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5688 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5689 | -s "SSL - Verification of the message MAC failed" |
| 5690 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5691 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5692 | run_test "ECJPAKE: working, DTLS" \ |
| 5693 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5694 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5695 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5696 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5697 | -c "re-using cached ecjpake parameters" \ |
| 5698 | -S "SSL - Verification of the message MAC failed" |
| 5699 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5700 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5701 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5702 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5703 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5704 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5705 | 0 \ |
| 5706 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5707 | -S "SSL - Verification of the message MAC failed" |
| 5708 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5709 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5710 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5711 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5712 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5713 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5714 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5715 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5716 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5717 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5718 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5719 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5720 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5721 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5722 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5723 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5724 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5725 | 0 |
| 5726 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5727 | # Test for ClientHello without extensions |
| 5728 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5729 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5730 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5731 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5732 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5733 | 0 \ |
| 5734 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5735 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5736 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5737 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5738 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5739 | "$P_SRV" \ |
| 5740 | "$P_CLI request_size=100" \ |
| 5741 | 0 \ |
| 5742 | -s "Read from client: 100 bytes read$" |
| 5743 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5744 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5745 | "$P_SRV" \ |
| 5746 | "$P_CLI request_size=500" \ |
| 5747 | 0 \ |
| 5748 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5749 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5750 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5751 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5752 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5753 | "$P_SRV" \ |
| 5754 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5755 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5756 | 0 \ |
| 5757 | -s "Read from client: 1 bytes read" |
| 5758 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5759 | 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] | 5760 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5761 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5762 | 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] | 5763 | 0 \ |
| 5764 | -s "Read from client: 1 bytes read" |
| 5765 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5766 | 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] | 5767 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5768 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5769 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5770 | 0 \ |
| 5771 | -s "Read from client: 1 bytes read" |
| 5772 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5773 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5774 | "$P_SRV" \ |
| 5775 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5776 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5777 | 0 \ |
| 5778 | -s "Read from client: 1 bytes read" |
| 5779 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5780 | 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] | 5781 | "$P_SRV" \ |
| 5782 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5783 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5784 | 0 \ |
| 5785 | -s "Read from client: 1 bytes read" |
| 5786 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5787 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5788 | |
| 5789 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5790 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5791 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5792 | "$P_CLI dtls=1 request_size=1 \ |
| 5793 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5794 | 0 \ |
| 5795 | -s "Read from client: 1 bytes read" |
| 5796 | |
| 5797 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5798 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5799 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5800 | "$P_CLI dtls=1 request_size=1 \ |
| 5801 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5802 | 0 \ |
| 5803 | -s "Read from client: 1 bytes read" |
| 5804 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5805 | # Tests for small server packets |
| 5806 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5807 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5808 | "$P_SRV response_size=1" \ |
| 5809 | "$P_CLI force_version=tls1_2 \ |
| 5810 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5811 | 0 \ |
| 5812 | -c "Read from server: 1 bytes read" |
| 5813 | |
| 5814 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5815 | "$P_SRV response_size=1" \ |
| 5816 | "$P_CLI force_version=tls1_2 \ |
| 5817 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5818 | 0 \ |
| 5819 | -c "Read from server: 1 bytes read" |
| 5820 | |
| 5821 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5822 | "$P_SRV response_size=1" \ |
| 5823 | "$P_CLI force_version=tls1_2 \ |
| 5824 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5825 | 0 \ |
| 5826 | -c "Read from server: 1 bytes read" |
| 5827 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5828 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5829 | "$P_SRV response_size=1" \ |
| 5830 | "$P_CLI force_version=tls1_2 \ |
| 5831 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5832 | 0 \ |
| 5833 | -c "Read from server: 1 bytes read" |
| 5834 | |
| 5835 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5836 | "$P_SRV response_size=1" \ |
| 5837 | "$P_CLI force_version=tls1_2 \ |
| 5838 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5839 | 0 \ |
| 5840 | -c "Read from server: 1 bytes read" |
| 5841 | |
| 5842 | # Tests for small server packets in DTLS |
| 5843 | |
| 5844 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5845 | run_test "Small server packet DTLS 1.2" \ |
| 5846 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5847 | "$P_CLI dtls=1 \ |
| 5848 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5849 | 0 \ |
| 5850 | -c "Read from server: 1 bytes read" |
| 5851 | |
| 5852 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5853 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5854 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5855 | "$P_CLI dtls=1 \ |
| 5856 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5857 | 0 \ |
| 5858 | -c "Read from server: 1 bytes read" |
| 5859 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5860 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5861 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5862 | # How many fragments do we expect to write $1 bytes? |
| 5863 | fragments_for_write() { |
| 5864 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5865 | } |
| 5866 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5867 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5868 | "$P_SRV" \ |
| 5869 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5870 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5871 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5872 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5873 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5874 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5875 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5876 | "$P_SRV" \ |
| 5877 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5878 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5879 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5880 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5881 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5882 | 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] | 5883 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5884 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5885 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 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 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5891 | "$P_SRV" \ |
| 5892 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5893 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5894 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5895 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5896 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5897 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5898 | 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] | 5899 | "$P_SRV" \ |
| 5900 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5901 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5902 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5903 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5904 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5905 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 5906 | # 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] | 5907 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5908 | "$P_SRV response_size=16384" \ |
| 5909 | "$P_CLI force_version=tls1_2 \ |
| 5910 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5911 | 0 \ |
| 5912 | -c "Read from server: 16384 bytes read" |
| 5913 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5914 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5915 | "$P_SRV response_size=16384" \ |
| 5916 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5917 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5918 | 0 \ |
| 5919 | -s "16384 bytes written in 1 fragments" \ |
| 5920 | -c "Read from server: 16384 bytes read" |
| 5921 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5922 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5923 | "$P_SRV response_size=16384" \ |
| 5924 | "$P_CLI force_version=tls1_2 \ |
| 5925 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 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, truncated MAC" \ |
| 5930 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5931 | "$P_CLI force_version=tls1_2 \ |
| 5932 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 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 AEAD" \ |
| 5938 | "$P_SRV response_size=16384" \ |
| 5939 | "$P_CLI force_version=tls1_2 \ |
| 5940 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5941 | 0 \ |
| 5942 | -c "Read from server: 16384 bytes read" |
| 5943 | |
| 5944 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5945 | "$P_SRV response_size=16384" \ |
| 5946 | "$P_CLI force_version=tls1_2 \ |
| 5947 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5948 | 0 \ |
| 5949 | -c "Read from server: 16384 bytes read" |
| 5950 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5951 | # Tests for restartable ECC |
| 5952 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5953 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 5954 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5955 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5956 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5957 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5958 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5959 | "$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] | 5960 | 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] | 5961 | debug_level=1" \ |
| 5962 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5963 | -C "x509_verify_cert.*4b00" \ |
| 5964 | -C "mbedtls_pk_verify.*4b00" \ |
| 5965 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5966 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5967 | |
| 5968 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5969 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5970 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5971 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5972 | "$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] | 5973 | 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] | 5974 | debug_level=1 ec_max_ops=0" \ |
| 5975 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5976 | -C "x509_verify_cert.*4b00" \ |
| 5977 | -C "mbedtls_pk_verify.*4b00" \ |
| 5978 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5979 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5980 | |
| 5981 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5982 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5983 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5984 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5985 | "$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] | 5986 | 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] | 5987 | debug_level=1 ec_max_ops=65535" \ |
| 5988 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 5989 | -C "x509_verify_cert.*4b00" \ |
| 5990 | -C "mbedtls_pk_verify.*4b00" \ |
| 5991 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 5992 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5993 | |
| 5994 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5995 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5996 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 5997 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 5998 | "$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] | 5999 | 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] | 6000 | debug_level=1 ec_max_ops=1000" \ |
| 6001 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6002 | -c "x509_verify_cert.*4b00" \ |
| 6003 | -c "mbedtls_pk_verify.*4b00" \ |
| 6004 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6005 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6006 | |
| 6007 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6008 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6009 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6010 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6011 | crt_file=data_files/server5-badsign.crt \ |
| 6012 | key_file=data_files/server5.key" \ |
| 6013 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6014 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6015 | debug_level=1 ec_max_ops=1000" \ |
| 6016 | 1 \ |
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 | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6021 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6022 | -c "! mbedtls_ssl_handshake returned" \ |
| 6023 | -c "X509 - Certificate verification failed" |
| 6024 | |
| 6025 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6026 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6027 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6028 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6029 | crt_file=data_files/server5-badsign.crt \ |
| 6030 | key_file=data_files/server5.key" \ |
| 6031 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6032 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6033 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6034 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6035 | -c "x509_verify_cert.*4b00" \ |
| 6036 | -c "mbedtls_pk_verify.*4b00" \ |
| 6037 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6038 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6039 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6040 | -C "! mbedtls_ssl_handshake returned" \ |
| 6041 | -C "X509 - Certificate verification failed" |
| 6042 | |
| 6043 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6044 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6045 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6046 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6047 | crt_file=data_files/server5-badsign.crt \ |
| 6048 | key_file=data_files/server5.key" \ |
| 6049 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6050 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6051 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6052 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6053 | -C "x509_verify_cert.*4b00" \ |
| 6054 | -c "mbedtls_pk_verify.*4b00" \ |
| 6055 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6056 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6057 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6058 | -C "! mbedtls_ssl_handshake returned" \ |
| 6059 | -C "X509 - Certificate verification failed" |
| 6060 | |
| 6061 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6062 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6063 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6064 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6065 | "$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] | 6066 | 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] | 6067 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6068 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6069 | -c "x509_verify_cert.*4b00" \ |
| 6070 | -c "mbedtls_pk_verify.*4b00" \ |
| 6071 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6072 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6073 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6074 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6075 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6076 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6077 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6078 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6079 | debug_level=1 ec_max_ops=1000" \ |
| 6080 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6081 | -c "x509_verify_cert.*4b00" \ |
| 6082 | -c "mbedtls_pk_verify.*4b00" \ |
| 6083 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6084 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6085 | |
| 6086 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6087 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6088 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6089 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6090 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6091 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6092 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6093 | -C "x509_verify_cert.*4b00" \ |
| 6094 | -C "mbedtls_pk_verify.*4b00" \ |
| 6095 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6096 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6097 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6098 | # Tests of asynchronous private key support in SSL |
| 6099 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6100 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6101 | run_test "SSL async private: sign, delay=0" \ |
| 6102 | "$P_SRV \ |
| 6103 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6104 | "$P_CLI" \ |
| 6105 | 0 \ |
| 6106 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6107 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6108 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6109 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6110 | run_test "SSL async private: sign, delay=1" \ |
| 6111 | "$P_SRV \ |
| 6112 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6113 | "$P_CLI" \ |
| 6114 | 0 \ |
| 6115 | -s "Async sign callback: using key slot " \ |
| 6116 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6117 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6118 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6119 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6120 | run_test "SSL async private: sign, delay=2" \ |
| 6121 | "$P_SRV \ |
| 6122 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6123 | "$P_CLI" \ |
| 6124 | 0 \ |
| 6125 | -s "Async sign callback: using key slot " \ |
| 6126 | -U "Async sign callback: using key slot " \ |
| 6127 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6128 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6129 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6130 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6131 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6132 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6133 | run_test "SSL async private: sign, SNI" \ |
| 6134 | "$P_SRV debug_level=3 \ |
| 6135 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6136 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6137 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6138 | "$P_CLI server_name=polarssl.example" \ |
| 6139 | 0 \ |
| 6140 | -s "Async sign callback: using key slot " \ |
| 6141 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6142 | -s "parse ServerName extension" \ |
| 6143 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6144 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6145 | |
| 6146 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6147 | run_test "SSL async private: decrypt, delay=0" \ |
| 6148 | "$P_SRV \ |
| 6149 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6150 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6151 | 0 \ |
| 6152 | -s "Async decrypt callback: using key slot " \ |
| 6153 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6154 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6155 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6156 | run_test "SSL async private: decrypt, delay=1" \ |
| 6157 | "$P_SRV \ |
| 6158 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6159 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6160 | 0 \ |
| 6161 | -s "Async decrypt callback: using key slot " \ |
| 6162 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6163 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6164 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6165 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6166 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6167 | "$P_SRV psk=abc123 \ |
| 6168 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6169 | "$P_CLI psk=abc123 \ |
| 6170 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6171 | 0 \ |
| 6172 | -s "Async decrypt callback: using key slot " \ |
| 6173 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6174 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6175 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6176 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6177 | "$P_SRV psk=abc123 \ |
| 6178 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6179 | "$P_CLI psk=abc123 \ |
| 6180 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6181 | 0 \ |
| 6182 | -s "Async decrypt callback: using key slot " \ |
| 6183 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6184 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6185 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6186 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6187 | run_test "SSL async private: sign callback not present" \ |
| 6188 | "$P_SRV \ |
| 6189 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6190 | "$P_CLI; [ \$? -eq 1 ] && |
| 6191 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6192 | 0 \ |
| 6193 | -S "Async sign callback" \ |
| 6194 | -s "! mbedtls_ssl_handshake returned" \ |
| 6195 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6196 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6197 | -s "Successful connection" |
| 6198 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6199 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6200 | run_test "SSL async private: decrypt callback not present" \ |
| 6201 | "$P_SRV debug_level=1 \ |
| 6202 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6203 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6204 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6205 | 0 \ |
| 6206 | -S "Async decrypt callback" \ |
| 6207 | -s "! mbedtls_ssl_handshake returned" \ |
| 6208 | -s "got no RSA private key" \ |
| 6209 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6210 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6211 | |
| 6212 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6213 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6214 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6215 | "$P_SRV \ |
| 6216 | async_operations=s async_private_delay1=1 \ |
| 6217 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6218 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6219 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6220 | 0 \ |
| 6221 | -s "Async sign callback: using key slot 0," \ |
| 6222 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6223 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6224 | |
| 6225 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6226 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6227 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6228 | "$P_SRV \ |
| 6229 | async_operations=s async_private_delay2=1 \ |
| 6230 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6231 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6232 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6233 | 0 \ |
| 6234 | -s "Async sign callback: using key slot 0," \ |
| 6235 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6236 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6237 | |
| 6238 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6239 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6240 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6241 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6242 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6243 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6244 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6245 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6246 | 0 \ |
| 6247 | -s "Async sign callback: using key slot 1," \ |
| 6248 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6249 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6250 | |
| 6251 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6252 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6253 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6254 | "$P_SRV \ |
| 6255 | async_operations=s async_private_delay1=1 \ |
| 6256 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6257 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6258 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6259 | 0 \ |
| 6260 | -s "Async sign callback: no key matches this certificate." |
| 6261 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6262 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6263 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6264 | "$P_SRV \ |
| 6265 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6266 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6267 | "$P_CLI" \ |
| 6268 | 1 \ |
| 6269 | -s "Async sign callback: injected error" \ |
| 6270 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6271 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6272 | -s "! mbedtls_ssl_handshake returned" |
| 6273 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6274 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6275 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6276 | "$P_SRV \ |
| 6277 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6278 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6279 | "$P_CLI" \ |
| 6280 | 1 \ |
| 6281 | -s "Async sign callback: using key slot " \ |
| 6282 | -S "Async resume" \ |
| 6283 | -s "Async cancel" |
| 6284 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6285 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6286 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6287 | "$P_SRV \ |
| 6288 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6289 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6290 | "$P_CLI" \ |
| 6291 | 1 \ |
| 6292 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6293 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6294 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6295 | -s "! mbedtls_ssl_handshake returned" |
| 6296 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6297 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6298 | run_test "SSL async private: decrypt, error in start" \ |
| 6299 | "$P_SRV \ |
| 6300 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6301 | async_private_error=1" \ |
| 6302 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6303 | 1 \ |
| 6304 | -s "Async decrypt callback: injected error" \ |
| 6305 | -S "Async resume" \ |
| 6306 | -S "Async cancel" \ |
| 6307 | -s "! mbedtls_ssl_handshake returned" |
| 6308 | |
| 6309 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6310 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6311 | "$P_SRV \ |
| 6312 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6313 | async_private_error=2" \ |
| 6314 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6315 | 1 \ |
| 6316 | -s "Async decrypt callback: using key slot " \ |
| 6317 | -S "Async resume" \ |
| 6318 | -s "Async cancel" |
| 6319 | |
| 6320 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6321 | run_test "SSL async private: decrypt, error in resume" \ |
| 6322 | "$P_SRV \ |
| 6323 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6324 | async_private_error=3" \ |
| 6325 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6326 | 1 \ |
| 6327 | -s "Async decrypt callback: using key slot " \ |
| 6328 | -s "Async resume callback: decrypt done but injected error" \ |
| 6329 | -S "Async cancel" \ |
| 6330 | -s "! mbedtls_ssl_handshake returned" |
| 6331 | |
| 6332 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6333 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6334 | "$P_SRV \ |
| 6335 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6336 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6337 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6338 | 0 \ |
| 6339 | -s "Async cancel" \ |
| 6340 | -s "! mbedtls_ssl_handshake returned" \ |
| 6341 | -s "Async resume" \ |
| 6342 | -s "Successful connection" |
| 6343 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6344 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6345 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6346 | "$P_SRV \ |
| 6347 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6348 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6349 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6350 | 0 \ |
| 6351 | -s "! mbedtls_ssl_handshake returned" \ |
| 6352 | -s "Async resume" \ |
| 6353 | -s "Successful connection" |
| 6354 | |
| 6355 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6356 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6357 | 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] | 6358 | "$P_SRV \ |
| 6359 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6360 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6361 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6362 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6363 | [ \$? -eq 1 ] && |
| 6364 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6365 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6366 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6367 | -S "Async resume" \ |
| 6368 | -s "Async cancel" \ |
| 6369 | -s "! mbedtls_ssl_handshake returned" \ |
| 6370 | -s "Async sign callback: no key matches this certificate." \ |
| 6371 | -s "Successful connection" |
| 6372 | |
| 6373 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6374 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6375 | 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] | 6376 | "$P_SRV \ |
| 6377 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6378 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6379 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6380 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6381 | [ \$? -eq 1 ] && |
| 6382 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6383 | 0 \ |
| 6384 | -s "Async resume" \ |
| 6385 | -s "! mbedtls_ssl_handshake returned" \ |
| 6386 | -s "Async sign callback: no key matches this certificate." \ |
| 6387 | -s "Successful connection" |
| 6388 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6389 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6390 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6391 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6392 | "$P_SRV \ |
| 6393 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6394 | exchanges=2 renegotiation=1" \ |
| 6395 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6396 | 0 \ |
| 6397 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6398 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6399 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6400 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6401 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6402 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6403 | "$P_SRV \ |
| 6404 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6405 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6406 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6407 | 0 \ |
| 6408 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6409 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6410 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6411 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6412 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6413 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6414 | "$P_SRV \ |
| 6415 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6416 | exchanges=2 renegotiation=1" \ |
| 6417 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6418 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6419 | 0 \ |
| 6420 | -s "Async decrypt callback: using key slot " \ |
| 6421 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6422 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6423 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6424 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6425 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6426 | "$P_SRV \ |
| 6427 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6428 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6429 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6430 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6431 | 0 \ |
| 6432 | -s "Async decrypt callback: using key slot " \ |
| 6433 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6434 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6435 | # Tests for ECC extensions (rfc 4492) |
| 6436 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6437 | requires_config_enabled MBEDTLS_AES_C |
| 6438 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6439 | requires_config_enabled MBEDTLS_SHA256_C |
| 6440 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6441 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6442 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6443 | "$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] | 6444 | 0 \ |
| 6445 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6446 | -C "client hello, adding supported_point_formats extension" \ |
| 6447 | -S "found supported elliptic curves extension" \ |
| 6448 | -S "found supported point formats extension" |
| 6449 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6450 | requires_config_enabled MBEDTLS_AES_C |
| 6451 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6452 | requires_config_enabled MBEDTLS_SHA256_C |
| 6453 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6454 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6455 | "$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] | 6456 | "$P_CLI debug_level=3" \ |
| 6457 | 0 \ |
| 6458 | -C "found supported_point_formats extension" \ |
| 6459 | -S "server hello, supported_point_formats extension" |
| 6460 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6461 | requires_config_enabled MBEDTLS_AES_C |
| 6462 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6463 | requires_config_enabled MBEDTLS_SHA256_C |
| 6464 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6465 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6466 | "$P_SRV debug_level=3" \ |
| 6467 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6468 | 0 \ |
| 6469 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6470 | -c "client hello, adding supported_point_formats extension" \ |
| 6471 | -s "found supported elliptic curves extension" \ |
| 6472 | -s "found supported point formats extension" |
| 6473 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6474 | requires_config_enabled MBEDTLS_AES_C |
| 6475 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6476 | requires_config_enabled MBEDTLS_SHA256_C |
| 6477 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6478 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6479 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6480 | "$P_CLI debug_level=3" \ |
| 6481 | 0 \ |
| 6482 | -c "found supported_point_formats extension" \ |
| 6483 | -s "server hello, supported_point_formats extension" |
| 6484 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6485 | # Tests for DTLS HelloVerifyRequest |
| 6486 | |
| 6487 | run_test "DTLS cookie: enabled" \ |
| 6488 | "$P_SRV dtls=1 debug_level=2" \ |
| 6489 | "$P_CLI dtls=1 debug_level=2" \ |
| 6490 | 0 \ |
| 6491 | -s "cookie verification failed" \ |
| 6492 | -s "cookie verification passed" \ |
| 6493 | -S "cookie verification skipped" \ |
| 6494 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6495 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6496 | -S "SSL - The requested feature is not available" |
| 6497 | |
| 6498 | run_test "DTLS cookie: disabled" \ |
| 6499 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6500 | "$P_CLI dtls=1 debug_level=2" \ |
| 6501 | 0 \ |
| 6502 | -S "cookie verification failed" \ |
| 6503 | -S "cookie verification passed" \ |
| 6504 | -s "cookie verification skipped" \ |
| 6505 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6506 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6507 | -S "SSL - The requested feature is not available" |
| 6508 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6509 | run_test "DTLS cookie: default (failing)" \ |
| 6510 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6511 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6512 | 1 \ |
| 6513 | -s "cookie verification failed" \ |
| 6514 | -S "cookie verification passed" \ |
| 6515 | -S "cookie verification skipped" \ |
| 6516 | -C "received hello verify request" \ |
| 6517 | -S "hello verification requested" \ |
| 6518 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6519 | |
| 6520 | requires_ipv6 |
| 6521 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6522 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6523 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6524 | 0 \ |
| 6525 | -s "cookie verification failed" \ |
| 6526 | -s "cookie verification passed" \ |
| 6527 | -S "cookie verification skipped" \ |
| 6528 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6529 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6530 | -S "SSL - The requested feature is not available" |
| 6531 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6532 | run_test "DTLS cookie: enabled, nbio" \ |
| 6533 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6534 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6535 | 0 \ |
| 6536 | -s "cookie verification failed" \ |
| 6537 | -s "cookie verification passed" \ |
| 6538 | -S "cookie verification skipped" \ |
| 6539 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6540 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6541 | -S "SSL - The requested feature is not available" |
| 6542 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6543 | # Tests for client reconnecting from the same port with DTLS |
| 6544 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6545 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6546 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6547 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6548 | "$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] | 6549 | 0 \ |
| 6550 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6551 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6552 | -S "Client initiated reconnection from same port" |
| 6553 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6554 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6555 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6556 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6557 | "$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] | 6558 | 0 \ |
| 6559 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6560 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6561 | -s "Client initiated reconnection from same port" |
| 6562 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6563 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6564 | 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] | 6565 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6566 | "$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] | 6567 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6568 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6569 | -s "Client initiated reconnection from same port" |
| 6570 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6571 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6572 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6573 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6574 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6575 | 0 \ |
| 6576 | -S "The operation timed out" \ |
| 6577 | -s "Client initiated reconnection from same port" |
| 6578 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6579 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6580 | "$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] | 6581 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6582 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6583 | -s "The operation timed out" \ |
| 6584 | -S "Client initiated reconnection from same port" |
| 6585 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6586 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6587 | -p "$P_PXY inject_clihlo=1" \ |
| 6588 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6589 | "$P_CLI dtls=1 exchanges=2" \ |
| 6590 | 0 \ |
| 6591 | -s "possible client reconnect from the same port" \ |
| 6592 | -S "Client initiated reconnection from same port" |
| 6593 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6594 | # Tests for various cases of client authentication with DTLS |
| 6595 | # (focused on handshake flows and message parsing) |
| 6596 | |
| 6597 | run_test "DTLS client auth: required" \ |
| 6598 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6599 | "$P_CLI dtls=1" \ |
| 6600 | 0 \ |
| 6601 | -s "Verifying peer X.509 certificate... ok" |
| 6602 | |
| 6603 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6604 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6605 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6606 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6607 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6608 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6609 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6610 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6611 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6612 | 0 \ |
| 6613 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6614 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6615 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6616 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6617 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6618 | "$P_CLI dtls=1 psk=abc124" \ |
| 6619 | 1 \ |
| 6620 | -s "SSL - Verification of the message MAC failed" \ |
| 6621 | -c "SSL - A fatal alert message was received from our peer" |
| 6622 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6623 | # Tests for receiving fragmented handshake messages with DTLS |
| 6624 | |
| 6625 | requires_gnutls |
| 6626 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6627 | "$G_SRV -u --mtu 2048 -a" \ |
| 6628 | "$P_CLI dtls=1 debug_level=2" \ |
| 6629 | 0 \ |
| 6630 | -C "found fragmented DTLS handshake message" \ |
| 6631 | -C "error" |
| 6632 | |
| 6633 | requires_gnutls |
| 6634 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6635 | "$G_SRV -u --mtu 512" \ |
| 6636 | "$P_CLI dtls=1 debug_level=2" \ |
| 6637 | 0 \ |
| 6638 | -c "found fragmented DTLS handshake message" \ |
| 6639 | -C "error" |
| 6640 | |
| 6641 | requires_gnutls |
| 6642 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6643 | "$G_SRV -u --mtu 128" \ |
| 6644 | "$P_CLI dtls=1 debug_level=2" \ |
| 6645 | 0 \ |
| 6646 | -c "found fragmented DTLS handshake message" \ |
| 6647 | -C "error" |
| 6648 | |
| 6649 | requires_gnutls |
| 6650 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6651 | "$G_SRV -u --mtu 128" \ |
| 6652 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6653 | 0 \ |
| 6654 | -c "found fragmented DTLS handshake message" \ |
| 6655 | -C "error" |
| 6656 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6657 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6658 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6659 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6660 | "$G_SRV -u --mtu 256" \ |
| 6661 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6662 | 0 \ |
| 6663 | -c "found fragmented DTLS handshake message" \ |
| 6664 | -c "client hello, adding renegotiation extension" \ |
| 6665 | -c "found renegotiation extension" \ |
| 6666 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6667 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6668 | -C "error" \ |
| 6669 | -s "Extra-header:" |
| 6670 | |
| 6671 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6672 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6673 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6674 | "$G_SRV -u --mtu 256" \ |
| 6675 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6676 | 0 \ |
| 6677 | -c "found fragmented DTLS handshake message" \ |
| 6678 | -c "client hello, adding renegotiation extension" \ |
| 6679 | -c "found renegotiation extension" \ |
| 6680 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6681 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6682 | -C "error" \ |
| 6683 | -s "Extra-header:" |
| 6684 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6685 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6686 | "$O_SRV -dtls -mtu 2048" \ |
| 6687 | "$P_CLI dtls=1 debug_level=2" \ |
| 6688 | 0 \ |
| 6689 | -C "found fragmented DTLS handshake message" \ |
| 6690 | -C "error" |
| 6691 | |
| 6692 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6693 | "$O_SRV -dtls -mtu 768" \ |
| 6694 | "$P_CLI dtls=1 debug_level=2" \ |
| 6695 | 0 \ |
| 6696 | -c "found fragmented DTLS handshake message" \ |
| 6697 | -C "error" |
| 6698 | |
| 6699 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6700 | "$O_SRV -dtls -mtu 256" \ |
| 6701 | "$P_CLI dtls=1 debug_level=2" \ |
| 6702 | 0 \ |
| 6703 | -c "found fragmented DTLS handshake message" \ |
| 6704 | -C "error" |
| 6705 | |
| 6706 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6707 | "$O_SRV -dtls -mtu 256" \ |
| 6708 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6709 | 0 \ |
| 6710 | -c "found fragmented DTLS handshake message" \ |
| 6711 | -C "error" |
| 6712 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6713 | # Tests for sending fragmented handshake messages with DTLS |
| 6714 | # |
| 6715 | # Use client auth when we need the client to send large messages, |
| 6716 | # and use large cert chains on both sides too (the long chains we have all use |
| 6717 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6718 | # Sizes reached (UDP payload): |
| 6719 | # - 2037B for server certificate |
| 6720 | # - 1542B for client certificate |
| 6721 | # - 1013B for newsessionticket |
| 6722 | # - all others below 512B |
| 6723 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6724 | |
| 6725 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6726 | requires_config_enabled MBEDTLS_RSA_C |
| 6727 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6728 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6729 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6730 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6731 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6732 | crt_file=data_files/server7_int-ca.crt \ |
| 6733 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6734 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6735 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6736 | "$P_CLI dtls=1 debug_level=2 \ |
| 6737 | crt_file=data_files/server8_int-ca2.crt \ |
| 6738 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6739 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6740 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6741 | 0 \ |
| 6742 | -S "found fragmented DTLS handshake message" \ |
| 6743 | -C "found fragmented DTLS handshake message" \ |
| 6744 | -C "error" |
| 6745 | |
| 6746 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6747 | requires_config_enabled MBEDTLS_RSA_C |
| 6748 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6749 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6750 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6751 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6752 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6753 | crt_file=data_files/server7_int-ca.crt \ |
| 6754 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6755 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6756 | max_frag_len=1024" \ |
| 6757 | "$P_CLI dtls=1 debug_level=2 \ |
| 6758 | crt_file=data_files/server8_int-ca2.crt \ |
| 6759 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6760 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6761 | max_frag_len=2048" \ |
| 6762 | 0 \ |
| 6763 | -S "found fragmented DTLS handshake message" \ |
| 6764 | -c "found fragmented DTLS handshake message" \ |
| 6765 | -C "error" |
| 6766 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6767 | # With the MFL extension, the server has no way of forcing |
| 6768 | # the client to not exceed a certain MTU; hence, the following |
| 6769 | # test can't be replicated with an MTU proxy such as the one |
| 6770 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6771 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6772 | requires_config_enabled MBEDTLS_RSA_C |
| 6773 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6774 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6775 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6776 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6777 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6778 | crt_file=data_files/server7_int-ca.crt \ |
| 6779 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6780 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6781 | max_frag_len=512" \ |
| 6782 | "$P_CLI dtls=1 debug_level=2 \ |
| 6783 | crt_file=data_files/server8_int-ca2.crt \ |
| 6784 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6785 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6786 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6787 | 0 \ |
| 6788 | -S "found fragmented DTLS handshake message" \ |
| 6789 | -c "found fragmented DTLS handshake message" \ |
| 6790 | -C "error" |
| 6791 | |
| 6792 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6793 | requires_config_enabled MBEDTLS_RSA_C |
| 6794 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6795 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6796 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6797 | 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] | 6798 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6799 | crt_file=data_files/server7_int-ca.crt \ |
| 6800 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6801 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6802 | max_frag_len=2048" \ |
| 6803 | "$P_CLI dtls=1 debug_level=2 \ |
| 6804 | crt_file=data_files/server8_int-ca2.crt \ |
| 6805 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6806 | hs_timeout=2500-60000 \ |
| 6807 | max_frag_len=1024" \ |
| 6808 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6809 | -S "found fragmented DTLS handshake message" \ |
| 6810 | -c "found fragmented DTLS handshake message" \ |
| 6811 | -C "error" |
| 6812 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6813 | # While not required by the standard defining the MFL extension |
| 6814 | # (according to which it only applies to records, not to datagrams), |
| 6815 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6816 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6817 | # to the peer. |
| 6818 | # The next test checks that no datagrams significantly larger than the |
| 6819 | # negotiated MFL are sent. |
| 6820 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6821 | requires_config_enabled MBEDTLS_RSA_C |
| 6822 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6823 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6824 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6825 | 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] | 6826 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6827 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6828 | crt_file=data_files/server7_int-ca.crt \ |
| 6829 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6830 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6831 | max_frag_len=2048" \ |
| 6832 | "$P_CLI dtls=1 debug_level=2 \ |
| 6833 | crt_file=data_files/server8_int-ca2.crt \ |
| 6834 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6835 | hs_timeout=2500-60000 \ |
| 6836 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6837 | 0 \ |
| 6838 | -S "found fragmented DTLS handshake message" \ |
| 6839 | -c "found fragmented DTLS handshake message" \ |
| 6840 | -C "error" |
| 6841 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6842 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6843 | requires_config_enabled MBEDTLS_RSA_C |
| 6844 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6845 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6846 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6847 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6848 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6849 | crt_file=data_files/server7_int-ca.crt \ |
| 6850 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6851 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6852 | max_frag_len=2048" \ |
| 6853 | "$P_CLI dtls=1 debug_level=2 \ |
| 6854 | crt_file=data_files/server8_int-ca2.crt \ |
| 6855 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6856 | hs_timeout=2500-60000 \ |
| 6857 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6858 | 0 \ |
| 6859 | -s "found fragmented DTLS handshake message" \ |
| 6860 | -c "found fragmented DTLS handshake message" \ |
| 6861 | -C "error" |
| 6862 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6863 | # While not required by the standard defining the MFL extension |
| 6864 | # (according to which it only applies to records, not to datagrams), |
| 6865 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6866 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6867 | # to the peer. |
| 6868 | # The next test checks that no datagrams significantly larger than the |
| 6869 | # negotiated MFL are sent. |
| 6870 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6871 | requires_config_enabled MBEDTLS_RSA_C |
| 6872 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6873 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6874 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6875 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6876 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6877 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6878 | crt_file=data_files/server7_int-ca.crt \ |
| 6879 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6880 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6881 | max_frag_len=2048" \ |
| 6882 | "$P_CLI dtls=1 debug_level=2 \ |
| 6883 | crt_file=data_files/server8_int-ca2.crt \ |
| 6884 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6885 | hs_timeout=2500-60000 \ |
| 6886 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6887 | 0 \ |
| 6888 | -s "found fragmented DTLS handshake message" \ |
| 6889 | -c "found fragmented DTLS handshake message" \ |
| 6890 | -C "error" |
| 6891 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6892 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6893 | requires_config_enabled MBEDTLS_RSA_C |
| 6894 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6895 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6896 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6897 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6898 | crt_file=data_files/server7_int-ca.crt \ |
| 6899 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6900 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6901 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6902 | "$P_CLI dtls=1 debug_level=2 \ |
| 6903 | crt_file=data_files/server8_int-ca2.crt \ |
| 6904 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6905 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6906 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6907 | 0 \ |
| 6908 | -S "found fragmented DTLS handshake message" \ |
| 6909 | -C "found fragmented DTLS handshake message" \ |
| 6910 | -C "error" |
| 6911 | |
| 6912 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6913 | requires_config_enabled MBEDTLS_RSA_C |
| 6914 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6915 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6916 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6917 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6918 | crt_file=data_files/server7_int-ca.crt \ |
| 6919 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6920 | hs_timeout=3500-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 | "$P_CLI dtls=1 debug_level=2 \ |
| 6923 | crt_file=data_files/server8_int-ca2.crt \ |
| 6924 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6925 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6926 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6927 | 0 \ |
| 6928 | -s "found fragmented DTLS handshake message" \ |
| 6929 | -C "found fragmented DTLS handshake message" \ |
| 6930 | -C "error" |
| 6931 | |
| 6932 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6933 | requires_config_enabled MBEDTLS_RSA_C |
| 6934 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6935 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6936 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6937 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6938 | crt_file=data_files/server7_int-ca.crt \ |
| 6939 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6940 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6941 | mtu=512" \ |
| 6942 | "$P_CLI dtls=1 debug_level=2 \ |
| 6943 | crt_file=data_files/server8_int-ca2.crt \ |
| 6944 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6945 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6946 | mtu=2048" \ |
| 6947 | 0 \ |
| 6948 | -S "found fragmented DTLS handshake message" \ |
| 6949 | -c "found fragmented DTLS handshake message" \ |
| 6950 | -C "error" |
| 6951 | |
| 6952 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6953 | requires_config_enabled MBEDTLS_RSA_C |
| 6954 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6955 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6956 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6957 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6958 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6959 | crt_file=data_files/server7_int-ca.crt \ |
| 6960 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6961 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 6962 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6963 | "$P_CLI dtls=1 debug_level=2 \ |
| 6964 | crt_file=data_files/server8_int-ca2.crt \ |
| 6965 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6966 | hs_timeout=2500-60000 \ |
| 6967 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6968 | 0 \ |
| 6969 | -s "found fragmented DTLS handshake message" \ |
| 6970 | -c "found fragmented DTLS handshake message" \ |
| 6971 | -C "error" |
| 6972 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 6973 | # Forcing ciphersuite for this test to fit the MTU of 512 with full config. |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6974 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6975 | requires_config_enabled MBEDTLS_RSA_C |
| 6976 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6977 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 6978 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6979 | requires_config_enabled MBEDTLS_AES_C |
| 6980 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6981 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6982 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 6983 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6984 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6985 | crt_file=data_files/server7_int-ca.crt \ |
| 6986 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6987 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 6988 | mtu=512" \ |
| 6989 | "$P_CLI dtls=1 debug_level=2 \ |
| 6990 | crt_file=data_files/server8_int-ca2.crt \ |
| 6991 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 6992 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6993 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6994 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 6995 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 6996 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 6997 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 6998 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 6999 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7000 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7001 | # 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] | 7002 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7003 | # retransmissions, but in some cases (like both the server and client using |
| 7004 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7005 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7006 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7007 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7008 | requires_config_enabled MBEDTLS_RSA_C |
| 7009 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7010 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7011 | requires_config_enabled MBEDTLS_AES_C |
| 7012 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7013 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7014 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7015 | -p "$P_PXY mtu=508" \ |
| 7016 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7017 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7018 | key_file=data_files/server7.key \ |
| 7019 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7020 | "$P_CLI dtls=1 debug_level=2 \ |
| 7021 | crt_file=data_files/server8_int-ca2.crt \ |
| 7022 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7023 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7024 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7025 | 0 \ |
| 7026 | -s "found fragmented DTLS handshake message" \ |
| 7027 | -c "found fragmented DTLS handshake message" \ |
| 7028 | -C "error" |
| 7029 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7030 | # 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] | 7031 | only_with_valgrind |
| 7032 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7033 | requires_config_enabled MBEDTLS_RSA_C |
| 7034 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7035 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7036 | requires_config_enabled MBEDTLS_AES_C |
| 7037 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7038 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7039 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7040 | -p "$P_PXY mtu=508" \ |
| 7041 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7042 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7043 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7044 | hs_timeout=250-10000" \ |
| 7045 | "$P_CLI dtls=1 debug_level=2 \ |
| 7046 | crt_file=data_files/server8_int-ca2.crt \ |
| 7047 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7048 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7049 | hs_timeout=250-10000" \ |
| 7050 | 0 \ |
| 7051 | -s "found fragmented DTLS handshake message" \ |
| 7052 | -c "found fragmented DTLS handshake message" \ |
| 7053 | -C "error" |
| 7054 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7055 | # 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] | 7056 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7057 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7058 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7059 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7060 | requires_config_enabled MBEDTLS_RSA_C |
| 7061 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7062 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7063 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7064 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7065 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7066 | crt_file=data_files/server7_int-ca.crt \ |
| 7067 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7068 | hs_timeout=10000-60000 \ |
| 7069 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7070 | "$P_CLI dtls=1 debug_level=2 \ |
| 7071 | crt_file=data_files/server8_int-ca2.crt \ |
| 7072 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7073 | hs_timeout=10000-60000 \ |
| 7074 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7075 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7076 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7077 | -s "found fragmented DTLS handshake message" \ |
| 7078 | -c "found fragmented DTLS handshake message" \ |
| 7079 | -C "error" |
| 7080 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7081 | # 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] | 7082 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7083 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7084 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7085 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7086 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7087 | requires_config_enabled MBEDTLS_RSA_C |
| 7088 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7089 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7090 | requires_config_enabled MBEDTLS_AES_C |
| 7091 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7092 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7093 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7094 | -p "$P_PXY mtu=512" \ |
| 7095 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7096 | crt_file=data_files/server7_int-ca.crt \ |
| 7097 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7098 | hs_timeout=10000-60000 \ |
| 7099 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7100 | "$P_CLI dtls=1 debug_level=2 \ |
| 7101 | crt_file=data_files/server8_int-ca2.crt \ |
| 7102 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7103 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7104 | hs_timeout=10000-60000 \ |
| 7105 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7106 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7107 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7108 | -s "found fragmented DTLS handshake message" \ |
| 7109 | -c "found fragmented DTLS handshake message" \ |
| 7110 | -C "error" |
| 7111 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7112 | not_with_valgrind # spurious autoreduction due to timeout |
| 7113 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7114 | requires_config_enabled MBEDTLS_RSA_C |
| 7115 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7116 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7117 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7118 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7119 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7120 | crt_file=data_files/server7_int-ca.crt \ |
| 7121 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7122 | hs_timeout=10000-60000 \ |
| 7123 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7124 | "$P_CLI dtls=1 debug_level=2 \ |
| 7125 | crt_file=data_files/server8_int-ca2.crt \ |
| 7126 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7127 | hs_timeout=10000-60000 \ |
| 7128 | mtu=1024 nbio=2" \ |
| 7129 | 0 \ |
| 7130 | -S "autoreduction" \ |
| 7131 | -s "found fragmented DTLS handshake message" \ |
| 7132 | -c "found fragmented DTLS handshake message" \ |
| 7133 | -C "error" |
| 7134 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7135 | # 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] | 7136 | not_with_valgrind # spurious autoreduction due to timeout |
| 7137 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7138 | requires_config_enabled MBEDTLS_RSA_C |
| 7139 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7140 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7141 | requires_config_enabled MBEDTLS_AES_C |
| 7142 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7143 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7144 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7145 | -p "$P_PXY mtu=512" \ |
| 7146 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7147 | crt_file=data_files/server7_int-ca.crt \ |
| 7148 | key_file=data_files/server7.key \ |
| 7149 | hs_timeout=10000-60000 \ |
| 7150 | mtu=512 nbio=2" \ |
| 7151 | "$P_CLI dtls=1 debug_level=2 \ |
| 7152 | crt_file=data_files/server8_int-ca2.crt \ |
| 7153 | key_file=data_files/server8.key \ |
| 7154 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7155 | hs_timeout=10000-60000 \ |
| 7156 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7157 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7158 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7159 | -s "found fragmented DTLS handshake message" \ |
| 7160 | -c "found fragmented DTLS handshake message" \ |
| 7161 | -C "error" |
| 7162 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7163 | # 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] | 7164 | # This ensures things still work after session_reset(). |
| 7165 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7166 | # Since we don't support reading fragmented ClientHello yet, |
| 7167 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7168 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7169 | # An autoreduction on the client-side might happen if the server is |
| 7170 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7171 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7172 | # resumed listening, which would result in a spurious autoreduction. |
| 7173 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7174 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7175 | requires_config_enabled MBEDTLS_RSA_C |
| 7176 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7177 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7178 | requires_config_enabled MBEDTLS_AES_C |
| 7179 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7180 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7181 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7182 | -p "$P_PXY mtu=1450" \ |
| 7183 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7184 | crt_file=data_files/server7_int-ca.crt \ |
| 7185 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7186 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7187 | mtu=1450" \ |
| 7188 | "$P_CLI dtls=1 debug_level=2 \ |
| 7189 | crt_file=data_files/server8_int-ca2.crt \ |
| 7190 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7191 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7192 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7193 | 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] | 7194 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7195 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7196 | -s "found fragmented DTLS handshake message" \ |
| 7197 | -c "found fragmented DTLS handshake message" \ |
| 7198 | -C "error" |
| 7199 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7200 | # An autoreduction on the client-side might happen if the server is |
| 7201 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7202 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7203 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7204 | requires_config_enabled MBEDTLS_RSA_C |
| 7205 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7206 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7207 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7208 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7209 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7210 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7211 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7212 | -p "$P_PXY mtu=512" \ |
| 7213 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7214 | crt_file=data_files/server7_int-ca.crt \ |
| 7215 | key_file=data_files/server7.key \ |
| 7216 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7217 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7218 | mtu=512" \ |
| 7219 | "$P_CLI dtls=1 debug_level=2 \ |
| 7220 | crt_file=data_files/server8_int-ca2.crt \ |
| 7221 | key_file=data_files/server8.key \ |
| 7222 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7223 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7224 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7225 | mtu=512" \ |
| 7226 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7227 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7228 | -s "found fragmented DTLS handshake message" \ |
| 7229 | -c "found fragmented DTLS handshake message" \ |
| 7230 | -C "error" |
| 7231 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7232 | # An autoreduction on the client-side might happen if the server is |
| 7233 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7234 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7235 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7236 | requires_config_enabled MBEDTLS_RSA_C |
| 7237 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7238 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7239 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7240 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7241 | requires_config_enabled MBEDTLS_AES_C |
| 7242 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7243 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7244 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7245 | -p "$P_PXY mtu=512" \ |
| 7246 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7247 | crt_file=data_files/server7_int-ca.crt \ |
| 7248 | key_file=data_files/server7.key \ |
| 7249 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7250 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7251 | mtu=512" \ |
| 7252 | "$P_CLI dtls=1 debug_level=2 \ |
| 7253 | crt_file=data_files/server8_int-ca2.crt \ |
| 7254 | key_file=data_files/server8.key \ |
| 7255 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7256 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7257 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7258 | mtu=512" \ |
| 7259 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7260 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7261 | -s "found fragmented DTLS handshake message" \ |
| 7262 | -c "found fragmented DTLS handshake message" \ |
| 7263 | -C "error" |
| 7264 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7265 | # An autoreduction on the client-side might happen if the server is |
| 7266 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7267 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7268 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7269 | requires_config_enabled MBEDTLS_RSA_C |
| 7270 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7271 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7272 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7273 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7274 | requires_config_enabled MBEDTLS_AES_C |
| 7275 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7276 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7277 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7278 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7279 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7280 | crt_file=data_files/server7_int-ca.crt \ |
| 7281 | key_file=data_files/server7.key \ |
| 7282 | exchanges=2 renegotiation=1 \ |
| 7283 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7284 | hs_timeout=10000-60000 \ |
| 7285 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7286 | "$P_CLI dtls=1 debug_level=2 \ |
| 7287 | crt_file=data_files/server8_int-ca2.crt \ |
| 7288 | key_file=data_files/server8.key \ |
| 7289 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7290 | hs_timeout=10000-60000 \ |
| 7291 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7292 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7293 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7294 | -s "found fragmented DTLS handshake message" \ |
| 7295 | -c "found fragmented DTLS handshake message" \ |
| 7296 | -C "error" |
| 7297 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7298 | # An autoreduction on the client-side might happen if the server is |
| 7299 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7300 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7301 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7302 | requires_config_enabled MBEDTLS_RSA_C |
| 7303 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7304 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7305 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7306 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7307 | requires_config_enabled MBEDTLS_AES_C |
| 7308 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7309 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7310 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7311 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7312 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7313 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7314 | crt_file=data_files/server7_int-ca.crt \ |
| 7315 | key_file=data_files/server7.key \ |
| 7316 | exchanges=2 renegotiation=1 \ |
| 7317 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7318 | hs_timeout=10000-60000 \ |
| 7319 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7320 | "$P_CLI dtls=1 debug_level=2 \ |
| 7321 | crt_file=data_files/server8_int-ca2.crt \ |
| 7322 | key_file=data_files/server8.key \ |
| 7323 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7324 | hs_timeout=10000-60000 \ |
| 7325 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7326 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7327 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7328 | -s "found fragmented DTLS handshake message" \ |
| 7329 | -c "found fragmented DTLS handshake message" \ |
| 7330 | -C "error" |
| 7331 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7332 | # An autoreduction on the client-side might happen if the server is |
| 7333 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7334 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7335 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7336 | requires_config_enabled MBEDTLS_RSA_C |
| 7337 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7338 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7339 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7340 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7341 | requires_config_enabled MBEDTLS_AES_C |
| 7342 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7343 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7344 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7345 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7346 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7347 | crt_file=data_files/server7_int-ca.crt \ |
| 7348 | key_file=data_files/server7.key \ |
| 7349 | exchanges=2 renegotiation=1 \ |
| 7350 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7351 | hs_timeout=10000-60000 \ |
| 7352 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7353 | "$P_CLI dtls=1 debug_level=2 \ |
| 7354 | crt_file=data_files/server8_int-ca2.crt \ |
| 7355 | key_file=data_files/server8.key \ |
| 7356 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7357 | hs_timeout=10000-60000 \ |
| 7358 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7359 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7360 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7361 | -s "found fragmented DTLS handshake message" \ |
| 7362 | -c "found fragmented DTLS handshake message" \ |
| 7363 | -C "error" |
| 7364 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7365 | # 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] | 7366 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7367 | requires_config_enabled MBEDTLS_RSA_C |
| 7368 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7369 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7370 | requires_config_enabled MBEDTLS_AES_C |
| 7371 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7372 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7373 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7374 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7375 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7376 | "$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] | 7377 | crt_file=data_files/server7_int-ca.crt \ |
| 7378 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7379 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7380 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7381 | crt_file=data_files/server8_int-ca2.crt \ |
| 7382 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7383 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7384 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7385 | 0 \ |
| 7386 | -s "found fragmented DTLS handshake message" \ |
| 7387 | -c "found fragmented DTLS handshake message" \ |
| 7388 | -C "error" |
| 7389 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7390 | # 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] | 7391 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7392 | requires_config_enabled MBEDTLS_RSA_C |
| 7393 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7394 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7395 | requires_config_enabled MBEDTLS_AES_C |
| 7396 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7397 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7398 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7399 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7400 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7401 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7402 | crt_file=data_files/server7_int-ca.crt \ |
| 7403 | key_file=data_files/server7.key \ |
| 7404 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7405 | "$P_CLI dtls=1 debug_level=2 \ |
| 7406 | crt_file=data_files/server8_int-ca2.crt \ |
| 7407 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7408 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7409 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7410 | 0 \ |
| 7411 | -s "found fragmented DTLS handshake message" \ |
| 7412 | -c "found fragmented DTLS handshake message" \ |
| 7413 | -C "error" |
| 7414 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7415 | # interop tests for DTLS fragmentating with reliable connection |
| 7416 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7417 | # here and below we just want to test that the we fragment in a way that |
| 7418 | # pleases other implementations, so we don't need the peer to fragment |
| 7419 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7420 | requires_config_enabled MBEDTLS_RSA_C |
| 7421 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7422 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7423 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7424 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7425 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7426 | "$G_SRV -u" \ |
| 7427 | "$P_CLI dtls=1 debug_level=2 \ |
| 7428 | crt_file=data_files/server8_int-ca2.crt \ |
| 7429 | key_file=data_files/server8.key \ |
| 7430 | mtu=512 force_version=dtls1_2" \ |
| 7431 | 0 \ |
| 7432 | -c "fragmenting handshake message" \ |
| 7433 | -C "error" |
| 7434 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7435 | # We use --insecure for the GnuTLS client because it expects |
| 7436 | # the hostname / IP it connects to to be the name used in the |
| 7437 | # certificate obtained from the server. Here, however, it |
| 7438 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7439 | # as the server name in the certificate. This will make the |
| 7440 | # certifiate validation fail, but passing --insecure makes |
| 7441 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7442 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7443 | requires_config_enabled MBEDTLS_RSA_C |
| 7444 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7445 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7446 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7447 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7448 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7449 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7450 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7451 | crt_file=data_files/server7_int-ca.crt \ |
| 7452 | key_file=data_files/server7.key \ |
| 7453 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7454 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7455 | 0 \ |
| 7456 | -s "fragmenting handshake message" |
| 7457 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7458 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7459 | requires_config_enabled MBEDTLS_RSA_C |
| 7460 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7461 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7462 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7463 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7464 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7465 | "$P_CLI dtls=1 debug_level=2 \ |
| 7466 | crt_file=data_files/server8_int-ca2.crt \ |
| 7467 | key_file=data_files/server8.key \ |
| 7468 | mtu=512 force_version=dtls1_2" \ |
| 7469 | 0 \ |
| 7470 | -c "fragmenting handshake message" \ |
| 7471 | -C "error" |
| 7472 | |
| 7473 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7474 | requires_config_enabled MBEDTLS_RSA_C |
| 7475 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 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 client, DTLS 1.2" \ |
| 7479 | "$P_SRV dtls=1 debug_level=2 \ |
| 7480 | crt_file=data_files/server7_int-ca.crt \ |
| 7481 | key_file=data_files/server7.key \ |
| 7482 | mtu=512 force_version=dtls1_2" \ |
| 7483 | "$O_CLI -dtls1_2" \ |
| 7484 | 0 \ |
| 7485 | -s "fragmenting handshake message" |
| 7486 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7487 | # interop tests for DTLS fragmentating with unreliable connection |
| 7488 | # |
| 7489 | # again we just want to test that the we fragment in a way that |
| 7490 | # pleases other implementations, so we don't need the peer to fragment |
| 7491 | requires_gnutls_next |
| 7492 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7493 | requires_config_enabled MBEDTLS_RSA_C |
| 7494 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7495 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7496 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7497 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7498 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7499 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7500 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7501 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7502 | crt_file=data_files/server8_int-ca2.crt \ |
| 7503 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7504 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7505 | 0 \ |
| 7506 | -c "fragmenting handshake message" \ |
| 7507 | -C "error" |
| 7508 | |
| 7509 | requires_gnutls_next |
| 7510 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7511 | requires_config_enabled MBEDTLS_RSA_C |
| 7512 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7513 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7514 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7515 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7516 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7517 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7518 | "$P_SRV dtls=1 debug_level=2 \ |
| 7519 | crt_file=data_files/server7_int-ca.crt \ |
| 7520 | key_file=data_files/server7.key \ |
| 7521 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7522 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7523 | 0 \ |
| 7524 | -s "fragmenting handshake message" |
| 7525 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7526 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7527 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7528 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7529 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7530 | ## (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] | 7531 | skip_next_test |
| 7532 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7533 | requires_config_enabled MBEDTLS_RSA_C |
| 7534 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7535 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7536 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7537 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7538 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7539 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7540 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7541 | "$P_CLI dtls=1 debug_level=2 \ |
| 7542 | crt_file=data_files/server8_int-ca2.crt \ |
| 7543 | key_file=data_files/server8.key \ |
| 7544 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7545 | 0 \ |
| 7546 | -c "fragmenting handshake message" \ |
| 7547 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7548 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7549 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7550 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7551 | requires_config_enabled MBEDTLS_RSA_C |
| 7552 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7553 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7554 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7555 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7556 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7557 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7558 | "$P_SRV dtls=1 debug_level=2 \ |
| 7559 | crt_file=data_files/server7_int-ca.crt \ |
| 7560 | key_file=data_files/server7.key \ |
| 7561 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7562 | "$O_CLI -dtls1_2" \ |
| 7563 | 0 \ |
| 7564 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7565 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7566 | # Tests for DTLS-SRTP (RFC 5764) |
| 7567 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7568 | run_test "DTLS-SRTP all profiles supported" \ |
| 7569 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7570 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7571 | 0 \ |
| 7572 | -s "found use_srtp extension" \ |
| 7573 | -s "found srtp profile" \ |
| 7574 | -s "selected srtp profile" \ |
| 7575 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7576 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7577 | -c "client hello, adding use_srtp extension" \ |
| 7578 | -c "found use_srtp extension" \ |
| 7579 | -c "found srtp profile" \ |
| 7580 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7581 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7582 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7583 | -C "error" |
| 7584 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7585 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7586 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7587 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7588 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7589 | "$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] | 7590 | 0 \ |
| 7591 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7592 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
| 7593 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7594 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7595 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7596 | -c "client hello, adding use_srtp extension" \ |
| 7597 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7598 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7599 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7600 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7601 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7602 | -C "error" |
| 7603 | |
| 7604 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7605 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7606 | "$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] | 7607 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7608 | 0 \ |
| 7609 | -s "found use_srtp extension" \ |
| 7610 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7611 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7612 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7613 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7614 | -c "client hello, adding use_srtp extension" \ |
| 7615 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7616 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7617 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7618 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7619 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7620 | -C "error" |
| 7621 | |
| 7622 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7623 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7624 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7625 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7626 | 0 \ |
| 7627 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7628 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7629 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7630 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7631 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7632 | -c "client hello, adding use_srtp extension" \ |
| 7633 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7634 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7635 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7636 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7637 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7638 | -C "error" |
| 7639 | |
| 7640 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7641 | run_test "DTLS-SRTP server and Client support only one different profile." \ |
| 7642 | "$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] | 7643 | "$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] | 7644 | 0 \ |
| 7645 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7646 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7647 | -S "selected srtp profile" \ |
| 7648 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7649 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7650 | -c "client hello, adding use_srtp extension" \ |
| 7651 | -C "found use_srtp extension" \ |
| 7652 | -C "found srtp profile" \ |
| 7653 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7654 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7655 | -C "error" |
| 7656 | |
| 7657 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7658 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7659 | "$P_SRV dtls=1 debug_level=3" \ |
| 7660 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7661 | 0 \ |
| 7662 | -s "found use_srtp extension" \ |
| 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 all profiles supported. mki used" \ |
| 7674 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7675 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7676 | 0 \ |
| 7677 | -s "found use_srtp extension" \ |
| 7678 | -s "found srtp profile" \ |
| 7679 | -s "selected srtp profile" \ |
| 7680 | -s "server hello, adding use_srtp extension" \ |
| 7681 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7682 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7683 | -c "client hello, adding use_srtp extension" \ |
| 7684 | -c "found use_srtp extension" \ |
| 7685 | -c "found srtp profile" \ |
| 7686 | -c "selected srtp profile" \ |
| 7687 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7688 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7689 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7690 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7691 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7692 | -C "error" |
| 7693 | |
| 7694 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7695 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7696 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7697 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7698 | 0 \ |
| 7699 | -s "found use_srtp extension" \ |
| 7700 | -s "found srtp profile" \ |
| 7701 | -s "selected srtp profile" \ |
| 7702 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7703 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7704 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7705 | -S "dumping 'using mki' (8 bytes)" \ |
| 7706 | -c "client hello, adding use_srtp extension" \ |
| 7707 | -c "found use_srtp extension" \ |
| 7708 | -c "found srtp profile" \ |
| 7709 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7710 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7711 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7712 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7713 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7714 | -C "dumping 'received mki' (8 bytes)" \ |
| 7715 | -C "error" |
| 7716 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7717 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7718 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7719 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7720 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7721 | 0 \ |
| 7722 | -s "found use_srtp extension" \ |
| 7723 | -s "found srtp profile" \ |
| 7724 | -s "selected srtp profile" \ |
| 7725 | -s "server hello, adding use_srtp extension" \ |
| 7726 | -s "DTLS-SRTP key material is"\ |
| 7727 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7728 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7729 | |
| 7730 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7731 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7732 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7733 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7734 | 0 \ |
| 7735 | -s "found use_srtp extension" \ |
| 7736 | -s "found srtp profile" \ |
| 7737 | -s "selected srtp profile" \ |
| 7738 | -s "server hello, adding use_srtp extension" \ |
| 7739 | -s "DTLS-SRTP key material is"\ |
| 7740 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7741 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7742 | |
| 7743 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7744 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7745 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7746 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7747 | 0 \ |
| 7748 | -s "found use_srtp extension" \ |
| 7749 | -s "found srtp profile" \ |
| 7750 | -s "selected srtp profile" \ |
| 7751 | -s "server hello, adding use_srtp extension" \ |
| 7752 | -s "DTLS-SRTP key material is"\ |
| 7753 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7754 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7755 | |
| 7756 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7757 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7758 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7759 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7760 | 0 \ |
| 7761 | -s "found use_srtp extension" \ |
| 7762 | -s "found srtp profile" \ |
| 7763 | -s "selected srtp profile" \ |
| 7764 | -s "server hello, adding use_srtp extension" \ |
| 7765 | -s "DTLS-SRTP key material is"\ |
| 7766 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7767 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7768 | |
| 7769 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7770 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7771 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7772 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7773 | 0 \ |
| 7774 | -s "found use_srtp extension" \ |
| 7775 | -s "found srtp profile" \ |
| 7776 | -s "selected srtp profile" \ |
| 7777 | -s "server hello, adding use_srtp extension" \ |
| 7778 | -s "DTLS-SRTP key material is"\ |
| 7779 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7780 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7781 | |
| 7782 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7783 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7784 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7785 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7786 | 0 \ |
| 7787 | -s "found use_srtp extension" \ |
| 7788 | -s "found srtp profile" \ |
| 7789 | -S "selected srtp profile" \ |
| 7790 | -S "server hello, adding use_srtp extension" \ |
| 7791 | -S "DTLS-SRTP key material is"\ |
| 7792 | -C "SRTP Extension negotiated, profile" |
| 7793 | |
| 7794 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7795 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7796 | "$P_SRV dtls=1 debug_level=3" \ |
| 7797 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7798 | 0 \ |
| 7799 | -s "found use_srtp extension" \ |
| 7800 | -S "server hello, adding use_srtp extension" \ |
| 7801 | -S "DTLS-SRTP key material is"\ |
| 7802 | -C "SRTP Extension negotiated, profile" |
| 7803 | |
| 7804 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7805 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7806 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7807 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7808 | 0 \ |
| 7809 | -c "client hello, adding use_srtp extension" \ |
| 7810 | -c "found use_srtp extension" \ |
| 7811 | -c "found srtp profile" \ |
| 7812 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7813 | -c "DTLS-SRTP key material is"\ |
| 7814 | -C "error" |
| 7815 | |
| 7816 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7817 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7818 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7819 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7820 | 0 \ |
| 7821 | -c "client hello, adding use_srtp extension" \ |
| 7822 | -c "found use_srtp extension" \ |
| 7823 | -c "found srtp profile" \ |
| 7824 | -c "selected srtp profile" \ |
| 7825 | -c "DTLS-SRTP key material is"\ |
| 7826 | -C "error" |
| 7827 | |
| 7828 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7829 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7830 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7831 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7832 | 0 \ |
| 7833 | -c "client hello, adding use_srtp extension" \ |
| 7834 | -c "found use_srtp extension" \ |
| 7835 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7836 | -c "selected srtp profile" \ |
| 7837 | -c "DTLS-SRTP key material is"\ |
| 7838 | -C "error" |
| 7839 | |
| 7840 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7841 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7842 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7843 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7844 | 0 \ |
| 7845 | -c "client hello, adding use_srtp extension" \ |
| 7846 | -c "found use_srtp extension" \ |
| 7847 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7848 | -c "selected srtp profile" \ |
| 7849 | -c "DTLS-SRTP key material is"\ |
| 7850 | -C "error" |
| 7851 | |
| 7852 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7853 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7854 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7855 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7856 | 0 \ |
| 7857 | -c "client hello, adding use_srtp extension" \ |
| 7858 | -c "found use_srtp extension" \ |
| 7859 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7860 | -c "selected srtp profile" \ |
| 7861 | -c "DTLS-SRTP key material is"\ |
| 7862 | -C "error" |
| 7863 | |
| 7864 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7865 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 7866 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7867 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 7868 | 0 \ |
| 7869 | -c "client hello, adding use_srtp extension" \ |
| 7870 | -C "found use_srtp extension" \ |
| 7871 | -C "found srtp profile" \ |
| 7872 | -C "selected srtp profile" \ |
| 7873 | -C "DTLS-SRTP key material is"\ |
| 7874 | -C "error" |
| 7875 | |
| 7876 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7877 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 7878 | "$O_SRV -dtls" \ |
| 7879 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7880 | 0 \ |
| 7881 | -c "client hello, adding use_srtp extension" \ |
| 7882 | -C "found use_srtp extension" \ |
| 7883 | -C "found srtp profile" \ |
| 7884 | -C "selected srtp profile" \ |
| 7885 | -C "DTLS-SRTP key material is"\ |
| 7886 | -C "error" |
| 7887 | |
| 7888 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7889 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 7890 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7891 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7892 | 0 \ |
| 7893 | -c "client hello, adding use_srtp extension" \ |
| 7894 | -c "found use_srtp extension" \ |
| 7895 | -c "found srtp profile" \ |
| 7896 | -c "selected srtp profile" \ |
| 7897 | -c "DTLS-SRTP key material is"\ |
| 7898 | -c "DTLS-SRTP no mki value negotiated"\ |
| 7899 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7900 | -C "dumping 'received mki' (8 bytes)" \ |
| 7901 | -C "error" |
| 7902 | |
| 7903 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7904 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7905 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7906 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7907 | "$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] | 7908 | 0 \ |
| 7909 | -s "found use_srtp extension" \ |
| 7910 | -s "found srtp profile" \ |
| 7911 | -s "selected srtp profile" \ |
| 7912 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7913 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7914 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 7915 | |
| 7916 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7917 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7918 | 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] | 7919 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7920 | "$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] | 7921 | 0 \ |
| 7922 | -s "found use_srtp extension" \ |
| 7923 | -s "found srtp profile" \ |
| 7924 | -s "selected srtp profile" \ |
| 7925 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7926 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7927 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 7928 | |
| 7929 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7930 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7931 | 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] | 7932 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7933 | "$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] | 7934 | 0 \ |
| 7935 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7936 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7937 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7938 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7939 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7940 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7941 | |
| 7942 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7943 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7944 | 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] | 7945 | "$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] | 7946 | "$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] | 7947 | 0 \ |
| 7948 | -s "found use_srtp extension" \ |
| 7949 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7950 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7951 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7952 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7953 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 7954 | |
| 7955 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7956 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7957 | 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] | 7958 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7959 | "$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] | 7960 | 0 \ |
| 7961 | -s "found use_srtp extension" \ |
| 7962 | -s "found srtp profile" \ |
| 7963 | -s "selected srtp profile" \ |
| 7964 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7965 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7966 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7967 | |
| 7968 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7969 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7970 | 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] | 7971 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7972 | "$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] | 7973 | 0 \ |
| 7974 | -s "found use_srtp extension" \ |
| 7975 | -s "found srtp profile" \ |
| 7976 | -S "selected srtp profile" \ |
| 7977 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7978 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7979 | -C "SRTP profile:" |
| 7980 | |
| 7981 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7982 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7983 | 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] | 7984 | "$P_SRV dtls=1 debug_level=3" \ |
| 7985 | "$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] | 7986 | 0 \ |
| 7987 | -s "found use_srtp extension" \ |
| 7988 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7989 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7990 | -C "SRTP profile:" |
| 7991 | |
| 7992 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7993 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7994 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 7995 | "$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" \ |
| 7996 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7997 | 0 \ |
| 7998 | -c "client hello, adding use_srtp extension" \ |
| 7999 | -c "found use_srtp extension" \ |
| 8000 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8001 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8002 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8003 | -C "error" |
| 8004 | |
| 8005 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8006 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8007 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8008 | "$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" \ |
| 8009 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8010 | 0 \ |
| 8011 | -c "client hello, adding use_srtp extension" \ |
| 8012 | -c "found use_srtp extension" \ |
| 8013 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8014 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8015 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8016 | -C "error" |
| 8017 | |
| 8018 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8019 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8020 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8021 | "$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" \ |
| 8022 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8023 | 0 \ |
| 8024 | -c "client hello, adding use_srtp extension" \ |
| 8025 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8026 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8027 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8028 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8029 | -C "error" |
| 8030 | |
| 8031 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8032 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8033 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8034 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8035 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8036 | 0 \ |
| 8037 | -c "client hello, adding use_srtp extension" \ |
| 8038 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8039 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8040 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8041 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8042 | -C "error" |
| 8043 | |
| 8044 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8045 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8046 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8047 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8048 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8049 | 0 \ |
| 8050 | -c "client hello, adding use_srtp extension" \ |
| 8051 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8052 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8053 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8054 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8055 | -C "error" |
| 8056 | |
| 8057 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8058 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8059 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8060 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8061 | "$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] | 8062 | 0 \ |
| 8063 | -c "client hello, adding use_srtp extension" \ |
| 8064 | -C "found use_srtp extension" \ |
| 8065 | -C "found srtp profile" \ |
| 8066 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8067 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8068 | -C "error" |
| 8069 | |
| 8070 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8071 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8072 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8073 | "$G_SRV -u" \ |
| 8074 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8075 | 0 \ |
| 8076 | -c "client hello, adding use_srtp extension" \ |
| 8077 | -C "found use_srtp extension" \ |
| 8078 | -C "found srtp profile" \ |
| 8079 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8080 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8081 | -C "error" |
| 8082 | |
| 8083 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8084 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8085 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8086 | "$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" \ |
| 8087 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8088 | 0 \ |
| 8089 | -c "client hello, adding use_srtp extension" \ |
| 8090 | -c "found use_srtp extension" \ |
| 8091 | -c "found srtp profile" \ |
| 8092 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8093 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8094 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8095 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8096 | -c "dumping 'received mki' (8 bytes)" \ |
| 8097 | -C "error" |
| 8098 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8099 | # Tests for specific things with "unreliable" UDP connection |
| 8100 | |
| 8101 | not_with_valgrind # spurious resend due to timeout |
| 8102 | run_test "DTLS proxy: reference" \ |
| 8103 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8104 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8105 | "$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] | 8106 | 0 \ |
| 8107 | -C "replayed record" \ |
| 8108 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8109 | -C "Buffer record from epoch" \ |
| 8110 | -S "Buffer record from epoch" \ |
| 8111 | -C "ssl_buffer_message" \ |
| 8112 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8113 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8114 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8115 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8116 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8117 | -c "HTTP/1.0 200 OK" |
| 8118 | |
| 8119 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8120 | run_test "DTLS proxy: duplicate every packet" \ |
| 8121 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8122 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8123 | "$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] | 8124 | 0 \ |
| 8125 | -c "replayed record" \ |
| 8126 | -s "replayed record" \ |
| 8127 | -c "record from another epoch" \ |
| 8128 | -s "record from another epoch" \ |
| 8129 | -S "resend" \ |
| 8130 | -s "Extra-header:" \ |
| 8131 | -c "HTTP/1.0 200 OK" |
| 8132 | |
| 8133 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8134 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8135 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8136 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8137 | 0 \ |
| 8138 | -c "replayed record" \ |
| 8139 | -S "replayed record" \ |
| 8140 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8141 | -s "record from another epoch" \ |
| 8142 | -c "resend" \ |
| 8143 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8144 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8145 | -c "HTTP/1.0 200 OK" |
| 8146 | |
| 8147 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8148 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8149 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8150 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8151 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8152 | -c "next record in same datagram" \ |
| 8153 | -s "next record in same datagram" |
| 8154 | |
| 8155 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8156 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8157 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8158 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8159 | 0 \ |
| 8160 | -c "next record in same datagram" \ |
| 8161 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8162 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8163 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8164 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8165 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8166 | "$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] | 8167 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8168 | -c "discarding invalid record (mac)" \ |
| 8169 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8170 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8171 | -c "HTTP/1.0 200 OK" \ |
| 8172 | -S "too many records with bad MAC" \ |
| 8173 | -S "Verification of the message MAC failed" |
| 8174 | |
| 8175 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8176 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8177 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8178 | "$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] | 8179 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8180 | -C "discarding invalid record (mac)" \ |
| 8181 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8182 | -S "Extra-header:" \ |
| 8183 | -C "HTTP/1.0 200 OK" \ |
| 8184 | -s "too many records with bad MAC" \ |
| 8185 | -s "Verification of the message MAC failed" |
| 8186 | |
| 8187 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8188 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8189 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8190 | "$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] | 8191 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8192 | -c "discarding invalid record (mac)" \ |
| 8193 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8194 | -s "Extra-header:" \ |
| 8195 | -c "HTTP/1.0 200 OK" \ |
| 8196 | -S "too many records with bad MAC" \ |
| 8197 | -S "Verification of the message MAC failed" |
| 8198 | |
| 8199 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8200 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8201 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8202 | "$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] | 8203 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8204 | -c "discarding invalid record (mac)" \ |
| 8205 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8206 | -s "Extra-header:" \ |
| 8207 | -c "HTTP/1.0 200 OK" \ |
| 8208 | -s "too many records with bad MAC" \ |
| 8209 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8210 | |
| 8211 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8212 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8213 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8214 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8215 | 0 \ |
| 8216 | -c "record from another epoch" \ |
| 8217 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8218 | -s "Extra-header:" \ |
| 8219 | -c "HTTP/1.0 200 OK" |
| 8220 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8221 | # Tests for reordering support with DTLS |
| 8222 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8223 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8224 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8225 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8226 | hs_timeout=2500-60000" \ |
| 8227 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8228 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8229 | 0 \ |
| 8230 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8231 | -c "Next handshake message has been buffered - load"\ |
| 8232 | -S "Buffering HS message" \ |
| 8233 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8234 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8235 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8236 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8237 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8238 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8239 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8240 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8241 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8242 | hs_timeout=2500-60000" \ |
| 8243 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8244 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8245 | 0 \ |
| 8246 | -c "Buffering HS message" \ |
| 8247 | -c "found fragmented DTLS handshake message"\ |
| 8248 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8249 | -c "Next handshake message has been buffered - load"\ |
| 8250 | -S "Buffering HS message" \ |
| 8251 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8252 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8253 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8254 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8255 | -S "Remember CCS message" |
| 8256 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8257 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8258 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8259 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8260 | # while keeping the ServerKeyExchange. |
| 8261 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8262 | 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] | 8263 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8264 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8265 | hs_timeout=2500-60000" \ |
| 8266 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8267 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8268 | 0 \ |
| 8269 | -c "Buffering HS message" \ |
| 8270 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8271 | -C "attempt to make space by freeing buffered messages" \ |
| 8272 | -S "Buffering HS message" \ |
| 8273 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8274 | -C "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8275 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8276 | -S "Injecting buffered CCS message" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8277 | -S "Remember CCS message" |
| 8278 | |
| 8279 | # The size constraints ensure that the delayed certificate message can't |
| 8280 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8281 | # when dropping it first. |
| 8282 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8283 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8284 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8285 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8286 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8287 | hs_timeout=2500-60000" \ |
| 8288 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8289 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8290 | 0 \ |
| 8291 | -c "Buffering HS message" \ |
| 8292 | -c "attempt to make space by freeing buffered future messages" \ |
| 8293 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8294 | -S "Buffering HS message" \ |
| 8295 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8296 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8297 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8298 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8299 | -S "Remember CCS message" |
| 8300 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8301 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8302 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8303 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8304 | hs_timeout=2500-60000" \ |
| 8305 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8306 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8307 | 0 \ |
| 8308 | -C "Buffering HS message" \ |
| 8309 | -C "Next handshake message has been buffered - load"\ |
| 8310 | -s "Buffering HS message" \ |
| 8311 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8312 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8313 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8314 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8315 | -S "Remember CCS message" |
| 8316 | |
| 8317 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8318 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8319 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8320 | hs_timeout=2500-60000" \ |
| 8321 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8322 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8323 | 0 \ |
| 8324 | -C "Buffering HS message" \ |
| 8325 | -C "Next handshake message has been buffered - load"\ |
| 8326 | -S "Buffering HS message" \ |
| 8327 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8328 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8329 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8330 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8331 | -S "Remember CCS message" |
| 8332 | |
| 8333 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8334 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8335 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8336 | hs_timeout=2500-60000" \ |
| 8337 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8338 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8339 | 0 \ |
| 8340 | -C "Buffering HS message" \ |
| 8341 | -C "Next handshake message has been buffered - load"\ |
| 8342 | -S "Buffering HS message" \ |
| 8343 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8344 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8345 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8346 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8347 | -s "Remember CCS message" |
| 8348 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8349 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8350 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8351 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8352 | hs_timeout=2500-60000" \ |
| 8353 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8354 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8355 | 0 \ |
| 8356 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8357 | -s "Found buffered record from current epoch - load" \ |
| 8358 | -c "Buffer record from epoch 1" \ |
| 8359 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8360 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8361 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8362 | # from the server are delayed, so that the encrypted Finished message |
| 8363 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8364 | # in afterwards, the encrypted Finished message must be freed in order |
| 8365 | # to make space for the NewSessionTicket to be reassembled. |
| 8366 | # This works only in very particular circumstances: |
| 8367 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8368 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8369 | # the encrypted Finished message. |
| 8370 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8371 | # needs to be fragmented. |
| 8372 | # - All messages sent by the server must be small enough to be either sent |
| 8373 | # without fragmentation or be reassembled within the bounds of |
| 8374 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8375 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8376 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8377 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8378 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8379 | -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] | 8380 | "$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] | 8381 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8382 | 0 \ |
| 8383 | -s "Buffer record from epoch 1" \ |
| 8384 | -s "Found buffered record from current epoch - load" \ |
| 8385 | -c "Buffer record from epoch 1" \ |
| 8386 | -C "Found buffered record from current epoch - load" \ |
| 8387 | -c "Enough space available after freeing future epoch record" |
| 8388 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8389 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8390 | |
| 8391 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8392 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8393 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8394 | "$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] | 8395 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8396 | "$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] | 8397 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8398 | 0 \ |
| 8399 | -s "Extra-header:" \ |
| 8400 | -c "HTTP/1.0 200 OK" |
| 8401 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8402 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8403 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8404 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8405 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8406 | "$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] | 8407 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8408 | 0 \ |
| 8409 | -s "Extra-header:" \ |
| 8410 | -c "HTTP/1.0 200 OK" |
| 8411 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8412 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8413 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8414 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8415 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8416 | "$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] | 8417 | 0 \ |
| 8418 | -s "Extra-header:" \ |
| 8419 | -c "HTTP/1.0 200 OK" |
| 8420 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8421 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8422 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8423 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8424 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8425 | "$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] | 8426 | 0 \ |
| 8427 | -s "Extra-header:" \ |
| 8428 | -c "HTTP/1.0 200 OK" |
| 8429 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8430 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8431 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8432 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8433 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8434 | "$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] | 8435 | 0 \ |
| 8436 | -s "Extra-header:" \ |
| 8437 | -c "HTTP/1.0 200 OK" |
| 8438 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8439 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8440 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8441 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8442 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8443 | "$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] | 8444 | 0 \ |
| 8445 | -s "Extra-header:" \ |
| 8446 | -c "HTTP/1.0 200 OK" |
| 8447 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8448 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8449 | run_test "DTLS proxy: 3d, max handshake, nbio" \ |
| 8450 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8451 | "$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] | 8452 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8453 | "$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] | 8454 | 0 \ |
| 8455 | -s "Extra-header:" \ |
| 8456 | -c "HTTP/1.0 200 OK" |
| 8457 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8458 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8459 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8460 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8461 | "$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] | 8462 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8463 | "$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] | 8464 | 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] | 8465 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8466 | 0 \ |
| 8467 | -s "a session has been resumed" \ |
| 8468 | -c "a session has been resumed" \ |
| 8469 | -s "Extra-header:" \ |
| 8470 | -c "HTTP/1.0 200 OK" |
| 8471 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8472 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8473 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8474 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8475 | "$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] | 8476 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8477 | "$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] | 8478 | 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] | 8479 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8480 | 0 \ |
| 8481 | -s "a session has been resumed" \ |
| 8482 | -c "a session has been resumed" \ |
| 8483 | -s "Extra-header:" \ |
| 8484 | -c "HTTP/1.0 200 OK" |
| 8485 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8486 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8487 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8488 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 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 | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 8491 | psk=abc123 renegotiation=1 debug_level=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 | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 8493 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8494 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8495 | 0 \ |
| 8496 | -c "=> renegotiate" \ |
| 8497 | -s "=> renegotiate" \ |
| 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, nbio" \ |
| 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 | 6093d81 | 2014-09-29 17:52:57 +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 | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8518 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 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 | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8521 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8522 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8523 | "$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] | 8524 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8525 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8526 | 0 \ |
| 8527 | -c "=> renegotiate" \ |
| 8528 | -s "=> renegotiate" \ |
| 8529 | -s "Extra-header:" \ |
| 8530 | -c "HTTP/1.0 200 OK" |
| 8531 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8532 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8533 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8534 | 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] | 8535 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8536 | "$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] | 8537 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8538 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8539 | "$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] | 8540 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8541 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8542 | 0 \ |
| 8543 | -c "=> renegotiate" \ |
| 8544 | -s "=> renegotiate" \ |
| 8545 | -s "Extra-header:" \ |
| 8546 | -c "HTTP/1.0 200 OK" |
| 8547 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8548 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8549 | ## all versions installed on the CI machines), reported here: |
| 8550 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8551 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8552 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8553 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8554 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8555 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8556 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8557 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8558 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8559 | "$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] | 8560 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8561 | -c "HTTP/1.0 200 OK" |
| 8562 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8563 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8564 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8565 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8566 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8567 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8568 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8569 | "$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] | 8570 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8571 | -c "HTTP/1.0 200 OK" |
| 8572 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8573 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8574 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8575 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8576 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8577 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8578 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8579 | "$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] | 8580 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8581 | -c "HTTP/1.0 200 OK" |
| 8582 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8583 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8584 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8585 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8586 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8587 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8588 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8589 | "$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] | 8590 | 0 \ |
| 8591 | -s "Extra-header:" \ |
| 8592 | -c "Extra-header:" |
| 8593 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8594 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8595 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8596 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8597 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8598 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8599 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8600 | "$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] | 8601 | 0 \ |
| 8602 | -s "Extra-header:" \ |
| 8603 | -c "Extra-header:" |
| 8604 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8605 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8606 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8607 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8608 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8609 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8610 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8611 | "$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] | 8612 | 0 \ |
| 8613 | -s "Extra-header:" \ |
| 8614 | -c "Extra-header:" |
| 8615 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8616 | requires_config_enabled MBEDTLS_SSL_EXPORT_KEYS |
| 8617 | run_test "export keys functionality" \ |
| 8618 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8619 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8620 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8621 | -c "EAP-TLS key material is:"\ |
| 8622 | -s "EAP-TLS key material is:"\ |
| 8623 | -c "EAP-TLS IV is:" \ |
| 8624 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8625 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8626 | # openssl feature tests: check if tls1.3 exists. |
| 8627 | requires_openssl_tls1_3 |
| 8628 | run_test "TLS1.3: Test openssl tls1_3 feature" \ |
| 8629 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 8630 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 8631 | 0 \ |
| 8632 | -c "TLS 1.3" \ |
| 8633 | -s "TLS 1.3" |
| 8634 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 8635 | # 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] | 8636 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8637 | requires_gnutls_next_no_ticket |
| 8638 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8639 | run_test "TLS1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8640 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 8641 | "$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] | 8642 | 0 \ |
| 8643 | -s "Version: TLS1.3" \ |
| 8644 | -c "Version: TLS1.3" |
| 8645 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8646 | # TLS1.3 test cases |
| 8647 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 8648 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8649 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8650 | skip_handshake_stage_check |
| 8651 | run_test "TLS1.3: Not supported version check: tls1_2 and tls1_3" \ |
| 8652 | "$P_SRV debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8653 | "$P_CLI debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8654 | 1 \ |
| 8655 | -s "SSL - The requested feature is not available" \ |
| 8656 | -c "SSL - The requested feature is not available" \ |
| 8657 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 8658 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 8659 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8660 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8661 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8662 | run_test "TLS1.3: handshake dispatch test: tls1_3 only" \ |
Jerry Yu | 3523a3b | 2021-09-14 16:29:49 +0800 | [diff] [blame] | 8663 | "$P_SRV debug_level=2 min_version=tls1_3 max_version=tls1_3" \ |
| 8664 | "$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] | 8665 | 1 \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame^] | 8666 | -s "tls1_3 server state: 0" \ |
| 8667 | -c "tls1_3 client state: 0" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8668 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8669 | requires_openssl_tls1_3 |
| 8670 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8671 | run_test "TLS1.3: Test client hello msg work - openssl" \ |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8672 | "$O_NEXT_SRV -tls1_3 -msg" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame^] | 8673 | "$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] | 8674 | 1 \ |
| 8675 | -c "SSL - The requested feature is not available" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame^] | 8676 | -s "ServerHello" \ |
| 8677 | -c "tls1_3 client state: 0" \ |
| 8678 | -c "tls1_3 client state: 2" \ |
| 8679 | -c "tls1_3 client state: 19" \ |
| 8680 | -c "tls1_3 client state: 5" \ |
| 8681 | -c "tls1_3 client state: 3" \ |
| 8682 | -c "tls1_3 client state: 9" \ |
| 8683 | -c "tls1_3 client state: 13" \ |
| 8684 | -c "tls1_3 client state: 7" \ |
| 8685 | -c "tls1_3 client state: 20" \ |
| 8686 | -c "tls1_3 client state: 11" \ |
| 8687 | -c "tls1_3 client state: 14" \ |
| 8688 | -c "tls1_3 client state: 15" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8689 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8690 | requires_gnutls_tls1_3 |
| 8691 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8692 | run_test "TLS1.3: Test client hello msg work - gnutls" \ |
| 8693 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --debug=4" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame^] | 8694 | "$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] | 8695 | 1 \ |
| 8696 | -c "SSL - The requested feature is not available" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame^] | 8697 | -s "SERVER HELLO was queued" \ |
| 8698 | -c "tls1_3 client state: 0" \ |
| 8699 | -c "tls1_3 client state: 2" \ |
| 8700 | -c "tls1_3 client state: 19" \ |
| 8701 | -c "tls1_3 client state: 5" \ |
| 8702 | -c "tls1_3 client state: 3" \ |
| 8703 | -c "tls1_3 client state: 9" \ |
| 8704 | -c "tls1_3 client state: 13" \ |
| 8705 | -c "tls1_3 client state: 7" \ |
| 8706 | -c "tls1_3 client state: 20" \ |
| 8707 | -c "tls1_3 client state: 11" \ |
| 8708 | -c "tls1_3 client state: 14" \ |
| 8709 | -c "tls1_3 client state: 15" |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8710 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8711 | # Test heap memory usage after handshake |
| 8712 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8713 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8714 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8715 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8716 | run_tests_memory_after_hanshake |
| 8717 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8718 | # Final report |
| 8719 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8720 | echo "------------------------------------------------------------------------" |
| 8721 | |
| 8722 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8723 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8724 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8725 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8726 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8727 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8728 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8729 | |
| 8730 | exit $FAILS |