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 |
Paul Elliott | 1428f25 | 2021-10-12 16:02:55 +0100 | [diff] [blame] | 756 | *dtls=1*|*-dtls*|*-u*) DTLS=1;; |
Gilles Peskine | 6445749 | 2020-08-26 21:53:33 +0200 | [diff] [blame] | 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 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 798 | # Analyze the commands that will be used in a test. |
| 799 | # |
| 800 | # Analyze and possibly instrument $PXY_CMD, $CLI_CMD, $SRV_CMD to pass |
| 801 | # extra arguments or go through wrappers. |
| 802 | # Set $DTLS (0=TLS, 1=DTLS). |
| 803 | analyze_test_commands() { |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 804 | # update DTLS variable |
| 805 | detect_dtls "$SRV_CMD" |
| 806 | |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 807 | # if the test uses DTLS but no custom proxy, add a simple proxy |
| 808 | # 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] | 809 | if [ -z "$PXY_CMD" ] && [ "$DTLS" -eq 1 ]; then |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 810 | PXY_CMD="$P_PXY" |
Manuel Pégourié-Gonnard | 8779e9a | 2020-07-16 10:19:32 +0200 | [diff] [blame] | 811 | case " $SRV_CMD " in |
| 812 | *' server_addr=::1 '*) |
| 813 | PXY_CMD="$PXY_CMD server_addr=::1 listen_addr=::1";; |
| 814 | esac |
Manuel Pégourié-Gonnard | f455786 | 2020-06-08 11:40:06 +0200 | [diff] [blame] | 815 | fi |
| 816 | |
Dave Rodgman | 0279c2f | 2021-02-10 12:45:41 +0000 | [diff] [blame] | 817 | # update CMD_IS_GNUTLS variable |
| 818 | is_gnutls "$SRV_CMD" |
| 819 | |
| 820 | # if the server uses gnutls but doesn't set priority, explicitly |
| 821 | # set the default priority |
| 822 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 823 | case "$SRV_CMD" in |
| 824 | *--priority*) :;; |
| 825 | *) SRV_CMD="$SRV_CMD --priority=NORMAL";; |
| 826 | esac |
| 827 | fi |
| 828 | |
| 829 | # update CMD_IS_GNUTLS variable |
| 830 | is_gnutls "$CLI_CMD" |
| 831 | |
| 832 | # if the client uses gnutls but doesn't set priority, explicitly |
| 833 | # set the default priority |
| 834 | if [ "$CMD_IS_GNUTLS" -eq 1 ]; then |
| 835 | case "$CLI_CMD" in |
| 836 | *--priority*) :;; |
| 837 | *) CLI_CMD="$CLI_CMD --priority=NORMAL";; |
| 838 | esac |
| 839 | fi |
| 840 | |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 841 | # fix client port |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 842 | if [ -n "$PXY_CMD" ]; then |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 843 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$PXY_PORT/g ) |
| 844 | else |
| 845 | CLI_CMD=$( echo "$CLI_CMD" | sed s/+SRV_PORT/$SRV_PORT/g ) |
| 846 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 847 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 848 | # prepend valgrind to our commands if active |
| 849 | if [ "$MEMCHECK" -gt 0 ]; then |
| 850 | if is_polar "$SRV_CMD"; then |
| 851 | SRV_CMD="valgrind --leak-check=full $SRV_CMD" |
| 852 | fi |
| 853 | if is_polar "$CLI_CMD"; then |
| 854 | CLI_CMD="valgrind --leak-check=full $CLI_CMD" |
| 855 | fi |
| 856 | fi |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 857 | } |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 858 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 859 | # Check for failure conditions after a test case. |
| 860 | # |
| 861 | # Inputs from run_test: |
| 862 | # * positional parameters: test options (see run_test documentation) |
| 863 | # * $CLI_EXIT: client return code |
| 864 | # * $CLI_EXPECT: expected client return code |
| 865 | # * $SRV_RET: server return code |
| 866 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files containing client/server/proxy logs |
| 867 | # |
| 868 | # Outputs: |
| 869 | # * $pass: set to 1 if no failures are detected, 0 otherwise |
| 870 | check_test_failure() { |
| 871 | pass=0 |
Manuel Pégourié-Gonnard | a365add | 2015-08-04 20:57:59 +0200 | [diff] [blame] | 872 | |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 873 | # 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] | 874 | # (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] | 875 | # expected client exit to incorrectly succeed in case of catastrophic |
| 876 | # failure) |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 877 | if [ "X$SKIP_HANDSHAKE_CHECK" != "XYES" ] |
| 878 | then |
| 879 | if is_polar "$SRV_CMD"; then |
| 880 | if grep "Performing the SSL/TLS handshake" $SRV_OUT >/dev/null; then :; |
| 881 | else |
| 882 | fail "server or client failed to reach handshake stage" |
| 883 | return |
| 884 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 885 | fi |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 886 | if is_polar "$CLI_CMD"; then |
| 887 | if grep "Performing the SSL/TLS handshake" $CLI_OUT >/dev/null; then :; |
| 888 | else |
| 889 | fail "server or client failed to reach handshake stage" |
| 890 | return |
| 891 | fi |
Manuel Pégourié-Gonnard | 677884d | 2014-02-25 16:42:31 +0100 | [diff] [blame] | 892 | fi |
| 893 | fi |
| 894 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 895 | SKIP_HANDSHAKE_CHECK="NO" |
Gilles Peskine | aaf866e | 2021-02-09 21:01:33 +0100 | [diff] [blame] | 896 | # Check server exit code (only for Mbed TLS: GnuTLS and OpenSSL don't |
| 897 | # exit with status 0 when interrupted by a signal, and we don't really |
| 898 | # care anyway), in case e.g. the server reports a memory leak. |
| 899 | if [ $SRV_RET != 0 ] && is_polar "$SRV_CMD"; then |
Gilles Peskine | 7f919de | 2021-02-02 23:29:03 +0100 | [diff] [blame] | 900 | fail "Server exited with status $SRV_RET" |
Manuel Pégourié-Gonnard | f8bdbb5 | 2014-02-21 09:20:14 +0100 | [diff] [blame] | 901 | return |
| 902 | fi |
| 903 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 904 | # check client exit code |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 905 | if [ \( "$CLI_EXPECT" = 0 -a "$CLI_EXIT" != 0 \) -o \ |
| 906 | \( "$CLI_EXPECT" != 0 -a "$CLI_EXIT" = 0 \) ] |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 907 | then |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 908 | 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] | 909 | return |
| 910 | fi |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 911 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 912 | # check other assertions |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 913 | # lines beginning with == are added by valgrind, ignore them |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 914 | # 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] | 915 | while [ $# -gt 0 ] |
| 916 | do |
| 917 | case $1 in |
| 918 | "-s") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 919 | 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] | 920 | fail "pattern '$2' MUST be present in the Server output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 921 | return |
| 922 | fi |
| 923 | ;; |
| 924 | |
| 925 | "-c") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 926 | 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] | 927 | fail "pattern '$2' MUST be present in the Client output" |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 928 | return |
| 929 | fi |
| 930 | ;; |
| 931 | |
| 932 | "-S") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 933 | 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] | 934 | 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] | 935 | return |
| 936 | fi |
| 937 | ;; |
| 938 | |
| 939 | "-C") |
Paul Bakker | 1f65092 | 2016-05-13 10:16:46 +0100 | [diff] [blame] | 940 | 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] | 941 | fail "pattern '$2' MUST NOT be present in the Client output" |
| 942 | return |
| 943 | fi |
| 944 | ;; |
| 945 | |
| 946 | # The filtering in the following two options (-u and -U) do the following |
| 947 | # - ignore valgrind output |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 948 | # - filter out everything but lines right after the pattern occurrences |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 949 | # - keep one of each non-unique line |
| 950 | # - count how many lines remain |
| 951 | # A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1 |
| 952 | # if there were no duplicates. |
| 953 | "-U") |
| 954 | 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 |
| 955 | fail "lines following pattern '$2' must be unique in Server output" |
| 956 | return |
| 957 | fi |
| 958 | ;; |
| 959 | |
| 960 | "-u") |
| 961 | 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 |
| 962 | 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] | 963 | return |
| 964 | fi |
| 965 | ;; |
Andres Amaya Garcia | 93993de | 2017-09-06 15:38:07 +0100 | [diff] [blame] | 966 | "-F") |
| 967 | if ! $2 "$SRV_OUT"; then |
| 968 | fail "function call to '$2' failed on Server output" |
| 969 | return |
| 970 | fi |
| 971 | ;; |
| 972 | "-f") |
| 973 | if ! $2 "$CLI_OUT"; then |
| 974 | fail "function call to '$2' failed on Client output" |
| 975 | return |
| 976 | fi |
| 977 | ;; |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 978 | "-g") |
| 979 | if ! eval "$2 '$SRV_OUT' '$CLI_OUT'"; then |
| 980 | fail "function call to '$2' failed on Server and Client output" |
| 981 | return |
| 982 | fi |
| 983 | ;; |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 984 | |
| 985 | *) |
Paul Bakker | 1ebc0c5 | 2014-05-22 15:47:58 +0200 | [diff] [blame] | 986 | echo "Unknown test: $1" >&2 |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 987 | exit 1 |
| 988 | esac |
| 989 | shift 2 |
| 990 | done |
| 991 | |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 992 | # check valgrind's results |
| 993 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 994 | 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] | 995 | fail "Server has memory errors" |
| 996 | return |
| 997 | fi |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 998 | 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] | 999 | fail "Client has memory errors" |
| 1000 | return |
| 1001 | fi |
| 1002 | fi |
| 1003 | |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1004 | # if we're here, everything is ok |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1005 | pass=1 |
| 1006 | } |
| 1007 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame^] | 1008 | # Run the current test case: start the server and if applicable the proxy, run |
| 1009 | # the client, wait for all processes to finish or time out. |
| 1010 | # |
| 1011 | # Inputs: |
| 1012 | # * $NAME: test case name |
| 1013 | # * $CLI_CMD, $SRV_CMD, $PXY_CMD: commands to run |
| 1014 | # * $CLI_OUT, $SRV_OUT, $PXY_OUT: files to contain client/server/proxy logs |
| 1015 | # |
| 1016 | # Outputs: |
| 1017 | # * $CLI_EXIT: client return code |
| 1018 | # * $SRV_RET: server return code |
| 1019 | do_run_test_once() { |
| 1020 | # run the commands |
| 1021 | if [ -n "$PXY_CMD" ]; then |
| 1022 | printf "# %s\n%s\n" "$NAME" "$PXY_CMD" > $PXY_OUT |
| 1023 | $PXY_CMD >> $PXY_OUT 2>&1 & |
| 1024 | PXY_PID=$! |
| 1025 | wait_proxy_start "$PXY_PORT" "$PXY_PID" |
| 1026 | fi |
| 1027 | |
| 1028 | check_osrv_dtls |
| 1029 | printf '# %s\n%s\n' "$NAME" "$SRV_CMD" > $SRV_OUT |
| 1030 | provide_input | $SRV_CMD >> $SRV_OUT 2>&1 & |
| 1031 | SRV_PID=$! |
| 1032 | wait_server_start "$SRV_PORT" "$SRV_PID" |
| 1033 | |
| 1034 | printf '# %s\n%s\n' "$NAME" "$CLI_CMD" > $CLI_OUT |
| 1035 | eval "$CLI_CMD" >> $CLI_OUT 2>&1 & |
| 1036 | wait_client_done |
| 1037 | |
| 1038 | sleep 0.05 |
| 1039 | |
| 1040 | # terminate the server (and the proxy) |
| 1041 | kill $SRV_PID |
| 1042 | wait $SRV_PID |
| 1043 | SRV_RET=$? |
| 1044 | |
| 1045 | if [ -n "$PXY_CMD" ]; then |
| 1046 | kill $PXY_PID >/dev/null 2>&1 |
| 1047 | wait $PXY_PID |
| 1048 | fi |
| 1049 | } |
| 1050 | |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1051 | # Usage: run_test name [-p proxy_cmd] srv_cmd cli_cmd cli_exit [option [...]] |
| 1052 | # Options: -s pattern pattern that must be present in server output |
| 1053 | # -c pattern pattern that must be present in client output |
| 1054 | # -u pattern lines after pattern must be unique in client output |
| 1055 | # -f call shell function on client output |
| 1056 | # -S pattern pattern that must be absent in server output |
| 1057 | # -C pattern pattern that must be absent in client output |
| 1058 | # -U pattern lines after pattern must be unique in server output |
| 1059 | # -F call shell function on server output |
| 1060 | # -g call shell function on server and client output |
| 1061 | run_test() { |
| 1062 | NAME="$1" |
| 1063 | shift 1 |
| 1064 | |
| 1065 | if is_excluded "$NAME"; then |
| 1066 | SKIP_NEXT="NO" |
| 1067 | # There was no request to run the test, so don't record its outcome. |
| 1068 | return |
| 1069 | fi |
| 1070 | |
| 1071 | print_name "$NAME" |
| 1072 | |
| 1073 | # Do we only run numbered tests? |
| 1074 | if [ -n "$RUN_TEST_NUMBER" ]; then |
| 1075 | case ",$RUN_TEST_NUMBER," in |
| 1076 | *",$TESTS,"*) :;; |
| 1077 | *) SKIP_NEXT="YES";; |
| 1078 | esac |
| 1079 | fi |
| 1080 | |
| 1081 | # does this test use a proxy? |
| 1082 | if [ "X$1" = "X-p" ]; then |
| 1083 | PXY_CMD="$2" |
| 1084 | shift 2 |
| 1085 | else |
| 1086 | PXY_CMD="" |
| 1087 | fi |
| 1088 | |
| 1089 | # get commands and client output |
| 1090 | SRV_CMD="$1" |
| 1091 | CLI_CMD="$2" |
| 1092 | CLI_EXPECT="$3" |
| 1093 | shift 3 |
| 1094 | |
| 1095 | # Check if test uses files |
| 1096 | case "$SRV_CMD $CLI_CMD" in |
| 1097 | *data_files/*) |
| 1098 | requires_config_enabled MBEDTLS_FS_IO;; |
| 1099 | esac |
| 1100 | |
| 1101 | # If the client or serve requires a ciphersuite, check that it's enabled. |
| 1102 | maybe_requires_ciphersuite_enabled "$SRV_CMD" "$@" |
| 1103 | maybe_requires_ciphersuite_enabled "$CLI_CMD" "$@" |
| 1104 | |
| 1105 | # should we skip? |
| 1106 | if [ "X$SKIP_NEXT" = "XYES" ]; then |
| 1107 | SKIP_NEXT="NO" |
| 1108 | record_outcome "SKIP" |
| 1109 | SKIPS=$(( $SKIPS + 1 )) |
| 1110 | return |
| 1111 | fi |
| 1112 | |
| 1113 | analyze_test_commands "$@" |
| 1114 | |
| 1115 | TIMES_LEFT=2 |
| 1116 | while [ $TIMES_LEFT -gt 0 ]; do |
| 1117 | TIMES_LEFT=$(( $TIMES_LEFT - 1 )) |
| 1118 | |
Gilles Peskine | 196d73b | 2021-10-19 16:35:35 +0200 | [diff] [blame^] | 1119 | do_run_test_once |
Gilles Peskine | 236bf98 | 2021-10-19 16:25:10 +0200 | [diff] [blame] | 1120 | |
| 1121 | # retry only on timeouts |
| 1122 | if grep '===CLIENT_TIMEOUT===' $CLI_OUT >/dev/null; then |
| 1123 | printf "RETRY " |
| 1124 | else |
| 1125 | TIMES_LEFT=0 |
| 1126 | fi |
| 1127 | done |
| 1128 | |
| 1129 | check_test_failure "$@" |
| 1130 | if [ "$pass" -eq 0 ]; then |
| 1131 | return |
| 1132 | fi |
| 1133 | |
Gilles Peskine | 560280b | 2019-09-16 15:17:38 +0200 | [diff] [blame] | 1134 | record_outcome "PASS" |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1135 | if [ "$PRESERVE_LOGS" -gt 0 ]; then |
| 1136 | mv $SRV_OUT o-srv-${TESTS}.log |
| 1137 | mv $CLI_OUT o-cli-${TESTS}.log |
Hanno Becker | 7be2e5b | 2018-08-20 12:21:35 +0100 | [diff] [blame] | 1138 | if [ -n "$PXY_CMD" ]; then |
| 1139 | mv $PXY_OUT o-pxy-${TESTS}.log |
| 1140 | fi |
Paul Bakker | acaac85 | 2016-05-10 11:47:13 +0100 | [diff] [blame] | 1141 | fi |
| 1142 | |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1143 | rm -f $SRV_OUT $CLI_OUT $PXY_OUT |
Manuel Pégourié-Gonnard | eaadc50 | 2014-02-20 11:01:30 +0100 | [diff] [blame] | 1144 | } |
| 1145 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1146 | run_test_psa() { |
| 1147 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
Hanno Becker | e9420c2 | 2018-11-20 11:37:34 +0000 | [diff] [blame] | 1148 | run_test "PSA-supported ciphersuite: $1" \ |
Hanno Becker | 4c8c7aa | 2019-04-10 09:25:41 +0100 | [diff] [blame] | 1149 | "$P_SRV debug_level=3 force_version=tls1_2" \ |
| 1150 | "$P_CLI debug_level=3 force_version=tls1_2 force_ciphersuite=$1" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1151 | 0 \ |
| 1152 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1153 | -c "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1154 | -c "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1155 | -c "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1156 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1157 | -s "Successfully setup PSA-based encryption cipher context" \ |
Andrzej Kurek | 683d77e | 2019-01-30 03:50:42 -0500 | [diff] [blame] | 1158 | -s "PSA calc verify" \ |
Andrzej Kurek | 92dd4d0 | 2019-01-30 04:10:19 -0500 | [diff] [blame] | 1159 | -s "calc PSA finished" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1160 | -C "Failed to setup PSA-based cipher context"\ |
| 1161 | -S "Failed to setup PSA-based cipher context"\ |
| 1162 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1163 | -c "Perform PSA-based ECDH computation."\ |
Andrzej Kurek | e85414e | 2019-01-15 05:23:59 -0500 | [diff] [blame] | 1164 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1165 | -S "error" \ |
| 1166 | -C "error" |
| 1167 | } |
| 1168 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1169 | run_test_psa_force_curve() { |
| 1170 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1171 | run_test "PSA - ECDH with $1" \ |
Gilles Peskine | 12b5b38 | 2021-06-02 10:00:42 +0200 | [diff] [blame] | 1172 | "$P_SRV debug_level=4 force_version=tls1_2 curves=$1" \ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1173 | "$P_CLI debug_level=4 force_version=tls1_2 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-GCM-SHA256 curves=$1" \ |
| 1174 | 0 \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1175 | -c "Successfully setup PSA-based decryption cipher context" \ |
| 1176 | -c "Successfully setup PSA-based encryption cipher context" \ |
| 1177 | -c "PSA calc verify" \ |
| 1178 | -c "calc PSA finished" \ |
| 1179 | -s "Successfully setup PSA-based decryption cipher context" \ |
| 1180 | -s "Successfully setup PSA-based encryption cipher context" \ |
| 1181 | -s "PSA calc verify" \ |
| 1182 | -s "calc PSA finished" \ |
| 1183 | -C "Failed to setup PSA-based cipher context"\ |
| 1184 | -S "Failed to setup PSA-based cipher context"\ |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1185 | -s "Protocol is TLSv1.2" \ |
Hanno Becker | 28f7844 | 2019-02-18 16:47:50 +0000 | [diff] [blame] | 1186 | -c "Perform PSA-based ECDH computation."\ |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1187 | -c "Perform PSA-based computation of digest of ServerKeyExchange" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1188 | -S "error" \ |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1189 | -C "error" |
| 1190 | } |
| 1191 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1192 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1193 | # a maximum fragment length. |
| 1194 | # first argument ($1) is MFL for SSL client |
| 1195 | # second argument ($2) is memory usage for SSL client with default MFL (16k) |
| 1196 | run_test_memory_after_hanshake_with_mfl() |
| 1197 | { |
| 1198 | # The test passes if the difference is around 2*(16k-MFL) |
Gilles Peskine | 5b428d7 | 2020-08-26 21:52:23 +0200 | [diff] [blame] | 1199 | MEMORY_USAGE_LIMIT="$(( $2 - ( 2 * ( 16384 - $1 )) ))" |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 1200 | |
| 1201 | # Leave some margin for robustness |
| 1202 | MEMORY_USAGE_LIMIT="$(( ( MEMORY_USAGE_LIMIT * 110 ) / 100 ))" |
| 1203 | |
| 1204 | run_test "Handshake memory usage (MFL $1)" \ |
| 1205 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1206 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1207 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1208 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM max_frag_len=$1" \ |
| 1209 | 0 \ |
| 1210 | -F "handshake_memory_check $MEMORY_USAGE_LIMIT" |
| 1211 | } |
| 1212 | |
| 1213 | |
| 1214 | # Test that the server's memory usage after a handshake is reduced when a client specifies |
| 1215 | # different values of Maximum Fragment Length: default (16k), 4k, 2k, 1k and 512 bytes |
| 1216 | run_tests_memory_after_hanshake() |
| 1217 | { |
| 1218 | # all tests in this sequence requires the same configuration (see requires_config_enabled()) |
| 1219 | SKIP_THIS_TESTS="$SKIP_NEXT" |
| 1220 | |
| 1221 | # first test with default MFU is to get reference memory usage |
| 1222 | MEMORY_USAGE_MFL_16K=0 |
| 1223 | run_test "Handshake memory usage initial (MFL 16384 - default)" \ |
| 1224 | "$P_SRV debug_level=3 auth_mode=required force_version=tls1_2" \ |
| 1225 | "$P_CLI debug_level=3 force_version=tls1_2 \ |
| 1226 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 1227 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM" \ |
| 1228 | 0 \ |
| 1229 | -F "handshake_memory_get MEMORY_USAGE_MFL_16K" |
| 1230 | |
| 1231 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1232 | run_test_memory_after_hanshake_with_mfl 4096 "$MEMORY_USAGE_MFL_16K" |
| 1233 | |
| 1234 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1235 | run_test_memory_after_hanshake_with_mfl 2048 "$MEMORY_USAGE_MFL_16K" |
| 1236 | |
| 1237 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1238 | run_test_memory_after_hanshake_with_mfl 1024 "$MEMORY_USAGE_MFL_16K" |
| 1239 | |
| 1240 | SKIP_NEXT="$SKIP_THIS_TESTS" |
| 1241 | run_test_memory_after_hanshake_with_mfl 512 "$MEMORY_USAGE_MFL_16K" |
| 1242 | } |
| 1243 | |
Manuel Pégourié-Gonnard | a9062e9 | 2014-02-25 16:21:22 +0100 | [diff] [blame] | 1244 | cleanup() { |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1245 | rm -f $CLI_OUT $SRV_OUT $PXY_OUT $SESSION |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1246 | rm -f context_srv.txt |
| 1247 | rm -f context_cli.txt |
Manuel Pégourié-Gonnard | a6189f0 | 2014-09-20 13:15:43 +0200 | [diff] [blame] | 1248 | test -n "${SRV_PID:-}" && kill $SRV_PID >/dev/null 2>&1 |
| 1249 | test -n "${PXY_PID:-}" && kill $PXY_PID >/dev/null 2>&1 |
| 1250 | test -n "${CLI_PID:-}" && kill $CLI_PID >/dev/null 2>&1 |
| 1251 | 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] | 1252 | exit 1 |
| 1253 | } |
| 1254 | |
Manuel Pégourié-Gonnard | 9dea8bd | 2014-02-26 18:21:02 +0100 | [diff] [blame] | 1255 | # |
| 1256 | # MAIN |
| 1257 | # |
| 1258 | |
Manuel Pégourié-Gonnard | 913030c | 2014-03-28 10:12:38 +0100 | [diff] [blame] | 1259 | get_options "$@" |
| 1260 | |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1261 | # Optimize filters: if $FILTER and $EXCLUDE can be expressed as shell |
| 1262 | # patterns rather than regular expressions, use a case statement instead |
| 1263 | # of calling grep. To keep the optimizer simple, it is incomplete and only |
| 1264 | # detects simple cases: plain substring, everything, nothing. |
| 1265 | # |
| 1266 | # As an exception, the character '.' is treated as an ordinary character |
| 1267 | # if it is the only special character in the string. This is because it's |
| 1268 | # rare to need "any one character", but needing a literal '.' is common |
| 1269 | # (e.g. '-f "DTLS 1.2"'). |
| 1270 | need_grep= |
| 1271 | case "$FILTER" in |
| 1272 | '^$') simple_filter=;; |
| 1273 | '.*') simple_filter='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1274 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1275 | need_grep=1;; |
| 1276 | *) # No regexp or shell-pattern special character |
| 1277 | simple_filter="*$FILTER*";; |
| 1278 | esac |
| 1279 | case "$EXCLUDE" in |
| 1280 | '^$') simple_exclude=;; |
| 1281 | '.*') simple_exclude='*';; |
Gilles Peskine | b09e001 | 2020-09-29 23:48:39 +0200 | [diff] [blame] | 1282 | *[][$+*?\\^{\|}]*) # Regexp special characters (other than .), we need grep |
Gilles Peskine | 9fa4ed6 | 2020-08-26 22:35:46 +0200 | [diff] [blame] | 1283 | need_grep=1;; |
| 1284 | *) # No regexp or shell-pattern special character |
| 1285 | simple_exclude="*$EXCLUDE*";; |
| 1286 | esac |
| 1287 | if [ -n "$need_grep" ]; then |
| 1288 | is_excluded () { |
| 1289 | ! echo "$1" | grep "$FILTER" | grep -q -v "$EXCLUDE" |
| 1290 | } |
| 1291 | else |
| 1292 | is_excluded () { |
| 1293 | case "$1" in |
| 1294 | $simple_exclude) true;; |
| 1295 | $simple_filter) false;; |
| 1296 | *) true;; |
| 1297 | esac |
| 1298 | } |
| 1299 | fi |
| 1300 | |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1301 | # sanity checks, avoid an avalanche of errors |
Hanno Becker | 4ac73e7 | 2017-10-23 15:27:37 +0100 | [diff] [blame] | 1302 | P_SRV_BIN="${P_SRV%%[ ]*}" |
| 1303 | P_CLI_BIN="${P_CLI%%[ ]*}" |
| 1304 | P_PXY_BIN="${P_PXY%%[ ]*}" |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1305 | if [ ! -x "$P_SRV_BIN" ]; then |
| 1306 | echo "Command '$P_SRV_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1307 | exit 1 |
| 1308 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1309 | if [ ! -x "$P_CLI_BIN" ]; then |
| 1310 | echo "Command '$P_CLI_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1311 | exit 1 |
| 1312 | fi |
Hanno Becker | 17c0493 | 2017-10-10 14:44:53 +0100 | [diff] [blame] | 1313 | if [ ! -x "$P_PXY_BIN" ]; then |
| 1314 | echo "Command '$P_PXY_BIN' is not an executable file" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1315 | exit 1 |
| 1316 | fi |
Simon Butcher | 3c0d7b8 | 2016-05-23 11:13:17 +0100 | [diff] [blame] | 1317 | if [ "$MEMCHECK" -gt 0 ]; then |
| 1318 | if which valgrind >/dev/null 2>&1; then :; else |
| 1319 | echo "Memcheck not possible. Valgrind not found" |
| 1320 | exit 1 |
| 1321 | fi |
| 1322 | fi |
Manuel Pégourié-Gonnard | 74faf3c | 2014-03-13 18:47:44 +0100 | [diff] [blame] | 1323 | if which $OPENSSL_CMD >/dev/null 2>&1; then :; else |
| 1324 | echo "Command '$OPENSSL_CMD' not found" |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 1325 | exit 1 |
| 1326 | fi |
| 1327 | |
Manuel Pégourié-Gonnard | 32f8f4d | 2014-05-29 11:31:20 +0200 | [diff] [blame] | 1328 | # used by watchdog |
| 1329 | MAIN_PID="$$" |
| 1330 | |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1331 | # We use somewhat arbitrary delays for tests: |
| 1332 | # - how long do we wait for the server to start (when lsof not available)? |
| 1333 | # - how long do we allow for the client to finish? |
| 1334 | # (not to check performance, just to avoid waiting indefinitely) |
| 1335 | # Things are slower with valgrind, so give extra time here. |
| 1336 | # |
| 1337 | # Note: without lsof, there is a trade-off between the running time of this |
| 1338 | # script and the risk of spurious errors because we didn't wait long enough. |
| 1339 | # The watchdog delay on the other hand doesn't affect normal running time of |
| 1340 | # 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] | 1341 | if [ "$MEMCHECK" -gt 0 ]; then |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1342 | START_DELAY=6 |
| 1343 | DOG_DELAY=60 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1344 | else |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1345 | START_DELAY=2 |
| 1346 | DOG_DELAY=20 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1347 | fi |
Manuel Pégourié-Gonnard | 0d225da | 2018-01-22 10:22:09 +0100 | [diff] [blame] | 1348 | |
| 1349 | # some particular tests need more time: |
| 1350 | # - for the client, we multiply the usual watchdog limit by a factor |
| 1351 | # - for the server, we sleep for a number of seconds after the client exits |
| 1352 | # see client_need_more_time() and server_needs_more_time() |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 1353 | CLI_DELAY_FACTOR=1 |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 1354 | SRV_DELAY_SECONDS=0 |
Manuel Pégourié-Gonnard | 0c1ec47 | 2014-06-20 18:41:11 +0200 | [diff] [blame] | 1355 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 1356 | # 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] | 1357 | # +SRV_PORT will be replaced by either $SRV_PORT or $PXY_PORT later |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1358 | # Note: Using 'localhost' rather than 127.0.0.1 here is unwise, as on many |
| 1359 | # machines that will resolve to ::1, and we don't want ipv6 here. |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1360 | P_SRV="$P_SRV server_addr=127.0.0.1 server_port=$SRV_PORT" |
| 1361 | 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] | 1362 | 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] | 1363 | O_SRV="$O_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1364 | O_CLI="$O_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1365 | G_SRV="$G_SRV -p $SRV_PORT" |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1366 | G_CLI="$G_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 8066b81 | 2014-05-28 22:59:30 +0200 | [diff] [blame] | 1367 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1368 | if [ -n "${OPENSSL_LEGACY:-}" ]; then |
| 1369 | O_LEGACY_SRV="$O_LEGACY_SRV -accept $SRV_PORT -dhparam data_files/dhparams.pem" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1370 | O_LEGACY_CLI="$O_LEGACY_CLI -connect 127.0.0.1:+SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1371 | fi |
| 1372 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1373 | if [ -n "${OPENSSL_NEXT:-}" ]; then |
| 1374 | O_NEXT_SRV="$O_NEXT_SRV -accept $SRV_PORT" |
Paul Elliott | 0421715 | 2021-10-12 16:10:37 +0100 | [diff] [blame] | 1375 | O_NEXT_CLI="$O_NEXT_CLI -connect 127.0.0.1:+SRV_PORT" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 1376 | fi |
| 1377 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1378 | if [ -n "${GNUTLS_NEXT_SERV:-}" ]; then |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1379 | G_NEXT_SRV="$G_NEXT_SRV -p $SRV_PORT" |
| 1380 | fi |
| 1381 | |
Hanno Becker | 58e9dc3 | 2018-08-17 15:53:21 +0100 | [diff] [blame] | 1382 | if [ -n "${GNUTLS_NEXT_CLI:-}" ]; then |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 1383 | G_NEXT_CLI="$G_NEXT_CLI -p +SRV_PORT" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 1384 | fi |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1385 | |
Gilles Peskine | 62469d9 | 2017-05-10 10:13:59 +0200 | [diff] [blame] | 1386 | # Allow SHA-1, because many of our test certificates use it |
| 1387 | P_SRV="$P_SRV allow_sha1=1" |
| 1388 | P_CLI="$P_CLI allow_sha1=1" |
| 1389 | |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1390 | # Also pick a unique name for intermediate files |
| 1391 | SRV_OUT="srv_out.$$" |
| 1392 | CLI_OUT="cli_out.$$" |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 1393 | PXY_OUT="pxy_out.$$" |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 1394 | SESSION="session.$$" |
| 1395 | |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 1396 | SKIP_NEXT="NO" |
| 1397 | |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 1398 | trap cleanup INT TERM HUP |
| 1399 | |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1400 | # Basic test |
| 1401 | |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1402 | # Checks that: |
| 1403 | # - 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] | 1404 | # - the expected parameters are selected |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1405 | # ("signature_algorithm ext: 6" means SHA-512 (highest common hash)) |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1406 | run_test "Default" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1407 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1408 | "$P_CLI" \ |
| 1409 | 0 \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1410 | -s "Protocol is TLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1411 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1412 | -s "client hello v3, signature_algorithm ext: 6" \ |
Gilles Peskine | 799eee6 | 2021-06-02 22:14:15 +0200 | [diff] [blame] | 1413 | -s "ECDHE curve: x25519" \ |
Manuel Pégourié-Gonnard | 480905d | 2014-08-21 19:38:32 +0200 | [diff] [blame] | 1414 | -S "error" \ |
| 1415 | -C "error" |
Manuel Pégourié-Gonnard | e73b263 | 2014-07-12 04:00:00 +0200 | [diff] [blame] | 1416 | |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1417 | run_test "Default, DTLS" \ |
| 1418 | "$P_SRV dtls=1" \ |
| 1419 | "$P_CLI dtls=1" \ |
| 1420 | 0 \ |
| 1421 | -s "Protocol is DTLSv1.2" \ |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1422 | -s "Ciphersuite is TLS-ECDHE-RSA-WITH-CHACHA20-POLY1305-SHA256" |
Manuel Pégourié-Gonnard | 3bb0801 | 2015-01-22 13:34:21 +0000 | [diff] [blame] | 1423 | |
Hanno Becker | 721f7c1 | 2020-08-17 12:17:32 +0100 | [diff] [blame] | 1424 | run_test "TLS client auth: required" \ |
| 1425 | "$P_SRV auth_mode=required" \ |
| 1426 | "$P_CLI" \ |
| 1427 | 0 \ |
| 1428 | -s "Verifying peer X.509 certificate... ok" |
| 1429 | |
Hanno Becker | 2f54a3c | 2020-08-17 12:14:06 +0100 | [diff] [blame] | 1430 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1431 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1432 | requires_config_enabled MBEDTLS_SHA256_C |
| 1433 | run_test "TLS: password protected client key" \ |
| 1434 | "$P_SRV auth_mode=required" \ |
| 1435 | "$P_CLI crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1436 | 0 |
| 1437 | |
| 1438 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1439 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1440 | requires_config_enabled MBEDTLS_SHA256_C |
| 1441 | run_test "TLS: password protected server key" \ |
| 1442 | "$P_SRV crt_file=data_files/server5.crt key_file=data_files/server5.key.enc key_pwd=PolarSSLTest" \ |
| 1443 | "$P_CLI" \ |
| 1444 | 0 |
| 1445 | |
| 1446 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1447 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1448 | requires_config_enabled MBEDTLS_RSA_C |
| 1449 | requires_config_enabled MBEDTLS_SHA256_C |
| 1450 | run_test "TLS: password protected server key, two certificates" \ |
| 1451 | "$P_SRV \ |
| 1452 | key_file=data_files/server5.key.enc key_pwd=PolarSSLTest crt_file=data_files/server5.crt \ |
| 1453 | key_file2=data_files/server2.key.enc key_pwd2=PolarSSLTest crt_file2=data_files/server2.crt" \ |
| 1454 | "$P_CLI" \ |
| 1455 | 0 |
| 1456 | |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1457 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1458 | run_test "CA callback on client" \ |
| 1459 | "$P_SRV debug_level=3" \ |
| 1460 | "$P_CLI ca_callback=1 debug_level=3 " \ |
| 1461 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1462 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1463 | -S "error" \ |
| 1464 | -C "error" |
| 1465 | |
| 1466 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 1467 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1468 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1469 | requires_config_enabled MBEDTLS_SHA256_C |
| 1470 | run_test "CA callback on server" \ |
| 1471 | "$P_SRV auth_mode=required" \ |
| 1472 | "$P_CLI ca_callback=1 debug_level=3 crt_file=data_files/server5.crt \ |
| 1473 | key_file=data_files/server5.key" \ |
| 1474 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 1475 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 1476 | -s "Verifying peer X.509 certificate... ok" \ |
| 1477 | -S "error" \ |
| 1478 | -C "error" |
| 1479 | |
Manuel Pégourié-Gonnard | cfdf8f4 | 2018-11-08 09:52:25 +0100 | [diff] [blame] | 1480 | # Test using an opaque private key for client authentication |
| 1481 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 1482 | requires_config_enabled MBEDTLS_X509_CRT_PARSE_C |
| 1483 | requires_config_enabled MBEDTLS_ECDSA_C |
| 1484 | requires_config_enabled MBEDTLS_SHA256_C |
| 1485 | run_test "Opaque key for client authentication" \ |
| 1486 | "$P_SRV auth_mode=required" \ |
| 1487 | "$P_CLI key_opaque=1 crt_file=data_files/server5.crt \ |
| 1488 | key_file=data_files/server5.key" \ |
| 1489 | 0 \ |
| 1490 | -c "key type: Opaque" \ |
| 1491 | -s "Verifying peer X.509 certificate... ok" \ |
| 1492 | -S "error" \ |
| 1493 | -C "error" |
| 1494 | |
Hanno Becker | 9b5853c | 2018-11-16 17:28:40 +0000 | [diff] [blame] | 1495 | # Test ciphersuites which we expect to be fully supported by PSA Crypto |
| 1496 | # and check that we don't fall back to Mbed TLS' internal crypto primitives. |
| 1497 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM |
| 1498 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 |
| 1499 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM |
| 1500 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CCM-8 |
| 1501 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 |
| 1502 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384 |
| 1503 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA |
| 1504 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 |
| 1505 | run_test_psa TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384 |
| 1506 | |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1507 | requires_config_enabled MBEDTLS_ECP_DP_SECP521R1_ENABLED |
| 1508 | run_test_psa_force_curve "secp521r1" |
| 1509 | requires_config_enabled MBEDTLS_ECP_DP_BP512R1_ENABLED |
| 1510 | run_test_psa_force_curve "brainpoolP512r1" |
| 1511 | requires_config_enabled MBEDTLS_ECP_DP_SECP384R1_ENABLED |
| 1512 | run_test_psa_force_curve "secp384r1" |
| 1513 | requires_config_enabled MBEDTLS_ECP_DP_BP384R1_ENABLED |
| 1514 | run_test_psa_force_curve "brainpoolP384r1" |
| 1515 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
| 1516 | run_test_psa_force_curve "secp256r1" |
| 1517 | requires_config_enabled MBEDTLS_ECP_DP_SECP256K1_ENABLED |
| 1518 | run_test_psa_force_curve "secp256k1" |
| 1519 | requires_config_enabled MBEDTLS_ECP_DP_BP256R1_ENABLED |
| 1520 | run_test_psa_force_curve "brainpoolP256r1" |
| 1521 | requires_config_enabled MBEDTLS_ECP_DP_SECP224R1_ENABLED |
| 1522 | run_test_psa_force_curve "secp224r1" |
Gilles Peskine | defdc3b | 2021-03-23 13:59:58 +0100 | [diff] [blame] | 1523 | ## SECP224K1 is buggy via the PSA API |
| 1524 | ## (https://github.com/ARMmbed/mbedtls/issues/3541), |
| 1525 | ## so it is disabled in PSA even when it's enabled in Mbed TLS. |
| 1526 | ## The proper dependency would be on PSA_WANT_ECC_SECP_K1_224 but |
| 1527 | ## dependencies on PSA symbols in ssl-opt.sh are not implemented yet. |
| 1528 | #requires_config_enabled MBEDTLS_ECP_DP_SECP224K1_ENABLED |
| 1529 | #run_test_psa_force_curve "secp224k1" |
Hanno Becker | 354e248 | 2019-01-08 11:40:25 +0000 | [diff] [blame] | 1530 | requires_config_enabled MBEDTLS_ECP_DP_SECP192R1_ENABLED |
| 1531 | run_test_psa_force_curve "secp192r1" |
| 1532 | requires_config_enabled MBEDTLS_ECP_DP_SECP192K1_ENABLED |
| 1533 | run_test_psa_force_curve "secp192k1" |
| 1534 | |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1535 | # Test current time in ServerHello |
| 1536 | requires_config_enabled MBEDTLS_HAVE_TIME |
Manuel Pégourié-Gonnard | ce66d5e | 2018-06-14 11:11:15 +0200 | [diff] [blame] | 1537 | run_test "ServerHello contains gmt_unix_time" \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1538 | "$P_SRV debug_level=3" \ |
| 1539 | "$P_CLI debug_level=3" \ |
| 1540 | 0 \ |
Andres Amaya Garcia | b84c40b | 2017-09-06 15:44:01 +0100 | [diff] [blame] | 1541 | -f "check_server_hello_time" \ |
| 1542 | -F "check_server_hello_time" |
| 1543 | |
Simon Butcher | 8e00410 | 2016-10-14 00:48:33 +0100 | [diff] [blame] | 1544 | # Test for uniqueness of IVs in AEAD ciphersuites |
| 1545 | run_test "Unique IV in GCM" \ |
| 1546 | "$P_SRV exchanges=20 debug_level=4" \ |
| 1547 | "$P_CLI exchanges=20 debug_level=4 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 1548 | 0 \ |
| 1549 | -u "IV used" \ |
| 1550 | -U "IV used" |
| 1551 | |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1552 | # Tests for certificate verification callback |
| 1553 | run_test "Configuration-specific CRT verification callback" \ |
| 1554 | "$P_SRV debug_level=3" \ |
| 1555 | "$P_CLI context_crt_cb=0 debug_level=3" \ |
| 1556 | 0 \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1557 | -S "error" \ |
| 1558 | -c "Verify requested for " \ |
| 1559 | -c "Use configuration-specific verification callback" \ |
| 1560 | -C "Use context-specific verification callback" \ |
| 1561 | -C "error" |
| 1562 | |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1563 | run_test "Context-specific CRT verification callback" \ |
| 1564 | "$P_SRV debug_level=3" \ |
| 1565 | "$P_CLI context_crt_cb=1 debug_level=3" \ |
| 1566 | 0 \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1567 | -S "error" \ |
Janos Follath | ee11be6 | 2019-04-04 12:03:30 +0100 | [diff] [blame] | 1568 | -c "Verify requested for " \ |
| 1569 | -c "Use context-specific verification callback" \ |
| 1570 | -C "Use configuration-specific verification callback" \ |
Hanno Becker | efb440a | 2019-04-03 13:04:33 +0100 | [diff] [blame] | 1571 | -C "error" |
| 1572 | |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1573 | # Tests for SHA-1 support |
Gilles Peskine | bc70a18 | 2017-05-09 15:59:24 +0200 | [diff] [blame] | 1574 | run_test "SHA-1 forbidden by default in server certificate" \ |
| 1575 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1576 | "$P_CLI debug_level=2 allow_sha1=0" \ |
| 1577 | 1 \ |
| 1578 | -c "The certificate is signed with an unacceptable hash" |
| 1579 | |
| 1580 | run_test "SHA-1 explicitly allowed in server certificate" \ |
| 1581 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2.crt" \ |
| 1582 | "$P_CLI allow_sha1=1" \ |
| 1583 | 0 |
| 1584 | |
| 1585 | run_test "SHA-256 allowed by default in server certificate" \ |
| 1586 | "$P_SRV key_file=data_files/server2.key crt_file=data_files/server2-sha256.crt" \ |
| 1587 | "$P_CLI allow_sha1=0" \ |
| 1588 | 0 |
| 1589 | |
| 1590 | run_test "SHA-1 forbidden by default in client certificate" \ |
| 1591 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1592 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1593 | 1 \ |
| 1594 | -s "The certificate is signed with an unacceptable hash" |
| 1595 | |
| 1596 | run_test "SHA-1 explicitly allowed in client certificate" \ |
| 1597 | "$P_SRV auth_mode=required allow_sha1=1" \ |
| 1598 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha1.crt" \ |
| 1599 | 0 |
| 1600 | |
| 1601 | run_test "SHA-256 allowed by default in client certificate" \ |
| 1602 | "$P_SRV auth_mode=required allow_sha1=0" \ |
| 1603 | "$P_CLI key_file=data_files/cli-rsa.key crt_file=data_files/cli-rsa-sha256.crt" \ |
| 1604 | 0 |
| 1605 | |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1606 | # Dummy TLS 1.3 test |
| 1607 | # Currently only checking that passing TLS 1.3 key exchange modes to |
| 1608 | # ssl_client2/ssl_server2 example programs works. |
| 1609 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1610 | run_test "TLS 1.3, key exchange mode parameter passing: PSK only" \ |
Jerry Yu | 31c01d3 | 2021-08-24 10:49:06 +0800 | [diff] [blame] | 1611 | "$P_SRV tls13_kex_modes=psk" \ |
| 1612 | "$P_CLI tls13_kex_modes=psk" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1613 | 0 |
| 1614 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1615 | run_test "TLS 1.3, key exchange mode parameter passing: PSK-ephemeral only" \ |
| 1616 | "$P_SRV tls13_kex_modes=psk_ephemeral" \ |
| 1617 | "$P_CLI tls13_kex_modes=psk_ephemeral" \ |
| 1618 | 0 |
| 1619 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1620 | 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] | 1621 | "$P_SRV tls13_kex_modes=ephemeral" \ |
| 1622 | "$P_CLI tls13_kex_modes=ephemeral" \ |
Hanno Becker | 932064d | 2021-07-24 06:45:50 +0100 | [diff] [blame] | 1623 | 0 |
| 1624 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1625 | run_test "TLS 1.3, key exchange mode parameter passing: All ephemeral" \ |
| 1626 | "$P_SRV tls13_kex_modes=ephemeral_all" \ |
| 1627 | "$P_CLI tls13_kex_modes=ephemeral_all" \ |
| 1628 | 0 |
| 1629 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1630 | run_test "TLS 1.3, key exchange mode parameter passing: All PSK" \ |
| 1631 | "$P_SRV tls13_kex_modes=psk_all" \ |
| 1632 | "$P_CLI tls13_kex_modes=psk_all" \ |
| 1633 | 0 |
| 1634 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 1635 | run_test "TLS 1.3, key exchange mode parameter passing: All" \ |
| 1636 | "$P_SRV tls13_kex_modes=all" \ |
| 1637 | "$P_CLI tls13_kex_modes=all" \ |
| 1638 | 0 |
| 1639 | |
Hanno Becker | 7ae8a76 | 2018-08-14 15:43:35 +0100 | [diff] [blame] | 1640 | # Tests for datagram packing |
| 1641 | run_test "DTLS: multiple records in same datagram, client and server" \ |
| 1642 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1643 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1644 | 0 \ |
| 1645 | -c "next record in same datagram" \ |
| 1646 | -s "next record in same datagram" |
| 1647 | |
| 1648 | run_test "DTLS: multiple records in same datagram, client only" \ |
| 1649 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1650 | "$P_CLI dtls=1 dgram_packing=1 debug_level=2" \ |
| 1651 | 0 \ |
| 1652 | -s "next record in same datagram" \ |
| 1653 | -C "next record in same datagram" |
| 1654 | |
| 1655 | run_test "DTLS: multiple records in same datagram, server only" \ |
| 1656 | "$P_SRV dtls=1 dgram_packing=1 debug_level=2" \ |
| 1657 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1658 | 0 \ |
| 1659 | -S "next record in same datagram" \ |
| 1660 | -c "next record in same datagram" |
| 1661 | |
| 1662 | run_test "DTLS: multiple records in same datagram, neither client nor server" \ |
| 1663 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 1664 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
| 1665 | 0 \ |
| 1666 | -S "next record in same datagram" \ |
| 1667 | -C "next record in same datagram" |
| 1668 | |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1669 | # Tests for Context serialization |
| 1670 | |
| 1671 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1672 | run_test "Context serialization, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1673 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1674 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1675 | 0 \ |
| 1676 | -c "Deserializing connection..." \ |
| 1677 | -S "Deserializing connection..." |
| 1678 | |
| 1679 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1680 | run_test "Context serialization, client serializes, ChaChaPoly" \ |
| 1681 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1682 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1683 | 0 \ |
| 1684 | -c "Deserializing connection..." \ |
| 1685 | -S "Deserializing connection..." |
| 1686 | |
| 1687 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1688 | run_test "Context serialization, client serializes, GCM" \ |
| 1689 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1690 | "$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] | 1691 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1692 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1693 | -S "Deserializing connection..." |
| 1694 | |
| 1695 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1696 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1697 | run_test "Context serialization, client serializes, with CID" \ |
| 1698 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1699 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1700 | 0 \ |
| 1701 | -c "Deserializing connection..." \ |
| 1702 | -S "Deserializing connection..." |
| 1703 | |
| 1704 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1705 | run_test "Context serialization, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1706 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1707 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1708 | 0 \ |
| 1709 | -C "Deserializing connection..." \ |
| 1710 | -s "Deserializing connection..." |
| 1711 | |
| 1712 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1713 | run_test "Context serialization, server serializes, ChaChaPoly" \ |
| 1714 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1715 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1716 | 0 \ |
| 1717 | -C "Deserializing connection..." \ |
| 1718 | -s "Deserializing connection..." |
| 1719 | |
| 1720 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1721 | run_test "Context serialization, server serializes, GCM" \ |
| 1722 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1723 | "$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] | 1724 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1725 | -C "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1726 | -s "Deserializing connection..." |
| 1727 | |
| 1728 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1729 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1730 | run_test "Context serialization, server serializes, with CID" \ |
| 1731 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1732 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1733 | 0 \ |
| 1734 | -C "Deserializing connection..." \ |
| 1735 | -s "Deserializing connection..." |
| 1736 | |
| 1737 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1738 | run_test "Context serialization, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1739 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1740 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1741 | 0 \ |
| 1742 | -c "Deserializing connection..." \ |
| 1743 | -s "Deserializing connection..." |
| 1744 | |
| 1745 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1746 | run_test "Context serialization, both serialize, ChaChaPoly" \ |
| 1747 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1748 | "$P_CLI dtls=1 serialize=1 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1749 | 0 \ |
| 1750 | -c "Deserializing connection..." \ |
| 1751 | -s "Deserializing connection..." |
| 1752 | |
| 1753 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1754 | run_test "Context serialization, both serialize, GCM" \ |
| 1755 | "$P_SRV dtls=1 serialize=1 exchanges=2" \ |
| 1756 | "$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] | 1757 | 0 \ |
Jarno Lamsa | cbee1b3 | 2019-06-04 15:18:19 +0300 | [diff] [blame] | 1758 | -c "Deserializing connection..." \ |
Jarno Lamsa | 2937d81 | 2019-06-04 11:33:23 +0300 | [diff] [blame] | 1759 | -s "Deserializing connection..." |
| 1760 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1761 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1762 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1763 | run_test "Context serialization, both serialize, with CID" \ |
| 1764 | "$P_SRV dtls=1 serialize=1 exchanges=2 cid=1 cid_val=dead" \ |
| 1765 | "$P_CLI dtls=1 serialize=1 exchanges=2 cid=1 cid_val=beef" \ |
| 1766 | 0 \ |
| 1767 | -c "Deserializing connection..." \ |
| 1768 | -s "Deserializing connection..." |
| 1769 | |
| 1770 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1771 | run_test "Context serialization, re-init, client serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1772 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1773 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1774 | 0 \ |
| 1775 | -c "Deserializing connection..." \ |
| 1776 | -S "Deserializing connection..." |
| 1777 | |
| 1778 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1779 | run_test "Context serialization, re-init, client serializes, ChaChaPoly" \ |
| 1780 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1781 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1782 | 0 \ |
| 1783 | -c "Deserializing connection..." \ |
| 1784 | -S "Deserializing connection..." |
| 1785 | |
| 1786 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1787 | run_test "Context serialization, re-init, client serializes, GCM" \ |
| 1788 | "$P_SRV dtls=1 serialize=0 exchanges=2" \ |
| 1789 | "$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] | 1790 | 0 \ |
| 1791 | -c "Deserializing connection..." \ |
| 1792 | -S "Deserializing connection..." |
| 1793 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1794 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1795 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1796 | run_test "Context serialization, re-init, client serializes, with CID" \ |
| 1797 | "$P_SRV dtls=1 serialize=0 exchanges=2 cid=1 cid_val=dead" \ |
| 1798 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1799 | 0 \ |
| 1800 | -c "Deserializing connection..." \ |
| 1801 | -S "Deserializing connection..." |
| 1802 | |
| 1803 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1804 | run_test "Context serialization, re-init, server serializes, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1805 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1806 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1807 | 0 \ |
| 1808 | -C "Deserializing connection..." \ |
| 1809 | -s "Deserializing connection..." |
| 1810 | |
| 1811 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1812 | run_test "Context serialization, re-init, server serializes, ChaChaPoly" \ |
| 1813 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1814 | "$P_CLI dtls=1 serialize=0 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1815 | 0 \ |
| 1816 | -C "Deserializing connection..." \ |
| 1817 | -s "Deserializing connection..." |
| 1818 | |
| 1819 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1820 | run_test "Context serialization, re-init, server serializes, GCM" \ |
| 1821 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1822 | "$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] | 1823 | 0 \ |
| 1824 | -C "Deserializing connection..." \ |
| 1825 | -s "Deserializing connection..." |
| 1826 | |
Jarno Lamsa | c2376f0 | 2019-06-06 10:44:14 +0300 | [diff] [blame] | 1827 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1828 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1829 | run_test "Context serialization, re-init, server serializes, with CID" \ |
| 1830 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1831 | "$P_CLI dtls=1 serialize=0 exchanges=2 cid=1 cid_val=beef" \ |
| 1832 | 0 \ |
| 1833 | -C "Deserializing connection..." \ |
| 1834 | -s "Deserializing connection..." |
| 1835 | |
| 1836 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1837 | run_test "Context serialization, re-init, both serialize, CCM" \ |
Manuel Pégourié-Gonnard | 862b319 | 2019-07-23 14:13:43 +0200 | [diff] [blame] | 1838 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
Hanno Becker | e0b90ec | 2019-08-30 11:32:12 +0100 | [diff] [blame] | 1839 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 1840 | 0 \ |
| 1841 | -c "Deserializing connection..." \ |
| 1842 | -s "Deserializing connection..." |
| 1843 | |
| 1844 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1845 | run_test "Context serialization, re-init, both serialize, ChaChaPoly" \ |
| 1846 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1847 | "$P_CLI dtls=1 serialize=2 exchanges=2 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256" \ |
| 1848 | 0 \ |
| 1849 | -c "Deserializing connection..." \ |
| 1850 | -s "Deserializing connection..." |
| 1851 | |
| 1852 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1853 | run_test "Context serialization, re-init, both serialize, GCM" \ |
| 1854 | "$P_SRV dtls=1 serialize=2 exchanges=2" \ |
| 1855 | "$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] | 1856 | 0 \ |
| 1857 | -c "Deserializing connection..." \ |
| 1858 | -s "Deserializing connection..." |
| 1859 | |
Hanno Becker | 1b18fd3 | 2019-08-30 11:18:59 +0100 | [diff] [blame] | 1860 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1861 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 1862 | run_test "Context serialization, re-init, both serialize, with CID" \ |
| 1863 | "$P_SRV dtls=1 serialize=2 exchanges=2 cid=1 cid_val=dead" \ |
| 1864 | "$P_CLI dtls=1 serialize=2 exchanges=2 cid=1 cid_val=beef" \ |
| 1865 | 0 \ |
| 1866 | -c "Deserializing connection..." \ |
| 1867 | -s "Deserializing connection..." |
| 1868 | |
Piotr Nowicki | 3de298f | 2020-04-16 14:35:19 +0200 | [diff] [blame] | 1869 | requires_config_enabled MBEDTLS_SSL_CONTEXT_SERIALIZATION |
| 1870 | run_test "Saving the serialized context to a file" \ |
| 1871 | "$P_SRV dtls=1 serialize=1 context_file=context_srv.txt" \ |
| 1872 | "$P_CLI dtls=1 serialize=1 context_file=context_cli.txt" \ |
| 1873 | 0 \ |
| 1874 | -s "Save serialized context to a file... ok" \ |
| 1875 | -c "Save serialized context to a file... ok" |
| 1876 | rm -f context_srv.txt |
| 1877 | rm -f context_cli.txt |
| 1878 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1879 | # Tests for DTLS Connection ID extension |
| 1880 | |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1881 | # So far, the CID API isn't implemented, so we can't |
| 1882 | # grep for output witnessing its use. This needs to be |
| 1883 | # changed once the CID extension is implemented. |
| 1884 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1885 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1886 | run_test "Connection ID: Cli enabled, Srv disabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1887 | "$P_SRV debug_level=3 dtls=1 cid=0" \ |
| 1888 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1889 | 0 \ |
| 1890 | -s "Disable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1891 | -s "found CID extension" \ |
| 1892 | -s "Client sent CID extension, but CID disabled" \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1893 | -c "Enable use of CID extension." \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1894 | -c "client hello, adding CID extension" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1895 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1896 | -C "found CID extension" \ |
| 1897 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1898 | -C "Copy CIDs into SSL transform" \ |
| 1899 | -c "Use of Connection ID was rejected by the server" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1900 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1901 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1902 | run_test "Connection ID: Cli disabled, Srv enabled" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1903 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 1904 | "$P_CLI debug_level=3 dtls=1 cid=0" \ |
| 1905 | 0 \ |
| 1906 | -c "Disable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1907 | -C "client hello, adding CID extension" \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1908 | -S "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1909 | -s "Enable use of CID extension." \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1910 | -S "server hello, adding CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1911 | -C "found CID extension" \ |
| 1912 | -S "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 1913 | -C "Copy CIDs into SSL transform" \ |
Hanno Becker | b3e9dd5 | 2019-05-08 13:19:53 +0100 | [diff] [blame] | 1914 | -s "Use of Connection ID was not offered by client" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1915 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1916 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1917 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 1918 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 1919 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef" \ |
| 1920 | 0 \ |
| 1921 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 1922 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 1923 | -c "client hello, adding CID extension" \ |
| 1924 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 1925 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 1926 | -s "server hello, adding CID extension" \ |
| 1927 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 1928 | -c "Use of CID extension negotiated" \ |
| 1929 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 1930 | -c "Copy CIDs into SSL transform" \ |
| 1931 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1932 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1933 | -s "Use of Connection ID has been negotiated" \ |
| 1934 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 1935 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1936 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1937 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1938 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1939 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead" \ |
| 1940 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef" \ |
| 1941 | 0 \ |
| 1942 | -c "Enable use of CID extension." \ |
| 1943 | -s "Enable use of CID extension." \ |
| 1944 | -c "client hello, adding CID extension" \ |
| 1945 | -s "found CID extension" \ |
| 1946 | -s "Use of CID extension negotiated" \ |
| 1947 | -s "server hello, adding CID extension" \ |
| 1948 | -c "found CID extension" \ |
| 1949 | -c "Use of CID extension negotiated" \ |
| 1950 | -s "Copy CIDs into SSL transform" \ |
| 1951 | -c "Copy CIDs into SSL transform" \ |
| 1952 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1953 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1954 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1955 | -c "Use of Connection ID has been negotiated" \ |
| 1956 | -c "ignoring unexpected CID" \ |
| 1957 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1958 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1959 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1960 | run_test "Connection ID, MTU: Cli+Srv enabled, Cli+Srv CID nonempty" \ |
| 1961 | -p "$P_PXY mtu=800" \ |
| 1962 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1963 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1964 | 0 \ |
| 1965 | -c "Enable use of CID extension." \ |
| 1966 | -s "Enable use of CID extension." \ |
| 1967 | -c "client hello, adding CID extension" \ |
| 1968 | -s "found CID extension" \ |
| 1969 | -s "Use of CID extension negotiated" \ |
| 1970 | -s "server hello, adding CID extension" \ |
| 1971 | -c "found CID extension" \ |
| 1972 | -c "Use of CID extension negotiated" \ |
| 1973 | -s "Copy CIDs into SSL transform" \ |
| 1974 | -c "Copy CIDs into SSL transform" \ |
| 1975 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1976 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1977 | -s "Use of Connection ID has been negotiated" \ |
| 1978 | -c "Use of Connection ID has been negotiated" |
| 1979 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 1980 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 1981 | 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] | 1982 | -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] | 1983 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead" \ |
| 1984 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef" \ |
| 1985 | 0 \ |
| 1986 | -c "Enable use of CID extension." \ |
| 1987 | -s "Enable use of CID extension." \ |
| 1988 | -c "client hello, adding CID extension" \ |
| 1989 | -s "found CID extension" \ |
| 1990 | -s "Use of CID extension negotiated" \ |
| 1991 | -s "server hello, adding CID extension" \ |
| 1992 | -c "found CID extension" \ |
| 1993 | -c "Use of CID extension negotiated" \ |
| 1994 | -s "Copy CIDs into SSL transform" \ |
| 1995 | -c "Copy CIDs into SSL transform" \ |
| 1996 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 1997 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 1998 | -s "Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 1999 | -c "Use of Connection ID has been negotiated" \ |
| 2000 | -c "ignoring unexpected CID" \ |
| 2001 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2002 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2003 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2004 | run_test "Connection ID: Cli+Srv enabled, Cli CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2005 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2006 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2007 | 0 \ |
| 2008 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2009 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2010 | -c "client hello, adding CID extension" \ |
| 2011 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2012 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2013 | -s "server hello, adding CID extension" \ |
| 2014 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2015 | -c "Use of CID extension negotiated" \ |
| 2016 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2017 | -c "Copy CIDs into SSL transform" \ |
| 2018 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2019 | -s "Peer CID (length 0 Bytes):" \ |
| 2020 | -s "Use of Connection ID has been negotiated" \ |
| 2021 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2022 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2023 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2024 | run_test "Connection ID: Cli+Srv enabled, Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2025 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2026 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2027 | 0 \ |
| 2028 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2029 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2030 | -c "client hello, adding CID extension" \ |
| 2031 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2032 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2033 | -s "server hello, adding CID extension" \ |
| 2034 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2035 | -c "Use of CID extension negotiated" \ |
| 2036 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2037 | -c "Copy CIDs into SSL transform" \ |
| 2038 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2039 | -c "Peer CID (length 0 Bytes):" \ |
| 2040 | -s "Use of Connection ID has been negotiated" \ |
| 2041 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2042 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2043 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2044 | run_test "Connection ID: Cli+Srv enabled, Cli+Srv CID empty" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2045 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2046 | "$P_CLI debug_level=3 dtls=1 cid=1" \ |
| 2047 | 0 \ |
| 2048 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2049 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2050 | -c "client hello, adding CID extension" \ |
| 2051 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2052 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2053 | -s "server hello, adding CID extension" \ |
| 2054 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2055 | -c "Use of CID extension negotiated" \ |
| 2056 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2057 | -c "Copy CIDs into SSL transform" \ |
| 2058 | -S "Use of Connection ID has been negotiated" \ |
| 2059 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2060 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2061 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2062 | 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] | 2063 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2064 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2065 | 0 \ |
| 2066 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2067 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2068 | -c "client hello, adding CID extension" \ |
| 2069 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2070 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2071 | -s "server hello, adding CID extension" \ |
| 2072 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2073 | -c "Use of CID extension negotiated" \ |
| 2074 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2075 | -c "Copy CIDs into SSL transform" \ |
| 2076 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2077 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2078 | -s "Use of Connection ID has been negotiated" \ |
| 2079 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2080 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2081 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2082 | 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] | 2083 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2084 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2085 | 0 \ |
| 2086 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2087 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2088 | -c "client hello, adding CID extension" \ |
| 2089 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2090 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2091 | -s "server hello, adding CID extension" \ |
| 2092 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2093 | -c "Use of CID extension negotiated" \ |
| 2094 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2095 | -c "Copy CIDs into SSL transform" \ |
| 2096 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2097 | -s "Peer CID (length 0 Bytes):" \ |
| 2098 | -s "Use of Connection ID has been negotiated" \ |
| 2099 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2100 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2101 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2102 | 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] | 2103 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2104 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2105 | 0 \ |
| 2106 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2107 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2108 | -c "client hello, adding CID extension" \ |
| 2109 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2110 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2111 | -s "server hello, adding CID extension" \ |
| 2112 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2113 | -c "Use of CID extension negotiated" \ |
| 2114 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2115 | -c "Copy CIDs into SSL transform" \ |
| 2116 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2117 | -c "Peer CID (length 0 Bytes):" \ |
| 2118 | -s "Use of Connection ID has been negotiated" \ |
| 2119 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2120 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2121 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2122 | 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] | 2123 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2124 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" \ |
| 2125 | 0 \ |
| 2126 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2127 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2128 | -c "client hello, adding CID extension" \ |
| 2129 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2130 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2131 | -s "server hello, adding CID extension" \ |
| 2132 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2133 | -c "Use of CID extension negotiated" \ |
| 2134 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2135 | -c "Copy CIDs into SSL transform" \ |
| 2136 | -S "Use of Connection ID has been negotiated" \ |
| 2137 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2138 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2139 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2140 | 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] | 2141 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead" \ |
| 2142 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2143 | 0 \ |
| 2144 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2145 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2146 | -c "client hello, adding CID extension" \ |
| 2147 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2148 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2149 | -s "server hello, adding CID extension" \ |
| 2150 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2151 | -c "Use of CID extension negotiated" \ |
| 2152 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2153 | -c "Copy CIDs into SSL transform" \ |
| 2154 | -c "Peer CID (length 2 Bytes): de ad" \ |
| 2155 | -s "Peer CID (length 2 Bytes): be ef" \ |
| 2156 | -s "Use of Connection ID has been negotiated" \ |
| 2157 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2158 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2159 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2160 | 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] | 2161 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=deadbeef" \ |
| 2162 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2163 | 0 \ |
| 2164 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2165 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2166 | -c "client hello, adding CID extension" \ |
| 2167 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2168 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2169 | -s "server hello, adding CID extension" \ |
| 2170 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2171 | -c "Use of CID extension negotiated" \ |
| 2172 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2173 | -c "Copy CIDs into SSL transform" \ |
| 2174 | -c "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2175 | -s "Peer CID (length 0 Bytes):" \ |
| 2176 | -s "Use of Connection ID has been negotiated" \ |
| 2177 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2178 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2179 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2180 | 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] | 2181 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2182 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=deadbeef force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2183 | 0 \ |
| 2184 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2185 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2186 | -c "client hello, adding CID extension" \ |
| 2187 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2188 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2189 | -s "server hello, adding CID extension" \ |
| 2190 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2191 | -c "Use of CID extension negotiated" \ |
| 2192 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | 2749a67 | 2019-05-03 17:04:23 +0100 | [diff] [blame] | 2193 | -c "Copy CIDs into SSL transform" \ |
| 2194 | -s "Peer CID (length 4 Bytes): de ad be ef" \ |
| 2195 | -c "Peer CID (length 0 Bytes):" \ |
| 2196 | -s "Use of Connection ID has been negotiated" \ |
| 2197 | -c "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2198 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2199 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2200 | 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] | 2201 | "$P_SRV debug_level=3 dtls=1 cid=1" \ |
| 2202 | "$P_CLI debug_level=3 dtls=1 cid=1 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 2203 | 0 \ |
| 2204 | -c "Enable use of CID extension." \ |
Hanno Becker | 6b78c83 | 2019-04-25 17:01:43 +0100 | [diff] [blame] | 2205 | -s "Enable use of CID extension." \ |
Hanno Becker | 7dee2c6 | 2019-04-26 14:17:56 +0100 | [diff] [blame] | 2206 | -c "client hello, adding CID extension" \ |
| 2207 | -s "found CID extension" \ |
Hanno Becker | 4bc9e9d | 2019-04-26 16:00:29 +0100 | [diff] [blame] | 2208 | -s "Use of CID extension negotiated" \ |
Hanno Becker | a6a4c76 | 2019-04-26 16:13:31 +0100 | [diff] [blame] | 2209 | -s "server hello, adding CID extension" \ |
| 2210 | -c "found CID extension" \ |
Hanno Becker | 9ecb6c6 | 2019-04-26 16:23:52 +0100 | [diff] [blame] | 2211 | -c "Use of CID extension negotiated" \ |
| 2212 | -s "Copy CIDs into SSL transform" \ |
Hanno Becker | fcffdcc | 2019-04-26 17:19:46 +0100 | [diff] [blame] | 2213 | -c "Copy CIDs into SSL transform" \ |
| 2214 | -S "Use of Connection ID has been negotiated" \ |
| 2215 | -C "Use of Connection ID has been negotiated" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2216 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2217 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 9bae30d | 2019-04-23 11:52:44 +0100 | [diff] [blame] | 2218 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2219 | run_test "Connection ID: Cli+Srv enabled, renegotiate without change of CID" \ |
Hanno Becker | f157a97 | 2019-04-25 16:05:45 +0100 | [diff] [blame] | 2220 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2221 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2222 | 0 \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2223 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2224 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2225 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2226 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2227 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2228 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2229 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2230 | -c "(after renegotiation) Use of Connection ID has been negotiated" |
| 2231 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2232 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2233 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2234 | run_test "Connection ID: Cli+Srv enabled, renegotiate with different 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_val_renego=beef renegotiation=1" \ |
| 2236 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_val_renego=dead 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): be ef" \ |
| 2243 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2244 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2245 | -c "(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 with different CID" \ |
| 2250 | "$P_SRV debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2251 | "$P_CLI debug_level=3 dtls=1 cid=1 dgram_packing=0 cid_val=beef cid_val_renego=dead 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): be ef" \ |
| 2258 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2259 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2260 | -c "(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 with different CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2265 | -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] | 2266 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_val_renego=beef renegotiation=1" \ |
| 2267 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_val_renego=dead 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): be ef" \ |
| 2274 | -s "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2275 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2276 | -c "(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, renegotiate without CID" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2283 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2284 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2285 | 0 \ |
| 2286 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2287 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2288 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2289 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2290 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2291 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2292 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2293 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2294 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2295 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2296 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2297 | run_test "Connection ID, no packing: Cli+Srv enabled, renegotiate without CID" \ |
| 2298 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2299 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2300 | 0 \ |
| 2301 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2302 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2303 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2304 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2305 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2306 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2307 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2308 | -S "(after renegotiation) Use of Connection ID has been negotiated" |
| 2309 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2310 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2311 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2312 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, renegotiate without CID" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2313 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2314 | "$P_SRV debug_level=3 mtu=800 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2315 | "$P_CLI debug_level=3 mtu=800 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2316 | 0 \ |
| 2317 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2318 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2319 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2320 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2321 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2322 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2323 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2324 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2325 | -c "ignoring unexpected CID" \ |
| 2326 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2327 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2328 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2329 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2330 | run_test "Connection ID: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2331 | "$P_SRV debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2332 | "$P_CLI debug_level=3 dtls=1 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2333 | 0 \ |
| 2334 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2335 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2336 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2337 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2338 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2339 | -s "(after renegotiation) Use of Connection ID has been negotiated" |
| 2340 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2341 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2342 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2343 | run_test "Connection ID, no packing: Cli+Srv enabled, CID on renegotiation" \ |
| 2344 | "$P_SRV debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2345 | "$P_CLI debug_level=3 dtls=1 dgram_packing=0 cid=0 cid_renego=1 cid_val_renego=beef renegotiation=1 renegotiate=1" \ |
| 2346 | 0 \ |
| 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" |
| 2353 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2354 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | c2045b0 | 2019-05-08 16:20:46 +0100 | [diff] [blame] | 2355 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2356 | run_test "Connection ID, 3D+MTU: Cli+Srv enabled, CID on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2357 | -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] | 2358 | "$P_SRV debug_level=3 mtu=800 dtls=1 dgram_packing=1 cid=0 cid_renego=1 cid_val_renego=dead renegotiation=1" \ |
| 2359 | "$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" \ |
| 2360 | 0 \ |
| 2361 | -S "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2362 | -C "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2363 | -c "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2364 | -s "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2365 | -c "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2366 | -s "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2367 | -c "ignoring unexpected CID" \ |
| 2368 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2369 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2370 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2371 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2372 | run_test "Connection ID: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2373 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2374 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2375 | 0 \ |
| 2376 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2377 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2378 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2379 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2380 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2381 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2382 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2383 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2384 | -s "(after renegotiation) Use of Connection ID was not offered by client" |
| 2385 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2386 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2387 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2388 | run_test "Connection ID, 3D: Cli+Srv enabled, Cli disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2389 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2390 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead renegotiation=1" \ |
| 2391 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef cid_renego=0 renegotiation=1 renegotiate=1" \ |
| 2392 | 0 \ |
| 2393 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2394 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2395 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2396 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2397 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2398 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2399 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2400 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2401 | -s "(after renegotiation) Use of Connection ID was not offered by client" \ |
| 2402 | -c "ignoring unexpected CID" \ |
| 2403 | -s "ignoring unexpected CID" |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2404 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2405 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2406 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2407 | run_test "Connection ID: Cli+Srv enabled, Srv disables on renegotiation" \ |
| 2408 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2409 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2410 | 0 \ |
| 2411 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2412 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2413 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2414 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2415 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2416 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2417 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2418 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2419 | -c "(after renegotiation) Use of Connection ID was rejected by the server" |
| 2420 | |
Hanno Becker | a0e20d0 | 2019-05-15 14:03:01 +0100 | [diff] [blame] | 2421 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
Hanno Becker | 78c9137 | 2019-05-08 13:31:15 +0100 | [diff] [blame] | 2422 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 2423 | run_test "Connection ID, 3D: Cli+Srv enabled, Srv disables on renegotiation" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2424 | -p "$P_PXY drop=5 delay=5 duplicate=5 bad_cid=1" \ |
Hanno Becker | b42ec0d | 2019-05-03 17:30:59 +0100 | [diff] [blame] | 2425 | "$P_SRV debug_level=3 dtls=1 cid=1 cid_val=dead cid_renego=0 renegotiation=1" \ |
| 2426 | "$P_CLI debug_level=3 dtls=1 cid=1 cid_val=beef renegotiation=1 renegotiate=1" \ |
| 2427 | 0 \ |
| 2428 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2429 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2430 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2431 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2432 | -C "(after renegotiation) Peer CID (length 2 Bytes): de ad" \ |
| 2433 | -S "(after renegotiation) Peer CID (length 2 Bytes): be ef" \ |
| 2434 | -C "(after renegotiation) Use of Connection ID has been negotiated" \ |
| 2435 | -S "(after renegotiation) Use of Connection ID has been negotiated" \ |
Hanno Becker | d0ac5fa | 2019-05-24 10:11:23 +0100 | [diff] [blame] | 2436 | -c "(after renegotiation) Use of Connection ID was rejected by the server" \ |
| 2437 | -c "ignoring unexpected CID" \ |
| 2438 | -s "ignoring unexpected CID" |
Hanno Becker | 7cf463e | 2019-04-09 18:08:47 +0100 | [diff] [blame] | 2439 | |
Yuto Takano | 3fa1673 | 2021-07-09 11:21:43 +0100 | [diff] [blame] | 2440 | # 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] | 2441 | # tests check that the buffer contents are reallocated when the message is |
| 2442 | # larger than the buffer. |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2443 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2444 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2445 | requires_max_content_len 513 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2446 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=512" \ |
| 2447 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2448 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=512 dtls=1 cid=1 cid_val=beef" \ |
| 2449 | 0 \ |
| 2450 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2451 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2452 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2453 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2454 | -s "Reallocating in_buf" \ |
| 2455 | -s "Reallocating out_buf" |
| 2456 | |
| 2457 | requires_config_enabled MBEDTLS_SSL_DTLS_CONNECTION_ID |
| 2458 | requires_config_enabled MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH |
Yuto Takano | 9c09d55 | 2021-07-08 16:03:44 +0100 | [diff] [blame] | 2459 | requires_max_content_len 1025 |
Andrzej Kurek | b657783 | 2020-06-08 07:08:03 -0400 | [diff] [blame] | 2460 | run_test "Connection ID: Cli+Srv enabled, variable buffer lengths, MFL=1024" \ |
| 2461 | "$P_SRV dtls=1 cid=1 cid_val=dead debug_level=2" \ |
| 2462 | "$P_CLI force_ciphersuite="TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8" max_frag_len=1024 dtls=1 cid=1 cid_val=beef" \ |
| 2463 | 0 \ |
| 2464 | -c "(initial handshake) Peer CID (length 2 Bytes): de ad" \ |
| 2465 | -s "(initial handshake) Peer CID (length 2 Bytes): be ef" \ |
| 2466 | -s "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2467 | -c "(initial handshake) Use of Connection ID has been negotiated" \ |
| 2468 | -s "Reallocating in_buf" \ |
| 2469 | -s "Reallocating out_buf" |
| 2470 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2471 | # Tests for Encrypt-then-MAC extension |
| 2472 | |
| 2473 | run_test "Encrypt then MAC: default" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2474 | "$P_SRV debug_level=3 \ |
| 2475 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2476 | "$P_CLI debug_level=3" \ |
| 2477 | 0 \ |
| 2478 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2479 | -s "found encrypt then mac extension" \ |
| 2480 | -s "server hello, adding encrypt then mac extension" \ |
| 2481 | -c "found encrypt_then_mac extension" \ |
| 2482 | -c "using encrypt then mac" \ |
| 2483 | -s "using encrypt then mac" |
| 2484 | |
| 2485 | run_test "Encrypt then MAC: client enabled, server disabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2486 | "$P_SRV debug_level=3 etm=0 \ |
| 2487 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2488 | "$P_CLI debug_level=3 etm=1" \ |
| 2489 | 0 \ |
| 2490 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2491 | -s "found encrypt then mac extension" \ |
| 2492 | -S "server hello, adding encrypt then mac extension" \ |
| 2493 | -C "found encrypt_then_mac extension" \ |
| 2494 | -C "using encrypt then mac" \ |
| 2495 | -S "using encrypt then mac" |
| 2496 | |
Manuel Pégourié-Gonnard | 78e745f | 2014-11-04 15:44:06 +0100 | [diff] [blame] | 2497 | run_test "Encrypt then MAC: client enabled, aead cipher" \ |
| 2498 | "$P_SRV debug_level=3 etm=1 \ |
| 2499 | force_ciphersuite=TLS-RSA-WITH-AES-128-GCM-SHA256" \ |
| 2500 | "$P_CLI debug_level=3 etm=1" \ |
| 2501 | 0 \ |
| 2502 | -c "client hello, adding encrypt_then_mac extension" \ |
| 2503 | -s "found encrypt then mac extension" \ |
| 2504 | -S "server hello, adding encrypt then mac extension" \ |
| 2505 | -C "found encrypt_then_mac extension" \ |
| 2506 | -C "using encrypt then mac" \ |
| 2507 | -S "using encrypt then mac" |
| 2508 | |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2509 | run_test "Encrypt then MAC: client disabled, server enabled" \ |
Manuel Pégourié-Gonnard | 0098e7d | 2014-10-28 13:08:59 +0100 | [diff] [blame] | 2510 | "$P_SRV debug_level=3 etm=1 \ |
| 2511 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
Manuel Pégourié-Gonnard | 699cafa | 2014-10-27 13:57:03 +0100 | [diff] [blame] | 2512 | "$P_CLI debug_level=3 etm=0" \ |
| 2513 | 0 \ |
| 2514 | -C "client hello, adding encrypt_then_mac extension" \ |
| 2515 | -S "found encrypt then mac extension" \ |
| 2516 | -S "server hello, adding encrypt then mac extension" \ |
| 2517 | -C "found encrypt_then_mac extension" \ |
| 2518 | -C "using encrypt then mac" \ |
| 2519 | -S "using encrypt then mac" |
| 2520 | |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2521 | # Tests for Extended Master Secret extension |
| 2522 | |
| 2523 | run_test "Extended Master Secret: default" \ |
| 2524 | "$P_SRV debug_level=3" \ |
| 2525 | "$P_CLI debug_level=3" \ |
| 2526 | 0 \ |
| 2527 | -c "client hello, adding extended_master_secret extension" \ |
| 2528 | -s "found extended master secret extension" \ |
| 2529 | -s "server hello, adding extended master secret extension" \ |
| 2530 | -c "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2531 | -c "session hash for extended master secret" \ |
| 2532 | -s "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2533 | |
| 2534 | run_test "Extended Master Secret: client enabled, server disabled" \ |
| 2535 | "$P_SRV debug_level=3 extended_ms=0" \ |
| 2536 | "$P_CLI debug_level=3 extended_ms=1" \ |
| 2537 | 0 \ |
| 2538 | -c "client hello, adding extended_master_secret extension" \ |
| 2539 | -s "found extended master secret extension" \ |
| 2540 | -S "server hello, adding extended master secret extension" \ |
| 2541 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2542 | -C "session hash for extended master secret" \ |
| 2543 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2544 | |
| 2545 | run_test "Extended Master Secret: client disabled, server enabled" \ |
| 2546 | "$P_SRV debug_level=3 extended_ms=1" \ |
| 2547 | "$P_CLI debug_level=3 extended_ms=0" \ |
| 2548 | 0 \ |
| 2549 | -C "client hello, adding extended_master_secret extension" \ |
| 2550 | -S "found extended master secret extension" \ |
| 2551 | -S "server hello, adding extended master secret extension" \ |
| 2552 | -C "found extended_master_secret extension" \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 2553 | -C "session hash for extended master secret" \ |
| 2554 | -S "session hash for extended master secret" |
Manuel Pégourié-Gonnard | 367381f | 2014-10-20 18:40:56 +0200 | [diff] [blame] | 2555 | |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2556 | # Test sending and receiving empty application data records |
| 2557 | |
| 2558 | run_test "Encrypt then MAC: empty application data record" \ |
| 2559 | "$P_SRV auth_mode=none debug_level=4 etm=1" \ |
| 2560 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA" \ |
| 2561 | 0 \ |
| 2562 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2563 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2564 | -c "0 bytes written in 1 fragments" |
| 2565 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2566 | run_test "Encrypt then MAC: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2567 | "$P_SRV auth_mode=none debug_level=4 etm=0" \ |
| 2568 | "$P_CLI auth_mode=none etm=0 request_size=0" \ |
| 2569 | 0 \ |
| 2570 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2571 | -c "0 bytes written in 1 fragments" |
| 2572 | |
| 2573 | run_test "Encrypt then MAC, DTLS: empty application data record" \ |
| 2574 | "$P_SRV auth_mode=none debug_level=4 etm=1 dtls=1" \ |
| 2575 | "$P_CLI auth_mode=none etm=1 request_size=0 force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA dtls=1" \ |
| 2576 | 0 \ |
| 2577 | -S "0000: 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f 0f" \ |
| 2578 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2579 | -c "0 bytes written in 1 fragments" |
| 2580 | |
Manuel Pégourié-Gonnard | 9e2c80f | 2020-03-24 10:53:39 +0100 | [diff] [blame] | 2581 | run_test "Encrypt then MAC, DTLS: disabled, empty application data record" \ |
Andres Amaya Garcia | 4c761fa | 2018-07-10 20:08:04 +0100 | [diff] [blame] | 2582 | "$P_SRV auth_mode=none debug_level=4 etm=0 dtls=1" \ |
| 2583 | "$P_CLI auth_mode=none etm=0 request_size=0 dtls=1" \ |
| 2584 | 0 \ |
| 2585 | -s "dumping 'input payload after decrypt' (0 bytes)" \ |
| 2586 | -c "0 bytes written in 1 fragments" |
| 2587 | |
Manuel Pégourié-Gonnard | 3ff7823 | 2015-01-08 11:15:09 +0100 | [diff] [blame] | 2588 | # Tests for CBC 1/n-1 record splitting |
| 2589 | |
| 2590 | run_test "CBC Record splitting: TLS 1.2, no splitting" \ |
| 2591 | "$P_SRV" \ |
| 2592 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA \ |
| 2593 | request_size=123 force_version=tls1_2" \ |
| 2594 | 0 \ |
| 2595 | -s "Read from client: 123 bytes read" \ |
| 2596 | -S "Read from client: 1 bytes read" \ |
| 2597 | -S "122 bytes read" |
| 2598 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2599 | # Tests for Session Tickets |
| 2600 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2601 | run_test "Session resume using tickets: basic" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2602 | "$P_SRV debug_level=3 tickets=1" \ |
| 2603 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2604 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2605 | -c "client hello, adding session ticket extension" \ |
| 2606 | -s "found session ticket extension" \ |
| 2607 | -s "server hello, adding session ticket extension" \ |
| 2608 | -c "found session_ticket extension" \ |
| 2609 | -c "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2610 | -S "session successfully restored from cache" \ |
| 2611 | -s "session successfully restored from ticket" \ |
| 2612 | -s "a session has been resumed" \ |
| 2613 | -c "a session has been resumed" |
| 2614 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2615 | run_test "Session resume using tickets: cache disabled" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2616 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2617 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | dbe1ee1 | 2014-02-21 09:18:13 +0100 | [diff] [blame] | 2618 | 0 \ |
| 2619 | -c "client hello, adding session ticket extension" \ |
| 2620 | -s "found session ticket extension" \ |
| 2621 | -s "server hello, adding session ticket extension" \ |
| 2622 | -c "found session_ticket extension" \ |
| 2623 | -c "parse new session ticket" \ |
| 2624 | -S "session successfully restored from cache" \ |
| 2625 | -s "session successfully restored from ticket" \ |
| 2626 | -s "a session has been resumed" \ |
| 2627 | -c "a session has been resumed" |
| 2628 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2629 | run_test "Session resume using tickets: timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2630 | "$P_SRV debug_level=3 tickets=1 cache_max=0 ticket_timeout=1" \ |
| 2631 | "$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] | 2632 | 0 \ |
| 2633 | -c "client hello, adding session ticket extension" \ |
| 2634 | -s "found session ticket extension" \ |
| 2635 | -s "server hello, adding session ticket extension" \ |
| 2636 | -c "found session_ticket extension" \ |
| 2637 | -c "parse new session ticket" \ |
| 2638 | -S "session successfully restored from cache" \ |
| 2639 | -S "session successfully restored from ticket" \ |
| 2640 | -S "a session has been resumed" \ |
| 2641 | -C "a session has been resumed" |
| 2642 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2643 | run_test "Session resume using tickets: session copy" \ |
| 2644 | "$P_SRV debug_level=3 tickets=1 cache_max=0" \ |
| 2645 | "$P_CLI debug_level=3 tickets=1 reconnect=1 reco_mode=0" \ |
| 2646 | 0 \ |
| 2647 | -c "client hello, adding session ticket extension" \ |
| 2648 | -s "found session ticket extension" \ |
| 2649 | -s "server hello, adding session ticket extension" \ |
| 2650 | -c "found session_ticket extension" \ |
| 2651 | -c "parse new session ticket" \ |
| 2652 | -S "session successfully restored from cache" \ |
| 2653 | -s "session successfully restored from ticket" \ |
| 2654 | -s "a session has been resumed" \ |
| 2655 | -c "a session has been resumed" |
| 2656 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2657 | run_test "Session resume using tickets: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2658 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2659 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2660 | 0 \ |
| 2661 | -c "client hello, adding session ticket extension" \ |
| 2662 | -c "found session_ticket extension" \ |
| 2663 | -c "parse new session ticket" \ |
| 2664 | -c "a session has been resumed" |
| 2665 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2666 | run_test "Session resume using tickets: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2667 | "$P_SRV debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2668 | "( $O_CLI -sess_out $SESSION; \ |
| 2669 | $O_CLI -sess_in $SESSION; \ |
| 2670 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | fccd325 | 2014-02-25 17:14:15 +0100 | [diff] [blame] | 2671 | 0 \ |
| 2672 | -s "found session ticket extension" \ |
| 2673 | -s "server hello, adding session ticket extension" \ |
| 2674 | -S "session successfully restored from cache" \ |
| 2675 | -s "session successfully restored from ticket" \ |
| 2676 | -s "a session has been resumed" |
| 2677 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2678 | # Tests for Session Tickets with DTLS |
| 2679 | |
| 2680 | run_test "Session resume using tickets, DTLS: basic" \ |
| 2681 | "$P_SRV debug_level=3 dtls=1 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2682 | "$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] | 2683 | 0 \ |
| 2684 | -c "client hello, adding session ticket extension" \ |
| 2685 | -s "found session ticket extension" \ |
| 2686 | -s "server hello, adding session ticket extension" \ |
| 2687 | -c "found session_ticket extension" \ |
| 2688 | -c "parse new session ticket" \ |
| 2689 | -S "session successfully restored from cache" \ |
| 2690 | -s "session successfully restored from ticket" \ |
| 2691 | -s "a session has been resumed" \ |
| 2692 | -c "a session has been resumed" |
| 2693 | |
| 2694 | run_test "Session resume using tickets, DTLS: cache disabled" \ |
| 2695 | "$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] | 2696 | "$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] | 2697 | 0 \ |
| 2698 | -c "client hello, adding session ticket extension" \ |
| 2699 | -s "found session ticket extension" \ |
| 2700 | -s "server hello, adding session ticket extension" \ |
| 2701 | -c "found session_ticket extension" \ |
| 2702 | -c "parse new session ticket" \ |
| 2703 | -S "session successfully restored from cache" \ |
| 2704 | -s "session successfully restored from ticket" \ |
| 2705 | -s "a session has been resumed" \ |
| 2706 | -c "a session has been resumed" |
| 2707 | |
| 2708 | run_test "Session resume using tickets, DTLS: timeout" \ |
| 2709 | "$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] | 2710 | "$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] | 2711 | 0 \ |
| 2712 | -c "client hello, adding session ticket extension" \ |
| 2713 | -s "found session ticket extension" \ |
| 2714 | -s "server hello, adding session ticket extension" \ |
| 2715 | -c "found session_ticket extension" \ |
| 2716 | -c "parse new session ticket" \ |
| 2717 | -S "session successfully restored from cache" \ |
| 2718 | -S "session successfully restored from ticket" \ |
| 2719 | -S "a session has been resumed" \ |
| 2720 | -C "a session has been resumed" |
| 2721 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2722 | run_test "Session resume using tickets, DTLS: session copy" \ |
| 2723 | "$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] | 2724 | "$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] | 2725 | 0 \ |
| 2726 | -c "client hello, adding session ticket extension" \ |
| 2727 | -s "found session ticket extension" \ |
| 2728 | -s "server hello, adding session ticket extension" \ |
| 2729 | -c "found session_ticket extension" \ |
| 2730 | -c "parse new session ticket" \ |
| 2731 | -S "session successfully restored from cache" \ |
| 2732 | -s "session successfully restored from ticket" \ |
| 2733 | -s "a session has been resumed" \ |
| 2734 | -c "a session has been resumed" |
| 2735 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2736 | run_test "Session resume using tickets, DTLS: openssl server" \ |
| 2737 | "$O_SRV -dtls" \ |
| 2738 | "$P_CLI dtls=1 debug_level=3 tickets=1 reconnect=1" \ |
| 2739 | 0 \ |
| 2740 | -c "client hello, adding session ticket extension" \ |
| 2741 | -c "found session_ticket extension" \ |
| 2742 | -c "parse new session ticket" \ |
| 2743 | -c "a session has been resumed" |
| 2744 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2745 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 09cfa18 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 2746 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2747 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2748 | run_test "Session resume using tickets, DTLS: openssl client" \ |
| 2749 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2750 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 2751 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2752 | rm -f $SESSION )" \ |
| 2753 | 0 \ |
| 2754 | -s "found session ticket extension" \ |
| 2755 | -s "server hello, adding session ticket extension" \ |
| 2756 | -S "session successfully restored from cache" \ |
| 2757 | -s "session successfully restored from ticket" \ |
| 2758 | -s "a session has been resumed" |
| 2759 | |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2760 | # Tests for Session Resume based on session-ID and cache |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2761 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2762 | run_test "Session resume using cache: tickets enabled on client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2763 | "$P_SRV debug_level=3 tickets=0" \ |
| 2764 | "$P_CLI debug_level=3 tickets=1 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2765 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2766 | -c "client hello, adding session ticket extension" \ |
| 2767 | -s "found session ticket extension" \ |
| 2768 | -S "server hello, adding session ticket extension" \ |
| 2769 | -C "found session_ticket extension" \ |
| 2770 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2771 | -s "session successfully restored from cache" \ |
| 2772 | -S "session successfully restored from ticket" \ |
| 2773 | -s "a session has been resumed" \ |
| 2774 | -c "a session has been resumed" |
| 2775 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2776 | run_test "Session resume using cache: tickets enabled on server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2777 | "$P_SRV debug_level=3 tickets=1" \ |
| 2778 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2779 | 0 \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2780 | -C "client hello, adding session ticket extension" \ |
| 2781 | -S "found session ticket extension" \ |
| 2782 | -S "server hello, adding session ticket extension" \ |
| 2783 | -C "found session_ticket extension" \ |
| 2784 | -C "parse new session ticket" \ |
Manuel Pégourié-Gonnard | f7c5201 | 2014-02-20 11:43:46 +0100 | [diff] [blame] | 2785 | -s "session successfully restored from cache" \ |
| 2786 | -S "session successfully restored from ticket" \ |
| 2787 | -s "a session has been resumed" \ |
| 2788 | -c "a session has been resumed" |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2789 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2790 | run_test "Session resume using cache: cache_max=0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2791 | "$P_SRV debug_level=3 tickets=0 cache_max=0" \ |
| 2792 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2793 | 0 \ |
| 2794 | -S "session successfully restored from cache" \ |
| 2795 | -S "session successfully restored from ticket" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2796 | -S "a session has been resumed" \ |
| 2797 | -C "a session has been resumed" |
Manuel Pégourié-Gonnard | 4c88345 | 2014-02-20 21:32:41 +0100 | [diff] [blame] | 2798 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2799 | run_test "Session resume using cache: cache_max=1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2800 | "$P_SRV debug_level=3 tickets=0 cache_max=1" \ |
| 2801 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | c55a5b7 | 2014-02-20 22:50:56 +0100 | [diff] [blame] | 2802 | 0 \ |
| 2803 | -s "session successfully restored from cache" \ |
| 2804 | -S "session successfully restored from ticket" \ |
| 2805 | -s "a session has been resumed" \ |
| 2806 | -c "a session has been resumed" |
| 2807 | |
Manuel Pégourié-Gonnard | 6df3196 | 2015-05-04 10:55:47 +0200 | [diff] [blame] | 2808 | run_test "Session resume using cache: timeout > delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2809 | "$P_SRV debug_level=3 tickets=0" \ |
| 2810 | "$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] | 2811 | 0 \ |
| 2812 | -s "session successfully restored from cache" \ |
| 2813 | -S "session successfully restored from ticket" \ |
| 2814 | -s "a session has been resumed" \ |
| 2815 | -c "a session has been resumed" |
| 2816 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2817 | run_test "Session resume using cache: timeout < delay" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2818 | "$P_SRV debug_level=3 tickets=0 cache_timeout=1" \ |
| 2819 | "$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] | 2820 | 0 \ |
| 2821 | -S "session successfully restored from cache" \ |
| 2822 | -S "session successfully restored from ticket" \ |
| 2823 | -S "a session has been resumed" \ |
| 2824 | -C "a session has been resumed" |
| 2825 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2826 | run_test "Session resume using cache: no timeout" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2827 | "$P_SRV debug_level=3 tickets=0 cache_timeout=0" \ |
| 2828 | "$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] | 2829 | 0 \ |
| 2830 | -s "session successfully restored from cache" \ |
| 2831 | -S "session successfully restored from ticket" \ |
| 2832 | -s "a session has been resumed" \ |
| 2833 | -c "a session has been resumed" |
| 2834 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2835 | run_test "Session resume using cache: session copy" \ |
| 2836 | "$P_SRV debug_level=3 tickets=0" \ |
| 2837 | "$P_CLI debug_level=3 tickets=0 reconnect=1 reco_mode=0" \ |
| 2838 | 0 \ |
| 2839 | -s "session successfully restored from cache" \ |
| 2840 | -S "session successfully restored from ticket" \ |
| 2841 | -s "a session has been resumed" \ |
| 2842 | -c "a session has been resumed" |
| 2843 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2844 | run_test "Session resume using cache: openssl client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2845 | "$P_SRV debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | bc3b16c | 2014-05-28 23:06:50 +0200 | [diff] [blame] | 2846 | "( $O_CLI -sess_out $SESSION; \ |
| 2847 | $O_CLI -sess_in $SESSION; \ |
| 2848 | rm -f $SESSION )" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2849 | 0 \ |
| 2850 | -s "found session ticket extension" \ |
| 2851 | -S "server hello, adding session ticket extension" \ |
| 2852 | -s "session successfully restored from cache" \ |
| 2853 | -S "session successfully restored from ticket" \ |
| 2854 | -s "a session has been resumed" |
| 2855 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 2856 | run_test "Session resume using cache: openssl server" \ |
Manuel Pégourié-Gonnard | f7a2690 | 2014-02-27 12:25:54 +0100 | [diff] [blame] | 2857 | "$O_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2858 | "$P_CLI debug_level=3 tickets=0 reconnect=1" \ |
Manuel Pégourié-Gonnard | db735f6 | 2014-02-25 17:57:59 +0100 | [diff] [blame] | 2859 | 0 \ |
| 2860 | -C "found session_ticket extension" \ |
| 2861 | -C "parse new session ticket" \ |
| 2862 | -c "a session has been resumed" |
| 2863 | |
Hanno Becker | 1d73993 | 2018-08-21 13:55:22 +0100 | [diff] [blame] | 2864 | # Tests for Session Resume based on session-ID and cache, DTLS |
| 2865 | |
| 2866 | run_test "Session resume using cache, DTLS: tickets enabled on client" \ |
| 2867 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2868 | "$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] | 2869 | 0 \ |
| 2870 | -c "client hello, adding session ticket extension" \ |
| 2871 | -s "found session ticket extension" \ |
| 2872 | -S "server hello, adding session ticket extension" \ |
| 2873 | -C "found session_ticket extension" \ |
| 2874 | -C "parse new session ticket" \ |
| 2875 | -s "session successfully restored from cache" \ |
| 2876 | -S "session successfully restored from ticket" \ |
| 2877 | -s "a session has been resumed" \ |
| 2878 | -c "a session has been resumed" |
| 2879 | |
| 2880 | run_test "Session resume using cache, DTLS: tickets enabled on server" \ |
| 2881 | "$P_SRV dtls=1 debug_level=3 tickets=1" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2882 | "$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] | 2883 | 0 \ |
| 2884 | -C "client hello, adding session ticket extension" \ |
| 2885 | -S "found session ticket extension" \ |
| 2886 | -S "server hello, adding session ticket extension" \ |
| 2887 | -C "found session_ticket extension" \ |
| 2888 | -C "parse new session ticket" \ |
| 2889 | -s "session successfully restored from cache" \ |
| 2890 | -S "session successfully restored from ticket" \ |
| 2891 | -s "a session has been resumed" \ |
| 2892 | -c "a session has been resumed" |
| 2893 | |
| 2894 | run_test "Session resume using cache, DTLS: cache_max=0" \ |
| 2895 | "$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] | 2896 | "$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] | 2897 | 0 \ |
| 2898 | -S "session successfully restored from cache" \ |
| 2899 | -S "session successfully restored from ticket" \ |
| 2900 | -S "a session has been resumed" \ |
| 2901 | -C "a session has been resumed" |
| 2902 | |
| 2903 | run_test "Session resume using cache, DTLS: cache_max=1" \ |
| 2904 | "$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] | 2905 | "$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] | 2906 | 0 \ |
| 2907 | -s "session successfully restored from cache" \ |
| 2908 | -S "session successfully restored from ticket" \ |
| 2909 | -s "a session has been resumed" \ |
| 2910 | -c "a session has been resumed" |
| 2911 | |
| 2912 | run_test "Session resume using cache, DTLS: timeout > delay" \ |
| 2913 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2914 | "$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] | 2915 | 0 \ |
| 2916 | -s "session successfully restored from cache" \ |
| 2917 | -S "session successfully restored from ticket" \ |
| 2918 | -s "a session has been resumed" \ |
| 2919 | -c "a session has been resumed" |
| 2920 | |
| 2921 | run_test "Session resume using cache, DTLS: timeout < delay" \ |
| 2922 | "$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] | 2923 | "$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] | 2924 | 0 \ |
| 2925 | -S "session successfully restored from cache" \ |
| 2926 | -S "session successfully restored from ticket" \ |
| 2927 | -S "a session has been resumed" \ |
| 2928 | -C "a session has been resumed" |
| 2929 | |
| 2930 | run_test "Session resume using cache, DTLS: no timeout" \ |
| 2931 | "$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] | 2932 | "$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] | 2933 | 0 \ |
| 2934 | -s "session successfully restored from cache" \ |
| 2935 | -S "session successfully restored from ticket" \ |
| 2936 | -s "a session has been resumed" \ |
| 2937 | -c "a session has been resumed" |
| 2938 | |
Manuel Pégourié-Gonnard | a7c3765 | 2019-05-20 12:46:26 +0200 | [diff] [blame] | 2939 | run_test "Session resume using cache, DTLS: session copy" \ |
| 2940 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 2941 | "$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] | 2942 | 0 \ |
| 2943 | -s "session successfully restored from cache" \ |
| 2944 | -S "session successfully restored from ticket" \ |
| 2945 | -s "a session has been resumed" \ |
| 2946 | -c "a session has been resumed" |
| 2947 | |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2948 | # For reasons that aren't fully understood, this test randomly fails with high |
Paul Elliott | 09cfa18 | 2021-10-13 16:13:44 +0100 | [diff] [blame] | 2949 | # probability with OpenSSL 1.0.2g on the CI, see #5012. |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2950 | requires_openssl_next |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2951 | run_test "Session resume using cache, DTLS: openssl client" \ |
| 2952 | "$P_SRV dtls=1 debug_level=3 tickets=0" \ |
Manuel Pégourié-Gonnard | d60950c | 2021-10-13 13:12:47 +0200 | [diff] [blame] | 2953 | "( $O_NEXT_CLI -dtls -sess_out $SESSION; \ |
| 2954 | $O_NEXT_CLI -dtls -sess_in $SESSION; \ |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 2955 | rm -f $SESSION )" \ |
| 2956 | 0 \ |
| 2957 | -s "found session ticket extension" \ |
| 2958 | -S "server hello, adding session ticket extension" \ |
| 2959 | -s "session successfully restored from cache" \ |
| 2960 | -S "session successfully restored from ticket" \ |
| 2961 | -s "a session has been resumed" |
| 2962 | |
| 2963 | run_test "Session resume using cache, DTLS: openssl server" \ |
| 2964 | "$O_SRV -dtls" \ |
| 2965 | "$P_CLI dtls=1 debug_level=3 tickets=0 reconnect=1" \ |
| 2966 | 0 \ |
| 2967 | -C "found session_ticket extension" \ |
| 2968 | -C "parse new session ticket" \ |
| 2969 | -c "a session has been resumed" |
| 2970 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 2971 | # Tests for Max Fragment Length extension |
| 2972 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2973 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2974 | run_test "Max fragment length: enabled, default" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 2975 | "$P_SRV debug_level=3" \ |
| 2976 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2977 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2978 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2979 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2980 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2981 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 2982 | -C "client hello, adding max_fragment_length extension" \ |
| 2983 | -S "found max fragment length extension" \ |
| 2984 | -S "server hello, max_fragment_length extension" \ |
| 2985 | -C "found max_fragment_length extension" |
| 2986 | |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 2987 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2988 | run_test "Max fragment length: enabled, default, larger message" \ |
| 2989 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 2990 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2991 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 2992 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2993 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 2994 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 2995 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 2996 | -C "client hello, adding max_fragment_length extension" \ |
| 2997 | -S "found max fragment length extension" \ |
| 2998 | -S "server hello, max_fragment_length extension" \ |
| 2999 | -C "found max_fragment_length extension" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3000 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3001 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3002 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3003 | |
| 3004 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3005 | run_test "Max fragment length, DTLS: enabled, default, larger message" \ |
| 3006 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3007 | "$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] | 3008 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3009 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3010 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3011 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3012 | -s "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3013 | -C "client hello, adding max_fragment_length extension" \ |
| 3014 | -S "found max fragment length extension" \ |
| 3015 | -S "server hello, max_fragment_length extension" \ |
| 3016 | -C "found max_fragment_length extension" \ |
| 3017 | -c "fragment larger than.*maximum " |
| 3018 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3019 | # Run some tests with MBEDTLS_SSL_MAX_FRAGMENT_LENGTH disabled |
| 3020 | # (session fragment length will be 16384 regardless of mbedtls |
| 3021 | # content length configuration.) |
| 3022 | |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3023 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3024 | run_test "Max fragment length: disabled, larger message" \ |
| 3025 | "$P_SRV debug_level=3" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3026 | "$P_CLI debug_level=3 request_size=$(( $MAX_CONTENT_LEN + 1))" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3027 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3028 | -C "Maximum incoming record payload length is 16384" \ |
| 3029 | -C "Maximum outgoing record payload length is 16384" \ |
| 3030 | -S "Maximum incoming record payload length is 16384" \ |
| 3031 | -S "Maximum outgoing record payload length is 16384" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3032 | -c "$(( $MAX_CONTENT_LEN + 1)) bytes written in 2 fragments" \ |
| 3033 | -s "$MAX_CONTENT_LEN bytes read" \ |
Hanno Becker | 9cfabe3 | 2017-10-18 14:42:01 +0100 | [diff] [blame] | 3034 | -s "1 bytes read" |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3035 | |
| 3036 | requires_config_disabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | 0509fea | 2021-06-21 19:43:33 +0100 | [diff] [blame] | 3037 | run_test "Max fragment length, DTLS: disabled, larger message" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3038 | "$P_SRV debug_level=3 dtls=1" \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 3039 | "$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] | 3040 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3041 | -C "Maximum incoming record payload length is 16384" \ |
| 3042 | -C "Maximum outgoing record payload length is 16384" \ |
| 3043 | -S "Maximum incoming record payload length is 16384" \ |
| 3044 | -S "Maximum outgoing record payload length is 16384" \ |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3045 | -c "fragment larger than.*maximum " |
| 3046 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3047 | requires_max_content_len 4096 |
Hanno Becker | c526696 | 2017-09-18 15:01:50 +0100 | [diff] [blame] | 3048 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3049 | run_test "Max fragment length: used by client" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3050 | "$P_SRV debug_level=3" \ |
| 3051 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3052 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3053 | -c "Maximum incoming record payload length is 4096" \ |
| 3054 | -c "Maximum outgoing record payload length is 4096" \ |
| 3055 | -s "Maximum incoming record payload length is 4096" \ |
| 3056 | -s "Maximum outgoing record payload length is 4096" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3057 | -c "client hello, adding max_fragment_length extension" \ |
| 3058 | -s "found max fragment length extension" \ |
| 3059 | -s "server hello, max_fragment_length extension" \ |
| 3060 | -c "found max_fragment_length extension" |
| 3061 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3062 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3063 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3064 | run_test "Max fragment length: client 512, server 1024" \ |
| 3065 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3066 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3067 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3068 | -c "Maximum incoming record payload length is 512" \ |
| 3069 | -c "Maximum outgoing record payload length is 512" \ |
| 3070 | -s "Maximum incoming record payload length is 512" \ |
| 3071 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3072 | -c "client hello, adding max_fragment_length extension" \ |
| 3073 | -s "found max fragment length extension" \ |
| 3074 | -s "server hello, max_fragment_length extension" \ |
| 3075 | -c "found max_fragment_length extension" |
| 3076 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3077 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3078 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3079 | run_test "Max fragment length: client 512, server 2048" \ |
| 3080 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3081 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3082 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3083 | -c "Maximum incoming record payload length is 512" \ |
| 3084 | -c "Maximum outgoing record payload length is 512" \ |
| 3085 | -s "Maximum incoming record payload length is 512" \ |
| 3086 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3087 | -c "client hello, adding max_fragment_length extension" \ |
| 3088 | -s "found max fragment length extension" \ |
| 3089 | -s "server hello, max_fragment_length extension" \ |
| 3090 | -c "found max_fragment_length extension" |
| 3091 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3092 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3093 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3094 | run_test "Max fragment length: client 512, server 4096" \ |
| 3095 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3096 | "$P_CLI debug_level=3 max_frag_len=512" \ |
| 3097 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3098 | -c "Maximum incoming record payload length is 512" \ |
| 3099 | -c "Maximum outgoing record payload length is 512" \ |
| 3100 | -s "Maximum incoming record payload length is 512" \ |
| 3101 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3102 | -c "client hello, adding max_fragment_length extension" \ |
| 3103 | -s "found max fragment length extension" \ |
| 3104 | -s "server hello, max_fragment_length extension" \ |
| 3105 | -c "found max_fragment_length extension" |
| 3106 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3107 | requires_max_content_len 1024 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3108 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3109 | run_test "Max fragment length: client 1024, server 512" \ |
| 3110 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3111 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3112 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3113 | -c "Maximum incoming record payload length is 1024" \ |
| 3114 | -c "Maximum outgoing record payload length is 1024" \ |
| 3115 | -s "Maximum incoming record payload length is 1024" \ |
| 3116 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3117 | -c "client hello, adding max_fragment_length extension" \ |
| 3118 | -s "found max fragment length extension" \ |
| 3119 | -s "server hello, max_fragment_length extension" \ |
| 3120 | -c "found max_fragment_length extension" |
| 3121 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3122 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3123 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3124 | run_test "Max fragment length: client 1024, server 2048" \ |
| 3125 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3126 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3127 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3128 | -c "Maximum incoming record payload length is 1024" \ |
| 3129 | -c "Maximum outgoing record payload length is 1024" \ |
| 3130 | -s "Maximum incoming record payload length is 1024" \ |
| 3131 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3132 | -c "client hello, adding max_fragment_length extension" \ |
| 3133 | -s "found max fragment length extension" \ |
| 3134 | -s "server hello, max_fragment_length extension" \ |
| 3135 | -c "found max_fragment_length extension" |
| 3136 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3137 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3138 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3139 | run_test "Max fragment length: client 1024, server 4096" \ |
| 3140 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3141 | "$P_CLI debug_level=3 max_frag_len=1024" \ |
| 3142 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3143 | -c "Maximum incoming record payload length is 1024" \ |
| 3144 | -c "Maximum outgoing record payload length is 1024" \ |
| 3145 | -s "Maximum incoming record payload length is 1024" \ |
| 3146 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3147 | -c "client hello, adding max_fragment_length extension" \ |
| 3148 | -s "found max fragment length extension" \ |
| 3149 | -s "server hello, max_fragment_length extension" \ |
| 3150 | -c "found max_fragment_length extension" |
| 3151 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3152 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3153 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3154 | run_test "Max fragment length: client 2048, server 512" \ |
| 3155 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3156 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3157 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3158 | -c "Maximum incoming record payload length is 2048" \ |
| 3159 | -c "Maximum outgoing record payload length is 2048" \ |
| 3160 | -s "Maximum incoming record payload length is 2048" \ |
| 3161 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3162 | -c "client hello, adding max_fragment_length extension" \ |
| 3163 | -s "found max fragment length extension" \ |
| 3164 | -s "server hello, max_fragment_length extension" \ |
| 3165 | -c "found max_fragment_length extension" |
| 3166 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3167 | requires_max_content_len 2048 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3168 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3169 | run_test "Max fragment length: client 2048, server 1024" \ |
| 3170 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3171 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3172 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3173 | -c "Maximum incoming record payload length is 2048" \ |
| 3174 | -c "Maximum outgoing record payload length is 2048" \ |
| 3175 | -s "Maximum incoming record payload length is 2048" \ |
| 3176 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3177 | -c "client hello, adding max_fragment_length extension" \ |
| 3178 | -s "found max fragment length extension" \ |
| 3179 | -s "server hello, max_fragment_length extension" \ |
| 3180 | -c "found max_fragment_length extension" |
| 3181 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3182 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3183 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3184 | run_test "Max fragment length: client 2048, server 4096" \ |
| 3185 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3186 | "$P_CLI debug_level=3 max_frag_len=2048" \ |
| 3187 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3188 | -c "Maximum incoming record payload length is 2048" \ |
| 3189 | -c "Maximum outgoing record payload length is 2048" \ |
| 3190 | -s "Maximum incoming record payload length is 2048" \ |
| 3191 | -s "Maximum outgoing record payload length is 2048" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3192 | -c "client hello, adding max_fragment_length extension" \ |
| 3193 | -s "found max fragment length extension" \ |
| 3194 | -s "server hello, max_fragment_length extension" \ |
| 3195 | -c "found max_fragment_length extension" |
| 3196 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3197 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3198 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3199 | run_test "Max fragment length: client 4096, server 512" \ |
| 3200 | "$P_SRV debug_level=3 max_frag_len=512" \ |
| 3201 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3202 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3203 | -c "Maximum incoming record payload length is 4096" \ |
| 3204 | -c "Maximum outgoing record payload length is 4096" \ |
| 3205 | -s "Maximum incoming record payload length is 4096" \ |
| 3206 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3207 | -c "client hello, adding max_fragment_length extension" \ |
| 3208 | -s "found max fragment length extension" \ |
| 3209 | -s "server hello, max_fragment_length extension" \ |
| 3210 | -c "found max_fragment_length extension" |
| 3211 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3212 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3213 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3214 | run_test "Max fragment length: client 4096, server 1024" \ |
| 3215 | "$P_SRV debug_level=3 max_frag_len=1024" \ |
| 3216 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3217 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3218 | -c "Maximum incoming record payload length is 4096" \ |
| 3219 | -c "Maximum outgoing record payload length is 4096" \ |
| 3220 | -s "Maximum incoming record payload length is 4096" \ |
| 3221 | -s "Maximum outgoing record payload length is 1024" \ |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3222 | -c "client hello, adding max_fragment_length extension" \ |
| 3223 | -s "found max fragment length extension" \ |
| 3224 | -s "server hello, max_fragment_length extension" \ |
| 3225 | -c "found max_fragment_length extension" |
| 3226 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3227 | requires_max_content_len 4096 |
Andrzej Kurek | 90c6e84 | 2020-04-03 05:25:29 -0400 | [diff] [blame] | 3228 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
| 3229 | run_test "Max fragment length: client 4096, server 2048" \ |
| 3230 | "$P_SRV debug_level=3 max_frag_len=2048" \ |
| 3231 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
| 3232 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3233 | -c "Maximum incoming record payload length is 4096" \ |
| 3234 | -c "Maximum outgoing record payload length is 4096" \ |
| 3235 | -s "Maximum incoming record payload length is 4096" \ |
| 3236 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3237 | -c "client hello, adding max_fragment_length extension" \ |
| 3238 | -s "found max fragment length extension" \ |
| 3239 | -s "server hello, max_fragment_length extension" \ |
| 3240 | -c "found max_fragment_length extension" |
| 3241 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3242 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3243 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3244 | run_test "Max fragment length: used by server" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3245 | "$P_SRV debug_level=3 max_frag_len=4096" \ |
| 3246 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3247 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3248 | -c "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3249 | -c "Maximum outgoing record payload length is $MAX_CONTENT_LEN" \ |
| 3250 | -s "Maximum incoming record payload length is $MAX_CONTENT_LEN" \ |
| 3251 | -s "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | de14378 | 2014-02-20 14:50:42 +0100 | [diff] [blame] | 3252 | -C "client hello, adding max_fragment_length extension" \ |
| 3253 | -S "found max fragment length extension" \ |
| 3254 | -S "server hello, max_fragment_length extension" \ |
| 3255 | -C "found max_fragment_length extension" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3256 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3257 | requires_max_content_len 4096 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3258 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3259 | requires_gnutls |
| 3260 | run_test "Max fragment length: gnutls server" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3261 | "$G_SRV" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3262 | "$P_CLI debug_level=3 max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3263 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3264 | -c "Maximum incoming record payload length is 4096" \ |
| 3265 | -c "Maximum outgoing record payload length is 4096" \ |
Manuel Pégourié-Gonnard | baa7f07 | 2014-08-20 20:15:53 +0200 | [diff] [blame] | 3266 | -c "client hello, adding max_fragment_length extension" \ |
| 3267 | -c "found max_fragment_length extension" |
| 3268 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3269 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3270 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3271 | run_test "Max fragment length: client, message just fits" \ |
| 3272 | "$P_SRV debug_level=3" \ |
| 3273 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2048" \ |
| 3274 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3275 | -c "Maximum incoming record payload length is 2048" \ |
| 3276 | -c "Maximum outgoing record payload length is 2048" \ |
| 3277 | -s "Maximum incoming record payload length is 2048" \ |
| 3278 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3279 | -c "client hello, adding max_fragment_length extension" \ |
| 3280 | -s "found max fragment length extension" \ |
| 3281 | -s "server hello, max_fragment_length extension" \ |
| 3282 | -c "found max_fragment_length extension" \ |
| 3283 | -c "2048 bytes written in 1 fragments" \ |
| 3284 | -s "2048 bytes read" |
| 3285 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3286 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3287 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3288 | run_test "Max fragment length: client, larger message" \ |
| 3289 | "$P_SRV debug_level=3" \ |
| 3290 | "$P_CLI debug_level=3 max_frag_len=2048 request_size=2345" \ |
| 3291 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3292 | -c "Maximum incoming record payload length is 2048" \ |
| 3293 | -c "Maximum outgoing record payload length is 2048" \ |
| 3294 | -s "Maximum incoming record payload length is 2048" \ |
| 3295 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3296 | -c "client hello, adding max_fragment_length extension" \ |
| 3297 | -s "found max fragment length extension" \ |
| 3298 | -s "server hello, max_fragment_length extension" \ |
| 3299 | -c "found max_fragment_length extension" \ |
| 3300 | -c "2345 bytes written in 2 fragments" \ |
| 3301 | -s "2048 bytes read" \ |
| 3302 | -s "297 bytes read" |
| 3303 | |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3304 | requires_max_content_len 2048 |
Hanno Becker | 4aed27e | 2017-09-18 15:00:34 +0100 | [diff] [blame] | 3305 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Manuel Pégourié-Gonnard | 23eb74d | 2015-01-21 14:37:13 +0000 | [diff] [blame] | 3306 | run_test "Max fragment length: DTLS client, larger message" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3307 | "$P_SRV debug_level=3 dtls=1" \ |
| 3308 | "$P_CLI debug_level=3 dtls=1 max_frag_len=2048 request_size=2345" \ |
| 3309 | 1 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3310 | -c "Maximum incoming record payload length is 2048" \ |
| 3311 | -c "Maximum outgoing record payload length is 2048" \ |
| 3312 | -s "Maximum incoming record payload length is 2048" \ |
| 3313 | -s "Maximum outgoing record payload length is 2048" \ |
Manuel Pégourié-Gonnard | 37e08e1 | 2014-10-13 17:55:52 +0200 | [diff] [blame] | 3314 | -c "client hello, adding max_fragment_length extension" \ |
| 3315 | -s "found max fragment length extension" \ |
| 3316 | -s "server hello, max_fragment_length extension" \ |
| 3317 | -c "found max_fragment_length extension" \ |
| 3318 | -c "fragment larger than.*maximum" |
| 3319 | |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3320 | # Tests for renegotiation |
| 3321 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3322 | # Renegotiation SCSV always added, regardless of SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3323 | run_test "Renegotiation: none, for reference" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3324 | "$P_SRV debug_level=3 exchanges=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3325 | "$P_CLI debug_level=3 exchanges=2" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3326 | 0 \ |
| 3327 | -C "client hello, adding renegotiation extension" \ |
| 3328 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3329 | -S "found renegotiation extension" \ |
| 3330 | -s "server hello, secure renegotiation extension" \ |
| 3331 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3332 | -C "=> renegotiate" \ |
| 3333 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3334 | -S "write hello request" |
| 3335 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3336 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3337 | run_test "Renegotiation: client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3338 | "$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] | 3339 | "$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] | 3340 | 0 \ |
| 3341 | -c "client hello, adding renegotiation extension" \ |
| 3342 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3343 | -s "found renegotiation extension" \ |
| 3344 | -s "server hello, secure renegotiation extension" \ |
| 3345 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3346 | -c "=> renegotiate" \ |
| 3347 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3348 | -S "write hello request" |
| 3349 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3350 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3351 | run_test "Renegotiation: server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3352 | "$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] | 3353 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3354 | 0 \ |
| 3355 | -c "client hello, adding renegotiation extension" \ |
| 3356 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3357 | -s "found renegotiation extension" \ |
| 3358 | -s "server hello, secure renegotiation extension" \ |
| 3359 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3360 | -c "=> renegotiate" \ |
| 3361 | -s "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3362 | -s "write hello request" |
| 3363 | |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3364 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3365 | # 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] | 3366 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3367 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3368 | run_test "Renegotiation: Signature Algorithms parsing, client-initiated" \ |
| 3369 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional" \ |
| 3370 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3371 | 0 \ |
| 3372 | -c "client hello, adding renegotiation extension" \ |
| 3373 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3374 | -s "found renegotiation extension" \ |
| 3375 | -s "server hello, secure renegotiation extension" \ |
| 3376 | -c "found renegotiation extension" \ |
| 3377 | -c "=> renegotiate" \ |
| 3378 | -s "=> renegotiate" \ |
| 3379 | -S "write hello request" \ |
| 3380 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 3381 | |
| 3382 | # Checks that no Signature Algorithm with SHA-1 gets negotiated. Negotiating SHA-1 would mean that |
| 3383 | # 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] | 3384 | # algorithm stronger than SHA-1 is enabled in mbedtls_config.h |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3385 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Janos Follath | b0f148c | 2017-10-05 12:29:42 +0100 | [diff] [blame] | 3386 | run_test "Renegotiation: Signature Algorithms parsing, server-initiated" \ |
| 3387 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1" \ |
| 3388 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3389 | 0 \ |
| 3390 | -c "client hello, adding renegotiation extension" \ |
| 3391 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3392 | -s "found renegotiation extension" \ |
| 3393 | -s "server hello, secure renegotiation extension" \ |
| 3394 | -c "found renegotiation extension" \ |
| 3395 | -c "=> renegotiate" \ |
| 3396 | -s "=> renegotiate" \ |
| 3397 | -s "write hello request" \ |
| 3398 | -S "client hello v3, signature_algorithm ext: 2" # Is SHA-1 negotiated? |
| 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: double" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3402 | "$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] | 3403 | "$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] | 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" |
| 3413 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3414 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3415 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | b0a1c5b | 2021-07-02 10:10:49 +0100 | [diff] [blame] | 3416 | requires_max_content_len 2048 |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3417 | run_test "Renegotiation with max fragment length: client 2048, server 512" \ |
| 3418 | "$P_SRV debug_level=3 exchanges=2 renegotiation=1 auth_mode=optional renegotiate=1 max_frag_len=512" \ |
| 3419 | "$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" \ |
| 3420 | 0 \ |
Hanno Becker | 59d3670 | 2021-06-08 05:35:29 +0100 | [diff] [blame] | 3421 | -c "Maximum incoming record payload length is 2048" \ |
| 3422 | -c "Maximum outgoing record payload length is 2048" \ |
| 3423 | -s "Maximum incoming record payload length is 2048" \ |
| 3424 | -s "Maximum outgoing record payload length is 512" \ |
Andrzej Kurek | 8ea6872 | 2020-04-03 06:40:47 -0400 | [diff] [blame] | 3425 | -c "client hello, adding max_fragment_length extension" \ |
| 3426 | -s "found max fragment length extension" \ |
| 3427 | -s "server hello, max_fragment_length extension" \ |
| 3428 | -c "found max_fragment_length extension" \ |
| 3429 | -c "client hello, adding renegotiation extension" \ |
| 3430 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3431 | -s "found renegotiation extension" \ |
| 3432 | -s "server hello, secure renegotiation extension" \ |
| 3433 | -c "found renegotiation extension" \ |
| 3434 | -c "=> renegotiate" \ |
| 3435 | -s "=> renegotiate" \ |
| 3436 | -s "write hello request" |
| 3437 | |
| 3438 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3439 | run_test "Renegotiation: client-initiated, server-rejected" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3440 | "$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] | 3441 | "$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] | 3442 | 1 \ |
| 3443 | -c "client hello, adding renegotiation extension" \ |
| 3444 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3445 | -S "found renegotiation extension" \ |
| 3446 | -s "server hello, secure renegotiation extension" \ |
| 3447 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3448 | -c "=> renegotiate" \ |
| 3449 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3450 | -S "write hello request" \ |
Manuel Pégourié-Gonnard | 6591962 | 2014-08-19 12:50:30 +0200 | [diff] [blame] | 3451 | -c "SSL - Unexpected message at ServerHello in renegotiation" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3452 | -c "failed" |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3453 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3454 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3455 | run_test "Renegotiation: server-initiated, client-rejected, default" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3456 | "$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] | 3457 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3458 | 0 \ |
| 3459 | -C "client hello, adding renegotiation extension" \ |
| 3460 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3461 | -S "found renegotiation extension" \ |
| 3462 | -s "server hello, secure renegotiation extension" \ |
| 3463 | -c "found renegotiation extension" \ |
Manuel Pégourié-Gonnard | c73339f | 2014-02-26 16:35:27 +0100 | [diff] [blame] | 3464 | -C "=> renegotiate" \ |
| 3465 | -S "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 780d671 | 2014-02-20 17:19:59 +0100 | [diff] [blame] | 3466 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a9964db | 2014-07-03 19:29:16 +0200 | [diff] [blame] | 3467 | -S "SSL - An unexpected message was received from our peer" \ |
| 3468 | -S "failed" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 3469 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3470 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3471 | run_test "Renegotiation: server-initiated, client-rejected, not enforced" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3472 | "$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] | 3473 | renego_delay=-1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3474 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3475 | 0 \ |
| 3476 | -C "client hello, adding renegotiation extension" \ |
| 3477 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3478 | -S "found renegotiation extension" \ |
| 3479 | -s "server hello, secure renegotiation extension" \ |
| 3480 | -c "found renegotiation extension" \ |
| 3481 | -C "=> renegotiate" \ |
| 3482 | -S "=> renegotiate" \ |
| 3483 | -s "write hello request" \ |
| 3484 | -S "SSL - An unexpected message was received from our peer" \ |
| 3485 | -S "failed" |
| 3486 | |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3487 | # delay 2 for 1 alert record + 1 application data record |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3488 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3489 | run_test "Renegotiation: server-initiated, client-rejected, delay 2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3490 | "$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] | 3491 | renego_delay=2 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3492 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3493 | 0 \ |
| 3494 | -C "client hello, adding renegotiation extension" \ |
| 3495 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3496 | -S "found renegotiation extension" \ |
| 3497 | -s "server hello, secure renegotiation extension" \ |
| 3498 | -c "found renegotiation extension" \ |
| 3499 | -C "=> renegotiate" \ |
| 3500 | -S "=> renegotiate" \ |
| 3501 | -s "write hello request" \ |
| 3502 | -S "SSL - An unexpected message was received from our peer" \ |
| 3503 | -S "failed" |
| 3504 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3505 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3506 | run_test "Renegotiation: server-initiated, client-rejected, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3507 | "$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] | 3508 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3509 | "$P_CLI debug_level=3 exchanges=2 renegotiation=0" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3510 | 0 \ |
| 3511 | -C "client hello, adding renegotiation extension" \ |
| 3512 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3513 | -S "found renegotiation extension" \ |
| 3514 | -s "server hello, secure renegotiation extension" \ |
| 3515 | -c "found renegotiation extension" \ |
| 3516 | -C "=> renegotiate" \ |
| 3517 | -S "=> renegotiate" \ |
| 3518 | -s "write hello request" \ |
Manuel Pégourié-Gonnard | a8c0a0d | 2014-08-15 12:07:38 +0200 | [diff] [blame] | 3519 | -s "SSL - An unexpected message was received from our peer" |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3520 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3521 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3522 | run_test "Renegotiation: server-initiated, client-accepted, delay 0" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3523 | "$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] | 3524 | renego_delay=0 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3525 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
Manuel Pégourié-Gonnard | fae355e | 2014-07-04 14:32:27 +0200 | [diff] [blame] | 3526 | 0 \ |
| 3527 | -c "client hello, adding renegotiation extension" \ |
| 3528 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3529 | -s "found renegotiation extension" \ |
| 3530 | -s "server hello, secure renegotiation extension" \ |
| 3531 | -c "found renegotiation extension" \ |
| 3532 | -c "=> renegotiate" \ |
| 3533 | -s "=> renegotiate" \ |
| 3534 | -s "write hello request" \ |
| 3535 | -S "SSL - An unexpected message was received from our peer" \ |
| 3536 | -S "failed" |
| 3537 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3538 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3539 | run_test "Renegotiation: periodic, just below period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3540 | "$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] | 3541 | "$P_CLI debug_level=3 exchanges=2 renegotiation=1" \ |
| 3542 | 0 \ |
| 3543 | -C "client hello, adding renegotiation extension" \ |
| 3544 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3545 | -S "found renegotiation extension" \ |
| 3546 | -s "server hello, secure renegotiation extension" \ |
| 3547 | -c "found renegotiation extension" \ |
| 3548 | -S "record counter limit reached: renegotiate" \ |
| 3549 | -C "=> renegotiate" \ |
| 3550 | -S "=> renegotiate" \ |
| 3551 | -S "write hello request" \ |
| 3552 | -S "SSL - An unexpected message was received from our peer" \ |
| 3553 | -S "failed" |
| 3554 | |
Manuel Pégourié-Gonnard | 9835bc0 | 2015-01-14 14:41:58 +0100 | [diff] [blame] | 3555 | # one extra exchange to be able to complete renego |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3556 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3557 | run_test "Renegotiation: periodic, just above period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3558 | "$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] | 3559 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3560 | 0 \ |
| 3561 | -c "client hello, adding renegotiation extension" \ |
| 3562 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3563 | -s "found renegotiation extension" \ |
| 3564 | -s "server hello, secure renegotiation extension" \ |
| 3565 | -c "found renegotiation extension" \ |
| 3566 | -s "record counter limit reached: renegotiate" \ |
| 3567 | -c "=> renegotiate" \ |
| 3568 | -s "=> renegotiate" \ |
| 3569 | -s "write hello request" \ |
| 3570 | -S "SSL - An unexpected message was received from our peer" \ |
| 3571 | -S "failed" |
| 3572 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3573 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3574 | run_test "Renegotiation: periodic, two times period" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3575 | "$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] | 3576 | "$P_CLI debug_level=3 exchanges=7 renegotiation=1" \ |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3577 | 0 \ |
| 3578 | -c "client hello, adding renegotiation extension" \ |
| 3579 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3580 | -s "found renegotiation extension" \ |
| 3581 | -s "server hello, secure renegotiation extension" \ |
| 3582 | -c "found renegotiation extension" \ |
| 3583 | -s "record counter limit reached: renegotiate" \ |
| 3584 | -c "=> renegotiate" \ |
| 3585 | -s "=> renegotiate" \ |
| 3586 | -s "write hello request" \ |
| 3587 | -S "SSL - An unexpected message was received from our peer" \ |
| 3588 | -S "failed" |
| 3589 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3590 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 590f416 | 2014-11-05 14:23:03 +0100 | [diff] [blame] | 3591 | run_test "Renegotiation: periodic, above period, disabled" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3592 | "$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] | 3593 | "$P_CLI debug_level=3 exchanges=4 renegotiation=1" \ |
| 3594 | 0 \ |
| 3595 | -C "client hello, adding renegotiation extension" \ |
| 3596 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3597 | -S "found renegotiation extension" \ |
| 3598 | -s "server hello, secure renegotiation extension" \ |
| 3599 | -c "found renegotiation extension" \ |
| 3600 | -S "record counter limit reached: renegotiate" \ |
| 3601 | -C "=> renegotiate" \ |
| 3602 | -S "=> renegotiate" \ |
| 3603 | -S "write hello request" \ |
| 3604 | -S "SSL - An unexpected message was received from our peer" \ |
| 3605 | -S "failed" |
| 3606 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3607 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3608 | run_test "Renegotiation: nbio, client-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3609 | "$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] | 3610 | "$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] | 3611 | 0 \ |
| 3612 | -c "client hello, adding renegotiation extension" \ |
| 3613 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3614 | -s "found renegotiation extension" \ |
| 3615 | -s "server hello, secure renegotiation extension" \ |
| 3616 | -c "found renegotiation extension" \ |
| 3617 | -c "=> renegotiate" \ |
| 3618 | -s "=> renegotiate" \ |
| 3619 | -S "write hello request" |
| 3620 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3621 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3622 | run_test "Renegotiation: nbio, server-initiated" \ |
Manuel Pégourié-Gonnard | fa44f20 | 2015-03-27 17:52:25 +0100 | [diff] [blame] | 3623 | "$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] | 3624 | "$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] | 3625 | 0 \ |
| 3626 | -c "client hello, adding renegotiation extension" \ |
| 3627 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3628 | -s "found renegotiation extension" \ |
| 3629 | -s "server hello, secure renegotiation extension" \ |
| 3630 | -c "found renegotiation extension" \ |
| 3631 | -c "=> renegotiate" \ |
| 3632 | -s "=> renegotiate" \ |
| 3633 | -s "write hello request" |
| 3634 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3635 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3636 | run_test "Renegotiation: openssl server, client-initiated" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 3637 | "$O_SRV -www" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3638 | "$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] | 3639 | 0 \ |
| 3640 | -c "client hello, adding renegotiation extension" \ |
| 3641 | -c "found renegotiation extension" \ |
| 3642 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3643 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3644 | -C "error" \ |
| 3645 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3646 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3647 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3648 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3649 | run_test "Renegotiation: gnutls server strict, client-initiated" \ |
| 3650 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3651 | "$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] | 3652 | 0 \ |
| 3653 | -c "client hello, adding renegotiation extension" \ |
| 3654 | -c "found renegotiation extension" \ |
| 3655 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3656 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 5136296 | 2014-08-30 21:22:47 +0200 | [diff] [blame] | 3657 | -C "error" \ |
| 3658 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3659 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3660 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3661 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3662 | run_test "Renegotiation: gnutls server unsafe, client-initiated default" \ |
| 3663 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3664 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3665 | 1 \ |
| 3666 | -c "client hello, adding renegotiation extension" \ |
| 3667 | -C "found renegotiation extension" \ |
| 3668 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3669 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3670 | -c "error" \ |
| 3671 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3672 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3673 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3674 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3675 | run_test "Renegotiation: gnutls server unsafe, client-inititated no legacy" \ |
| 3676 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3677 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3678 | allow_legacy=0" \ |
| 3679 | 1 \ |
| 3680 | -c "client hello, adding renegotiation extension" \ |
| 3681 | -C "found renegotiation extension" \ |
| 3682 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3683 | -c "mbedtls_ssl_handshake() returned" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3684 | -c "error" \ |
| 3685 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3686 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3687 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3688 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3689 | run_test "Renegotiation: gnutls server unsafe, client-inititated legacy" \ |
| 3690 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3691 | "$P_CLI debug_level=3 exchanges=1 renegotiation=1 renegotiate=1 \ |
| 3692 | allow_legacy=1" \ |
| 3693 | 0 \ |
| 3694 | -c "client hello, adding renegotiation extension" \ |
| 3695 | -C "found renegotiation extension" \ |
| 3696 | -c "=> renegotiate" \ |
| 3697 | -C "ssl_hanshake() returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3698 | -C "error" \ |
| 3699 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3700 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3701 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 30d16eb | 2014-08-19 17:43:50 +0200 | [diff] [blame] | 3702 | run_test "Renegotiation: DTLS, client-initiated" \ |
| 3703 | "$P_SRV debug_level=3 dtls=1 exchanges=2 renegotiation=1" \ |
| 3704 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 renegotiate=1" \ |
| 3705 | 0 \ |
| 3706 | -c "client hello, adding renegotiation extension" \ |
| 3707 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3708 | -s "found renegotiation extension" \ |
| 3709 | -s "server hello, secure renegotiation extension" \ |
| 3710 | -c "found renegotiation extension" \ |
| 3711 | -c "=> renegotiate" \ |
| 3712 | -s "=> renegotiate" \ |
| 3713 | -S "write hello request" |
| 3714 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3715 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3716 | run_test "Renegotiation: DTLS, server-initiated" \ |
| 3717 | "$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] | 3718 | "$P_CLI debug_level=3 dtls=1 exchanges=2 renegotiation=1 \ |
| 3719 | read_timeout=1000 max_resend=2" \ |
Manuel Pégourié-Gonnard | c392b24 | 2014-08-19 17:53:11 +0200 | [diff] [blame] | 3720 | 0 \ |
| 3721 | -c "client hello, adding renegotiation extension" \ |
| 3722 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3723 | -s "found renegotiation extension" \ |
| 3724 | -s "server hello, secure renegotiation extension" \ |
| 3725 | -c "found renegotiation extension" \ |
| 3726 | -c "=> renegotiate" \ |
| 3727 | -s "=> renegotiate" \ |
| 3728 | -s "write hello request" |
| 3729 | |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3730 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3731 | run_test "Renegotiation: DTLS, renego_period overflow" \ |
| 3732 | "$P_SRV debug_level=3 dtls=1 exchanges=4 renegotiation=1 renego_period=18446462598732840962 auth_mode=optional" \ |
| 3733 | "$P_CLI debug_level=3 dtls=1 exchanges=4 renegotiation=1" \ |
| 3734 | 0 \ |
| 3735 | -c "client hello, adding renegotiation extension" \ |
| 3736 | -s "received TLS_EMPTY_RENEGOTIATION_INFO" \ |
| 3737 | -s "found renegotiation extension" \ |
| 3738 | -s "server hello, secure renegotiation extension" \ |
| 3739 | -s "record counter limit reached: renegotiate" \ |
| 3740 | -c "=> renegotiate" \ |
| 3741 | -s "=> renegotiate" \ |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3742 | -s "write hello request" |
Andres AG | 692ad84 | 2017-01-19 16:30:57 +0000 | [diff] [blame] | 3743 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 3744 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 3745 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3746 | run_test "Renegotiation: DTLS, gnutls server, client-initiated" \ |
| 3747 | "$G_SRV -u --mtu 4096" \ |
| 3748 | "$P_CLI debug_level=3 dtls=1 exchanges=1 renegotiation=1 renegotiate=1" \ |
| 3749 | 0 \ |
| 3750 | -c "client hello, adding renegotiation extension" \ |
| 3751 | -c "found renegotiation extension" \ |
| 3752 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 3753 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | f1499f6 | 2014-08-31 17:13:13 +0200 | [diff] [blame] | 3754 | -C "error" \ |
| 3755 | -s "Extra-header:" |
| 3756 | |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3757 | # Test for the "secure renegotation" extension only (no actual renegotiation) |
| 3758 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3759 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3760 | run_test "Renego ext: gnutls server strict, client default" \ |
| 3761 | "$G_SRV --priority=NORMAL:%SAFE_RENEGOTIATION" \ |
| 3762 | "$P_CLI debug_level=3" \ |
| 3763 | 0 \ |
| 3764 | -c "found renegotiation extension" \ |
| 3765 | -C "error" \ |
| 3766 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3767 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3768 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3769 | run_test "Renego ext: gnutls server unsafe, client default" \ |
| 3770 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3771 | "$P_CLI debug_level=3" \ |
| 3772 | 0 \ |
| 3773 | -C "found renegotiation extension" \ |
| 3774 | -C "error" \ |
| 3775 | -c "HTTP/1.0 200 [Oo][Kk]" |
| 3776 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3777 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3778 | run_test "Renego ext: gnutls server unsafe, client break legacy" \ |
| 3779 | "$G_SRV --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION" \ |
| 3780 | "$P_CLI debug_level=3 allow_legacy=-1" \ |
| 3781 | 1 \ |
| 3782 | -C "found renegotiation extension" \ |
| 3783 | -c "error" \ |
| 3784 | -C "HTTP/1.0 200 [Oo][Kk]" |
| 3785 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3786 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3787 | run_test "Renego ext: gnutls client strict, server default" \ |
| 3788 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3789 | "$G_CLI --priority=NORMAL:%SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3790 | 0 \ |
| 3791 | -s "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3792 | -s "server hello, secure renegotiation extension" |
| 3793 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3794 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3795 | run_test "Renego ext: gnutls client unsafe, server default" \ |
| 3796 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3797 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3798 | 0 \ |
| 3799 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3800 | -S "server hello, secure renegotiation extension" |
| 3801 | |
Paul Bakker | 539d972 | 2015-02-08 16:18:35 +0100 | [diff] [blame] | 3802 | requires_gnutls |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3803 | run_test "Renego ext: gnutls client unsafe, server break legacy" \ |
| 3804 | "$P_SRV debug_level=3 allow_legacy=-1" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3805 | "$G_CLI --priority=NORMAL:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Manuel Pégourié-Gonnard | 85d915b | 2014-11-03 20:10:36 +0100 | [diff] [blame] | 3806 | 1 \ |
| 3807 | -S "received TLS_EMPTY_RENEGOTIATION_INFO\|found renegotiation extension" \ |
| 3808 | -S "server hello, secure renegotiation extension" |
| 3809 | |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3810 | # Tests for silently dropping trailing extra bytes in .der certificates |
| 3811 | |
| 3812 | requires_gnutls |
| 3813 | run_test "DER format: no trailing bytes" \ |
| 3814 | "$P_SRV crt_file=data_files/server5-der0.crt \ |
| 3815 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3816 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3817 | 0 \ |
| 3818 | -c "Handshake was completed" \ |
| 3819 | |
| 3820 | requires_gnutls |
| 3821 | run_test "DER format: with a trailing zero byte" \ |
| 3822 | "$P_SRV crt_file=data_files/server5-der1a.crt \ |
| 3823 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3824 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3825 | 0 \ |
| 3826 | -c "Handshake was completed" \ |
| 3827 | |
| 3828 | requires_gnutls |
| 3829 | run_test "DER format: with a trailing random byte" \ |
| 3830 | "$P_SRV crt_file=data_files/server5-der1b.crt \ |
| 3831 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3832 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3833 | 0 \ |
| 3834 | -c "Handshake was completed" \ |
| 3835 | |
| 3836 | requires_gnutls |
| 3837 | run_test "DER format: with 2 trailing random bytes" \ |
| 3838 | "$P_SRV crt_file=data_files/server5-der2.crt \ |
| 3839 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3840 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3841 | 0 \ |
| 3842 | -c "Handshake was completed" \ |
| 3843 | |
| 3844 | requires_gnutls |
| 3845 | run_test "DER format: with 4 trailing random bytes" \ |
| 3846 | "$P_SRV crt_file=data_files/server5-der4.crt \ |
| 3847 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3848 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3849 | 0 \ |
| 3850 | -c "Handshake was completed" \ |
| 3851 | |
| 3852 | requires_gnutls |
| 3853 | run_test "DER format: with 8 trailing random bytes" \ |
| 3854 | "$P_SRV crt_file=data_files/server5-der8.crt \ |
| 3855 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3856 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3857 | 0 \ |
| 3858 | -c "Handshake was completed" \ |
| 3859 | |
| 3860 | requires_gnutls |
| 3861 | run_test "DER format: with 9 trailing random bytes" \ |
| 3862 | "$P_SRV crt_file=data_files/server5-der9.crt \ |
| 3863 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 3864 | "$G_CLI localhost" \ |
Janos Follath | 0b24234 | 2016-02-17 10:11:21 +0000 | [diff] [blame] | 3865 | 0 \ |
| 3866 | -c "Handshake was completed" \ |
| 3867 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 3868 | # Tests for auth_mode, there are duplicated tests using ca callback for authentication |
| 3869 | # When updating these tests, modify the matching authentication tests accordingly |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3870 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3871 | run_test "Authentication: server badcert, client required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3872 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3873 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3874 | "$P_CLI debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3875 | 1 \ |
| 3876 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3877 | -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] | 3878 | -c "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3879 | -c "X509 - Certificate verification failed" |
| 3880 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3881 | run_test "Authentication: server badcert, client optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3882 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 3883 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3884 | "$P_CLI debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3885 | 0 \ |
| 3886 | -c "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3887 | -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] | 3888 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3889 | -C "X509 - Certificate verification failed" |
| 3890 | |
Hanno Becker | e6706e6 | 2017-05-15 16:05:15 +0100 | [diff] [blame] | 3891 | run_test "Authentication: server goodcert, client optional, no trusted CA" \ |
| 3892 | "$P_SRV" \ |
| 3893 | "$P_CLI debug_level=3 auth_mode=optional ca_file=none ca_path=none" \ |
| 3894 | 0 \ |
| 3895 | -c "x509_verify_cert() returned" \ |
| 3896 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3897 | -c "! Certificate verification flags"\ |
| 3898 | -C "! mbedtls_ssl_handshake returned" \ |
| 3899 | -C "X509 - Certificate verification failed" \ |
| 3900 | -C "SSL - No CA Chain is set, but required to operate" |
| 3901 | |
| 3902 | run_test "Authentication: server goodcert, client required, no trusted CA" \ |
| 3903 | "$P_SRV" \ |
| 3904 | "$P_CLI debug_level=3 auth_mode=required ca_file=none ca_path=none" \ |
| 3905 | 1 \ |
| 3906 | -c "x509_verify_cert() returned" \ |
| 3907 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 3908 | -c "! Certificate verification flags"\ |
| 3909 | -c "! mbedtls_ssl_handshake returned" \ |
| 3910 | -c "SSL - No CA Chain is set, but required to operate" |
| 3911 | |
| 3912 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 3913 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 3914 | # the client informs the server about the supported curves - it does, though, in the |
| 3915 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 3916 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 3917 | # different means to have the server ignoring the client's supported curve list. |
| 3918 | |
| 3919 | requires_config_enabled MBEDTLS_ECP_C |
| 3920 | run_test "Authentication: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 3921 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3922 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3923 | "$P_CLI debug_level=3 auth_mode=required curves=secp521r1" \ |
| 3924 | 1 \ |
| 3925 | -c "bad certificate (EC key curve)"\ |
| 3926 | -c "! Certificate verification flags"\ |
| 3927 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 3928 | |
| 3929 | requires_config_enabled MBEDTLS_ECP_C |
| 3930 | run_test "Authentication: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 3931 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 3932 | crt_file=data_files/server5.ku-ka.crt" \ |
| 3933 | "$P_CLI debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 3934 | 1 \ |
| 3935 | -c "bad certificate (EC key curve)"\ |
| 3936 | -c "! Certificate verification flags"\ |
| 3937 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 3938 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3939 | run_test "Authentication: server badcert, client none" \ |
Manuel Pégourié-Gonnard | c1da664 | 2014-02-25 14:18:30 +0100 | [diff] [blame] | 3940 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3941 | key_file=data_files/server5.key" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3942 | "$P_CLI debug_level=1 auth_mode=none" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3943 | 0 \ |
| 3944 | -C "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 3945 | -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] | 3946 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 3947 | -C "X509 - Certificate verification failed" |
| 3948 | |
Simon Butcher | 9900014 | 2016-10-13 17:21:01 +0100 | [diff] [blame] | 3949 | run_test "Authentication: client SHA256, server required" \ |
| 3950 | "$P_SRV auth_mode=required" \ |
| 3951 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3952 | key_file=data_files/server6.key \ |
| 3953 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 3954 | 0 \ |
| 3955 | -c "Supported Signature Algorithm found: 4," \ |
| 3956 | -c "Supported Signature Algorithm found: 5," |
| 3957 | |
| 3958 | run_test "Authentication: client SHA384, server required" \ |
| 3959 | "$P_SRV auth_mode=required" \ |
| 3960 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 3961 | key_file=data_files/server6.key \ |
| 3962 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 3963 | 0 \ |
| 3964 | -c "Supported Signature Algorithm found: 4," \ |
| 3965 | -c "Supported Signature Algorithm found: 5," |
| 3966 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 3967 | run_test "Authentication: client has no cert, server required (TLS)" \ |
| 3968 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3969 | "$P_CLI debug_level=3 crt_file=none \ |
| 3970 | key_file=data_files/server5.key" \ |
| 3971 | 1 \ |
| 3972 | -S "skip write certificate request" \ |
| 3973 | -C "skip parse certificate request" \ |
| 3974 | -c "got a certificate request" \ |
| 3975 | -c "= write certificate$" \ |
| 3976 | -C "skip write certificate$" \ |
| 3977 | -S "x509_verify_cert() returned" \ |
| 3978 | -s "client has no certificate" \ |
| 3979 | -s "! mbedtls_ssl_handshake returned" \ |
| 3980 | -c "! mbedtls_ssl_handshake returned" \ |
| 3981 | -s "No client certification received from the client, but required by the authentication mode" |
| 3982 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 3983 | run_test "Authentication: client badcert, server required" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 3984 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 3985 | "$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] | 3986 | key_file=data_files/server5.key" \ |
| 3987 | 1 \ |
| 3988 | -S "skip write certificate request" \ |
| 3989 | -C "skip parse certificate request" \ |
| 3990 | -c "got a certificate request" \ |
| 3991 | -C "skip write certificate" \ |
| 3992 | -C "skip write certificate verify" \ |
| 3993 | -S "skip parse certificate verify" \ |
| 3994 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 3995 | -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] | 3996 | -s "! mbedtls_ssl_handshake returned" \ |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 3997 | -s "send alert level=2 message=48" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 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" |
Gilles Peskine | 1cc8e34 | 2017-05-03 16:28:34 +0200 | [diff] [blame] | 4000 | # We don't check that the client receives the alert because it might |
| 4001 | # detect that its write end of the connection is closed and abort |
| 4002 | # before reading the alert message. |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4003 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4004 | run_test "Authentication: client cert not trusted, server required" \ |
| 4005 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4006 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4007 | key_file=data_files/server5.key" \ |
| 4008 | 1 \ |
| 4009 | -S "skip write certificate request" \ |
| 4010 | -C "skip parse certificate request" \ |
| 4011 | -c "got a certificate request" \ |
| 4012 | -C "skip write certificate" \ |
| 4013 | -C "skip write certificate verify" \ |
| 4014 | -S "skip parse certificate verify" \ |
| 4015 | -s "x509_verify_cert() returned" \ |
| 4016 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4017 | -s "! mbedtls_ssl_handshake returned" \ |
| 4018 | -c "! mbedtls_ssl_handshake returned" \ |
| 4019 | -s "X509 - Certificate verification failed" |
| 4020 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4021 | run_test "Authentication: client badcert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4022 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4023 | "$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] | 4024 | key_file=data_files/server5.key" \ |
| 4025 | 0 \ |
| 4026 | -S "skip write certificate request" \ |
| 4027 | -C "skip parse certificate request" \ |
| 4028 | -c "got a certificate request" \ |
| 4029 | -C "skip write certificate" \ |
| 4030 | -C "skip write certificate verify" \ |
| 4031 | -S "skip parse certificate verify" \ |
| 4032 | -s "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4033 | -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] | 4034 | -S "! mbedtls_ssl_handshake returned" \ |
| 4035 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4036 | -S "X509 - Certificate verification failed" |
| 4037 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4038 | run_test "Authentication: client badcert, server none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4039 | "$P_SRV debug_level=3 auth_mode=none" \ |
| 4040 | "$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] | 4041 | key_file=data_files/server5.key" \ |
| 4042 | 0 \ |
| 4043 | -s "skip write certificate request" \ |
| 4044 | -C "skip parse certificate request" \ |
| 4045 | -c "got no certificate request" \ |
| 4046 | -c "skip write certificate" \ |
| 4047 | -c "skip write certificate verify" \ |
| 4048 | -s "skip parse certificate verify" \ |
| 4049 | -S "x509_verify_cert() returned" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4050 | -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] | 4051 | -S "! mbedtls_ssl_handshake returned" \ |
| 4052 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 4053 | -S "X509 - Certificate verification failed" |
| 4054 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4055 | run_test "Authentication: client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4056 | "$P_SRV debug_level=3 auth_mode=optional" \ |
| 4057 | "$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] | 4058 | 0 \ |
| 4059 | -S "skip write certificate request" \ |
| 4060 | -C "skip parse certificate request" \ |
| 4061 | -c "got a certificate request" \ |
| 4062 | -C "skip write certificate$" \ |
| 4063 | -C "got no certificate to send" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4064 | -c "skip write certificate verify" \ |
| 4065 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4066 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4067 | -S "! mbedtls_ssl_handshake returned" \ |
| 4068 | -C "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4069 | -S "X509 - Certificate verification failed" |
| 4070 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4071 | run_test "Authentication: openssl client no cert, server optional" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4072 | "$P_SRV debug_level=3 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4073 | "$O_CLI" \ |
| 4074 | 0 \ |
| 4075 | -S "skip write certificate request" \ |
| 4076 | -s "skip parse certificate verify" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 4077 | -s "! Certificate was missing" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4078 | -S "! mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4079 | -S "X509 - Certificate verification failed" |
| 4080 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4081 | run_test "Authentication: client no cert, openssl server optional" \ |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4082 | "$O_SRV -verify 10" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4083 | "$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] | 4084 | 0 \ |
| 4085 | -C "skip parse certificate request" \ |
| 4086 | -c "got a certificate request" \ |
| 4087 | -C "skip write certificate$" \ |
| 4088 | -c "skip write certificate verify" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4089 | -C "! mbedtls_ssl_handshake returned" |
Manuel Pégourié-Gonnard | de515cc | 2014-02-27 14:58:26 +0100 | [diff] [blame] | 4090 | |
Gilles Peskine | fd8332e | 2017-05-03 16:25:07 +0200 | [diff] [blame] | 4091 | run_test "Authentication: client no cert, openssl server required" \ |
| 4092 | "$O_SRV -Verify 10" \ |
| 4093 | "$P_CLI debug_level=3 crt_file=none key_file=none" \ |
| 4094 | 1 \ |
| 4095 | -C "skip parse certificate request" \ |
| 4096 | -c "got a certificate request" \ |
| 4097 | -C "skip write certificate$" \ |
| 4098 | -c "skip write certificate verify" \ |
| 4099 | -c "! mbedtls_ssl_handshake returned" |
| 4100 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4101 | # This script assumes that MBEDTLS_X509_MAX_INTERMEDIATE_CA has its default |
| 4102 | # value, defined here as MAX_IM_CA. Some test cases will be skipped if the |
| 4103 | # library is configured with a different value. |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4104 | |
Simon Butcher | bcfa6f4 | 2017-07-28 15:59:35 +0100 | [diff] [blame] | 4105 | MAX_IM_CA='8' |
Hanno Becker | a6bca9f | 2017-07-26 13:35:11 +0100 | [diff] [blame] | 4106 | |
Yuto Takano | 0248582 | 2021-07-02 13:05:15 +0100 | [diff] [blame] | 4107 | # The tests for the max_int tests can pass with any number higher than MAX_IM_CA |
| 4108 | # because only a chain of MAX_IM_CA length is tested. Equally, the max_int+1 |
| 4109 | # tests can pass with any number less than MAX_IM_CA. However, stricter preconditions |
| 4110 | # 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] | 4111 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4112 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4113 | run_test "Authentication: server max_int chain, client default" \ |
| 4114 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4115 | key_file=data_files/dir-maxpath/09.key" \ |
| 4116 | "$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4117 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4118 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4119 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4120 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4121 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4122 | run_test "Authentication: server max_int+1 chain, client default" \ |
| 4123 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4124 | key_file=data_files/dir-maxpath/10.key" \ |
| 4125 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4126 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4127 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4128 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4129 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4130 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4131 | run_test "Authentication: server max_int+1 chain, client optional" \ |
| 4132 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4133 | key_file=data_files/dir-maxpath/10.key" \ |
| 4134 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4135 | auth_mode=optional" \ |
| 4136 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4137 | -c "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4138 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4139 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4140 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4141 | run_test "Authentication: server max_int+1 chain, client none" \ |
| 4142 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4143 | key_file=data_files/dir-maxpath/10.key" \ |
| 4144 | "$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4145 | auth_mode=none" \ |
| 4146 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4147 | -C "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4148 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4149 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4150 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4151 | run_test "Authentication: client max_int+1 chain, server default" \ |
| 4152 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt" \ |
| 4153 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4154 | key_file=data_files/dir-maxpath/10.key" \ |
| 4155 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4156 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4157 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4158 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4159 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4160 | run_test "Authentication: client max_int+1 chain, server optional" \ |
| 4161 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4162 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4163 | key_file=data_files/dir-maxpath/10.key" \ |
| 4164 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4165 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4166 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4167 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4168 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4169 | run_test "Authentication: client max_int+1 chain, server required" \ |
| 4170 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4171 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4172 | key_file=data_files/dir-maxpath/10.key" \ |
| 4173 | 1 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4174 | -s "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4175 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4176 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 4177 | requires_full_size_output_buffer |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4178 | run_test "Authentication: client max_int chain, server required" \ |
| 4179 | "$P_SRV ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4180 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4181 | key_file=data_files/dir-maxpath/09.key" \ |
| 4182 | 0 \ |
Antonin Décimo | 36e89b5 | 2019-01-23 15:24:37 +0100 | [diff] [blame] | 4183 | -S "X509 - A fatal error occurred" |
Manuel Pégourié-Gonnard | 81bb6b6 | 2017-06-26 10:45:33 +0200 | [diff] [blame] | 4184 | |
Janos Follath | 89baba2 | 2017-04-10 14:34:35 +0100 | [diff] [blame] | 4185 | # Tests for CA list in CertificateRequest messages |
| 4186 | |
| 4187 | run_test "Authentication: send CA list in CertificateRequest (default)" \ |
| 4188 | "$P_SRV debug_level=3 auth_mode=required" \ |
| 4189 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4190 | key_file=data_files/server6.key" \ |
| 4191 | 0 \ |
| 4192 | -s "requested DN" |
| 4193 | |
| 4194 | run_test "Authentication: do not send CA list in CertificateRequest" \ |
| 4195 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4196 | "$P_CLI crt_file=data_files/server6.crt \ |
| 4197 | key_file=data_files/server6.key" \ |
| 4198 | 0 \ |
| 4199 | -S "requested DN" |
| 4200 | |
| 4201 | run_test "Authentication: send CA list in CertificateRequest, client self signed" \ |
| 4202 | "$P_SRV debug_level=3 auth_mode=required cert_req_ca_list=0" \ |
| 4203 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4204 | key_file=data_files/server5.key" \ |
| 4205 | 1 \ |
| 4206 | -S "requested DN" \ |
| 4207 | -s "x509_verify_cert() returned" \ |
| 4208 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4209 | -s "! mbedtls_ssl_handshake returned" \ |
| 4210 | -c "! mbedtls_ssl_handshake returned" \ |
| 4211 | -s "X509 - Certificate verification failed" |
| 4212 | |
Jarno Lamsa | f7a7f9e | 2019-04-01 15:11:54 +0300 | [diff] [blame] | 4213 | # Tests for auth_mode, using CA callback, these are duplicated from the authentication tests |
| 4214 | # When updating these tests, modify the matching authentication tests accordingly |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4215 | |
| 4216 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4217 | run_test "Authentication, CA callback: server badcert, client required" \ |
| 4218 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4219 | key_file=data_files/server5.key" \ |
| 4220 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4221 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4222 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4223 | -c "x509_verify_cert() returned" \ |
| 4224 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4225 | -c "! mbedtls_ssl_handshake returned" \ |
| 4226 | -c "X509 - Certificate verification failed" |
| 4227 | |
| 4228 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4229 | run_test "Authentication, CA callback: server badcert, client optional" \ |
| 4230 | "$P_SRV crt_file=data_files/server5-badsign.crt \ |
| 4231 | key_file=data_files/server5.key" \ |
| 4232 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4233 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4234 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4235 | -c "x509_verify_cert() returned" \ |
| 4236 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 4237 | -C "! mbedtls_ssl_handshake returned" \ |
| 4238 | -C "X509 - Certificate verification failed" |
| 4239 | |
| 4240 | # The purpose of the next two tests is to test the client's behaviour when receiving a server |
| 4241 | # certificate with an unsupported elliptic curve. This should usually not happen because |
| 4242 | # the client informs the server about the supported curves - it does, though, in the |
| 4243 | # corner case of a static ECDH suite, because the server doesn't check the curve on that |
| 4244 | # occasion (to be fixed). If that bug's fixed, the test needs to be altered to use a |
| 4245 | # different means to have the server ignoring the client's supported curve list. |
| 4246 | |
| 4247 | requires_config_enabled MBEDTLS_ECP_C |
| 4248 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4249 | run_test "Authentication, CA callback: server ECDH p256v1, client required, p256v1 unsupported" \ |
| 4250 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4251 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4252 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=required curves=secp521r1" \ |
| 4253 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4254 | -c "use CA callback for X.509 CRT verification" \ |
| 4255 | -c "bad certificate (EC key curve)" \ |
| 4256 | -c "! Certificate verification flags" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4257 | -C "bad server certificate (ECDH curve)" # Expect failure at earlier verification stage |
| 4258 | |
| 4259 | requires_config_enabled MBEDTLS_ECP_C |
| 4260 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4261 | run_test "Authentication, CA callback: server ECDH p256v1, client optional, p256v1 unsupported" \ |
| 4262 | "$P_SRV debug_level=1 key_file=data_files/server5.key \ |
| 4263 | crt_file=data_files/server5.ku-ka.crt" \ |
| 4264 | "$P_CLI ca_callback=1 debug_level=3 auth_mode=optional curves=secp521r1" \ |
| 4265 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4266 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4267 | -c "bad certificate (EC key curve)"\ |
| 4268 | -c "! Certificate verification flags"\ |
| 4269 | -c "bad server certificate (ECDH curve)" # Expect failure only at ECDH params check |
| 4270 | |
| 4271 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4272 | run_test "Authentication, CA callback: client SHA256, server required" \ |
| 4273 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4274 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4275 | key_file=data_files/server6.key \ |
| 4276 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384" \ |
| 4277 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4278 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4279 | -c "Supported Signature Algorithm found: 4," \ |
| 4280 | -c "Supported Signature Algorithm found: 5," |
| 4281 | |
| 4282 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4283 | run_test "Authentication, CA callback: client SHA384, server required" \ |
| 4284 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4285 | "$P_CLI debug_level=3 crt_file=data_files/server6.crt \ |
| 4286 | key_file=data_files/server6.key \ |
| 4287 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256" \ |
| 4288 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4289 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4290 | -c "Supported Signature Algorithm found: 4," \ |
| 4291 | -c "Supported Signature Algorithm found: 5," |
| 4292 | |
| 4293 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4294 | run_test "Authentication, CA callback: client badcert, server required" \ |
| 4295 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4296 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4297 | key_file=data_files/server5.key" \ |
| 4298 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4299 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4300 | -S "skip write certificate request" \ |
| 4301 | -C "skip parse certificate request" \ |
| 4302 | -c "got a certificate request" \ |
| 4303 | -C "skip write certificate" \ |
| 4304 | -C "skip write certificate verify" \ |
| 4305 | -S "skip parse certificate verify" \ |
| 4306 | -s "x509_verify_cert() returned" \ |
| 4307 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4308 | -s "! mbedtls_ssl_handshake returned" \ |
| 4309 | -s "send alert level=2 message=48" \ |
| 4310 | -c "! mbedtls_ssl_handshake returned" \ |
| 4311 | -s "X509 - Certificate verification failed" |
| 4312 | # We don't check that the client receives the alert because it might |
| 4313 | # detect that its write end of the connection is closed and abort |
| 4314 | # before reading the alert message. |
| 4315 | |
| 4316 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4317 | run_test "Authentication, CA callback: client cert not trusted, server required" \ |
| 4318 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=required" \ |
| 4319 | "$P_CLI debug_level=3 crt_file=data_files/server5-selfsigned.crt \ |
| 4320 | key_file=data_files/server5.key" \ |
| 4321 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4322 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4323 | -S "skip write certificate request" \ |
| 4324 | -C "skip parse certificate request" \ |
| 4325 | -c "got a certificate request" \ |
| 4326 | -C "skip write certificate" \ |
| 4327 | -C "skip write certificate verify" \ |
| 4328 | -S "skip parse certificate verify" \ |
| 4329 | -s "x509_verify_cert() returned" \ |
| 4330 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4331 | -s "! mbedtls_ssl_handshake returned" \ |
| 4332 | -c "! mbedtls_ssl_handshake returned" \ |
| 4333 | -s "X509 - Certificate verification failed" |
| 4334 | |
| 4335 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4336 | run_test "Authentication, CA callback: client badcert, server optional" \ |
| 4337 | "$P_SRV ca_callback=1 debug_level=3 auth_mode=optional" \ |
| 4338 | "$P_CLI debug_level=3 crt_file=data_files/server5-badsign.crt \ |
| 4339 | key_file=data_files/server5.key" \ |
| 4340 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4341 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4342 | -S "skip write certificate request" \ |
| 4343 | -C "skip parse certificate request" \ |
| 4344 | -c "got a certificate request" \ |
| 4345 | -C "skip write certificate" \ |
| 4346 | -C "skip write certificate verify" \ |
| 4347 | -S "skip parse certificate verify" \ |
| 4348 | -s "x509_verify_cert() returned" \ |
| 4349 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4350 | -S "! mbedtls_ssl_handshake returned" \ |
| 4351 | -C "! mbedtls_ssl_handshake returned" \ |
| 4352 | -S "X509 - Certificate verification failed" |
| 4353 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4354 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4355 | requires_full_size_output_buffer |
| 4356 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4357 | run_test "Authentication, CA callback: server max_int chain, client default" \ |
| 4358 | "$P_SRV crt_file=data_files/dir-maxpath/c09.pem \ |
| 4359 | key_file=data_files/dir-maxpath/09.key" \ |
| 4360 | "$P_CLI ca_callback=1 debug_level=3 server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4361 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4362 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4363 | -C "X509 - A fatal error occurred" |
| 4364 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4365 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4366 | requires_full_size_output_buffer |
| 4367 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4368 | run_test "Authentication, CA callback: server max_int+1 chain, client default" \ |
| 4369 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4370 | key_file=data_files/dir-maxpath/10.key" \ |
| 4371 | "$P_CLI debug_level=3 ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \ |
| 4372 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4373 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4374 | -c "X509 - A fatal error occurred" |
| 4375 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4376 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4377 | requires_full_size_output_buffer |
| 4378 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4379 | run_test "Authentication, CA callback: server max_int+1 chain, client optional" \ |
| 4380 | "$P_SRV crt_file=data_files/dir-maxpath/c10.pem \ |
| 4381 | key_file=data_files/dir-maxpath/10.key" \ |
| 4382 | "$P_CLI ca_callback=1 server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \ |
| 4383 | debug_level=3 auth_mode=optional" \ |
| 4384 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4385 | -c "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4386 | -c "X509 - A fatal error occurred" |
| 4387 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4388 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4389 | requires_full_size_output_buffer |
| 4390 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4391 | run_test "Authentication, CA callback: client max_int+1 chain, server optional" \ |
| 4392 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=optional" \ |
| 4393 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4394 | key_file=data_files/dir-maxpath/10.key" \ |
| 4395 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4396 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4397 | -s "X509 - A fatal error occurred" |
| 4398 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4399 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4400 | requires_full_size_output_buffer |
| 4401 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4402 | run_test "Authentication, CA callback: client max_int+1 chain, server required" \ |
| 4403 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4404 | "$P_CLI crt_file=data_files/dir-maxpath/c10.pem \ |
| 4405 | key_file=data_files/dir-maxpath/10.key" \ |
| 4406 | 1 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4407 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4408 | -s "X509 - A fatal error occurred" |
| 4409 | |
Yuto Takano | 6f65743 | 2021-07-02 13:10:41 +0100 | [diff] [blame] | 4410 | requires_config_value_equals "MBEDTLS_X509_MAX_INTERMEDIATE_CA" $MAX_IM_CA |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4411 | requires_full_size_output_buffer |
| 4412 | requires_config_enabled MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK |
| 4413 | run_test "Authentication, CA callback: client max_int chain, server required" \ |
| 4414 | "$P_SRV ca_callback=1 debug_level=3 ca_file=data_files/dir-maxpath/00.crt auth_mode=required" \ |
| 4415 | "$P_CLI crt_file=data_files/dir-maxpath/c09.pem \ |
| 4416 | key_file=data_files/dir-maxpath/09.key" \ |
| 4417 | 0 \ |
Janos Follath | d7ecbd6 | 2019-04-05 14:52:17 +0100 | [diff] [blame] | 4418 | -s "use CA callback for X.509 CRT verification" \ |
Hanno Becker | 746aaf3 | 2019-03-28 15:25:23 +0000 | [diff] [blame] | 4419 | -S "X509 - A fatal error occurred" |
| 4420 | |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4421 | # Tests for certificate selection based on SHA verson |
| 4422 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4423 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | df331a5 | 2015-01-08 16:43:07 +0100 | [diff] [blame] | 4424 | run_test "Certificate hash: client TLS 1.2 -> SHA-2" \ |
| 4425 | "$P_SRV crt_file=data_files/server5.crt \ |
| 4426 | key_file=data_files/server5.key \ |
| 4427 | crt_file2=data_files/server5-sha1.crt \ |
| 4428 | key_file2=data_files/server5.key" \ |
| 4429 | "$P_CLI force_version=tls1_2" \ |
| 4430 | 0 \ |
| 4431 | -c "signed using.*ECDSA with SHA256" \ |
| 4432 | -C "signed using.*ECDSA with SHA1" |
| 4433 | |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4434 | # tests for SNI |
| 4435 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4436 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4437 | run_test "SNI: no SNI callback" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4438 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4439 | 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] | 4440 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4441 | 0 \ |
| 4442 | -S "parse ServerName extension" \ |
| 4443 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4444 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4445 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4446 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4447 | run_test "SNI: matching cert 1" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4448 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4449 | 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] | 4450 | 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] | 4451 | "$P_CLI server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4452 | 0 \ |
| 4453 | -s "parse ServerName extension" \ |
| 4454 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4455 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4456 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4457 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4458 | run_test "SNI: matching cert 2" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4459 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4460 | 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] | 4461 | 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] | 4462 | "$P_CLI server_name=polarssl.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4463 | 0 \ |
| 4464 | -s "parse ServerName extension" \ |
| 4465 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4466 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4467 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4468 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4469 | run_test "SNI: no matching cert" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 4470 | "$P_SRV debug_level=3 \ |
Manuel Pégourié-Gonnard | 96ea2f2 | 2014-02-25 12:26:29 +0100 | [diff] [blame] | 4471 | 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] | 4472 | 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] | 4473 | "$P_CLI server_name=nonesuch.example" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4474 | 1 \ |
| 4475 | -s "parse ServerName extension" \ |
| 4476 | -s "ssl_sni_wrapper() returned" \ |
| 4477 | -s "mbedtls_ssl_handshake returned" \ |
| 4478 | -c "mbedtls_ssl_handshake returned" \ |
| 4479 | -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] | 4480 | |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4481 | run_test "SNI: client auth no override: optional" \ |
| 4482 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4483 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4484 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4485 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4486 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4487 | -S "skip write certificate request" \ |
| 4488 | -C "skip parse certificate request" \ |
| 4489 | -c "got a certificate request" \ |
| 4490 | -C "skip write certificate" \ |
| 4491 | -C "skip write certificate verify" \ |
| 4492 | -S "skip parse certificate verify" |
| 4493 | |
| 4494 | run_test "SNI: client auth override: none -> optional" \ |
| 4495 | "$P_SRV debug_level=3 auth_mode=none \ |
| 4496 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4497 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4498 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4499 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4500 | -S "skip write certificate request" \ |
| 4501 | -C "skip parse certificate request" \ |
| 4502 | -c "got a certificate request" \ |
| 4503 | -C "skip write certificate" \ |
| 4504 | -C "skip write certificate verify" \ |
| 4505 | -S "skip parse certificate verify" |
| 4506 | |
| 4507 | run_test "SNI: client auth override: optional -> none" \ |
| 4508 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4509 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4510 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4511 | "$P_CLI debug_level=3 server_name=localhost" \ |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4512 | 0 \ |
Manuel Pégourié-Gonnard | c948a79 | 2015-06-22 16:04:20 +0200 | [diff] [blame] | 4513 | -s "skip write certificate request" \ |
| 4514 | -C "skip parse certificate request" \ |
| 4515 | -c "got no certificate request" \ |
| 4516 | -c "skip write certificate" \ |
| 4517 | -c "skip write certificate verify" \ |
| 4518 | -s "skip parse certificate verify" |
| 4519 | |
Manuel Pégourié-Gonnard | 6ea831d | 2015-06-22 16:50:52 +0200 | [diff] [blame] | 4520 | run_test "SNI: CA no override" \ |
| 4521 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4522 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4523 | ca_file=data_files/test-ca.crt \ |
| 4524 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4525 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4526 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4527 | 1 \ |
| 4528 | -S "skip write certificate request" \ |
| 4529 | -C "skip parse certificate request" \ |
| 4530 | -c "got a certificate request" \ |
| 4531 | -C "skip write certificate" \ |
| 4532 | -C "skip write certificate verify" \ |
| 4533 | -S "skip parse certificate verify" \ |
| 4534 | -s "x509_verify_cert() returned" \ |
| 4535 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4536 | -S "The certificate has been revoked (is on a CRL)" |
| 4537 | |
| 4538 | run_test "SNI: CA override" \ |
| 4539 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4540 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4541 | ca_file=data_files/test-ca.crt \ |
| 4542 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4543 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4544 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4545 | 0 \ |
| 4546 | -S "skip write certificate request" \ |
| 4547 | -C "skip parse certificate request" \ |
| 4548 | -c "got a certificate request" \ |
| 4549 | -C "skip write certificate" \ |
| 4550 | -C "skip write certificate verify" \ |
| 4551 | -S "skip parse certificate verify" \ |
| 4552 | -S "x509_verify_cert() returned" \ |
| 4553 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4554 | -S "The certificate has been revoked (is on a CRL)" |
| 4555 | |
| 4556 | run_test "SNI: CA override with CRL" \ |
| 4557 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4558 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4559 | ca_file=data_files/test-ca.crt \ |
| 4560 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4561 | "$P_CLI debug_level=3 server_name=localhost \ |
| 4562 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4563 | 1 \ |
| 4564 | -S "skip write certificate request" \ |
| 4565 | -C "skip parse certificate request" \ |
| 4566 | -c "got a certificate request" \ |
| 4567 | -C "skip write certificate" \ |
| 4568 | -C "skip write certificate verify" \ |
| 4569 | -S "skip parse certificate verify" \ |
| 4570 | -s "x509_verify_cert() returned" \ |
| 4571 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4572 | -s "The certificate has been revoked (is on a CRL)" |
| 4573 | |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4574 | # Tests for SNI and DTLS |
| 4575 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4576 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4577 | run_test "SNI: DTLS, no SNI callback" \ |
| 4578 | "$P_SRV debug_level=3 dtls=1 \ |
| 4579 | crt_file=data_files/server5.crt key_file=data_files/server5.key" \ |
| 4580 | "$P_CLI server_name=localhost dtls=1" \ |
| 4581 | 0 \ |
| 4582 | -S "parse ServerName extension" \ |
| 4583 | -c "issuer name *: C=NL, O=PolarSSL, CN=Polarssl Test EC CA" \ |
| 4584 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4585 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4586 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4587 | run_test "SNI: DTLS, matching cert 1" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4588 | "$P_SRV debug_level=3 dtls=1 \ |
| 4589 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4590 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4591 | "$P_CLI server_name=localhost dtls=1" \ |
| 4592 | 0 \ |
| 4593 | -s "parse ServerName extension" \ |
| 4594 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4595 | -c "subject name *: C=NL, O=PolarSSL, CN=localhost" |
| 4596 | |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 4597 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Andres Amaya Garcia | 54306c1 | 2018-05-01 20:27:37 +0100 | [diff] [blame] | 4598 | run_test "SNI: DTLS, matching cert 2" \ |
| 4599 | "$P_SRV debug_level=3 dtls=1 \ |
| 4600 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4601 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4602 | "$P_CLI server_name=polarssl.example dtls=1" \ |
| 4603 | 0 \ |
| 4604 | -s "parse ServerName extension" \ |
| 4605 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 4606 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 4607 | |
| 4608 | run_test "SNI: DTLS, no matching cert" \ |
| 4609 | "$P_SRV debug_level=3 dtls=1 \ |
| 4610 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4611 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 4612 | "$P_CLI server_name=nonesuch.example dtls=1" \ |
| 4613 | 1 \ |
| 4614 | -s "parse ServerName extension" \ |
| 4615 | -s "ssl_sni_wrapper() returned" \ |
| 4616 | -s "mbedtls_ssl_handshake returned" \ |
| 4617 | -c "mbedtls_ssl_handshake returned" \ |
| 4618 | -c "SSL - A fatal alert message was received from our peer" |
| 4619 | |
| 4620 | run_test "SNI: DTLS, client auth no override: optional" \ |
| 4621 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4622 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4623 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-" \ |
| 4624 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4625 | 0 \ |
| 4626 | -S "skip write certificate request" \ |
| 4627 | -C "skip parse certificate request" \ |
| 4628 | -c "got a certificate request" \ |
| 4629 | -C "skip write certificate" \ |
| 4630 | -C "skip write certificate verify" \ |
| 4631 | -S "skip parse certificate verify" |
| 4632 | |
| 4633 | run_test "SNI: DTLS, client auth override: none -> optional" \ |
| 4634 | "$P_SRV debug_level=3 auth_mode=none dtls=1 \ |
| 4635 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4636 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,optional" \ |
| 4637 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4638 | 0 \ |
| 4639 | -S "skip write certificate request" \ |
| 4640 | -C "skip parse certificate request" \ |
| 4641 | -c "got a certificate request" \ |
| 4642 | -C "skip write certificate" \ |
| 4643 | -C "skip write certificate verify" \ |
| 4644 | -S "skip parse certificate verify" |
| 4645 | |
| 4646 | run_test "SNI: DTLS, client auth override: optional -> none" \ |
| 4647 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4648 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4649 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,none" \ |
| 4650 | "$P_CLI debug_level=3 server_name=localhost dtls=1" \ |
| 4651 | 0 \ |
| 4652 | -s "skip write certificate request" \ |
| 4653 | -C "skip parse certificate request" \ |
| 4654 | -c "got no certificate request" \ |
| 4655 | -c "skip write certificate" \ |
| 4656 | -c "skip write certificate verify" \ |
| 4657 | -s "skip parse certificate verify" |
| 4658 | |
| 4659 | run_test "SNI: DTLS, CA no override" \ |
| 4660 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4661 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4662 | ca_file=data_files/test-ca.crt \ |
| 4663 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,required" \ |
| 4664 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4665 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4666 | 1 \ |
| 4667 | -S "skip write certificate request" \ |
| 4668 | -C "skip parse certificate request" \ |
| 4669 | -c "got a certificate request" \ |
| 4670 | -C "skip write certificate" \ |
| 4671 | -C "skip write certificate verify" \ |
| 4672 | -S "skip parse certificate verify" \ |
| 4673 | -s "x509_verify_cert() returned" \ |
| 4674 | -s "! The certificate is not correctly signed by the trusted CA" \ |
| 4675 | -S "The certificate has been revoked (is on a CRL)" |
| 4676 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4677 | run_test "SNI: DTLS, CA override" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4678 | "$P_SRV debug_level=3 auth_mode=optional dtls=1 \ |
| 4679 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 4680 | ca_file=data_files/test-ca.crt \ |
| 4681 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,-,required" \ |
| 4682 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4683 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4684 | 0 \ |
| 4685 | -S "skip write certificate request" \ |
| 4686 | -C "skip parse certificate request" \ |
| 4687 | -c "got a certificate request" \ |
| 4688 | -C "skip write certificate" \ |
| 4689 | -C "skip write certificate verify" \ |
| 4690 | -S "skip parse certificate verify" \ |
| 4691 | -S "x509_verify_cert() returned" \ |
| 4692 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4693 | -S "The certificate has been revoked (is on a CRL)" |
| 4694 | |
Andres Amaya Garcia | f77d3d3 | 2018-05-01 20:26:47 +0100 | [diff] [blame] | 4695 | run_test "SNI: DTLS, CA override with CRL" \ |
Andres AG | 1a83445 | 2016-12-07 10:01:30 +0000 | [diff] [blame] | 4696 | "$P_SRV debug_level=3 auth_mode=optional \ |
| 4697 | crt_file=data_files/server5.crt key_file=data_files/server5.key dtls=1 \ |
| 4698 | ca_file=data_files/test-ca.crt \ |
| 4699 | sni=localhost,data_files/server2.crt,data_files/server2.key,data_files/test-ca2.crt,data_files/crl-ec-sha256.pem,required" \ |
| 4700 | "$P_CLI debug_level=3 server_name=localhost dtls=1 \ |
| 4701 | crt_file=data_files/server6.crt key_file=data_files/server6.key" \ |
| 4702 | 1 \ |
| 4703 | -S "skip write certificate request" \ |
| 4704 | -C "skip parse certificate request" \ |
| 4705 | -c "got a certificate request" \ |
| 4706 | -C "skip write certificate" \ |
| 4707 | -C "skip write certificate verify" \ |
| 4708 | -S "skip parse certificate verify" \ |
| 4709 | -s "x509_verify_cert() returned" \ |
| 4710 | -S "! The certificate is not correctly signed by the trusted CA" \ |
| 4711 | -s "The certificate has been revoked (is on a CRL)" |
| 4712 | |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4713 | # Tests for non-blocking I/O: exercise a variety of handshake flows |
| 4714 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4715 | run_test "Non-blocking I/O: basic handshake" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4716 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4717 | "$P_CLI nbio=2 tickets=0" \ |
| 4718 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4719 | -S "mbedtls_ssl_handshake returned" \ |
| 4720 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4721 | -c "Read from server: .* bytes read" |
| 4722 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4723 | run_test "Non-blocking I/O: client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4724 | "$P_SRV nbio=2 tickets=0 auth_mode=required" \ |
| 4725 | "$P_CLI nbio=2 tickets=0" \ |
| 4726 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4727 | -S "mbedtls_ssl_handshake returned" \ |
| 4728 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4729 | -c "Read from server: .* bytes read" |
| 4730 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4731 | run_test "Non-blocking I/O: ticket" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4732 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4733 | "$P_CLI nbio=2 tickets=1" \ |
| 4734 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4735 | -S "mbedtls_ssl_handshake returned" \ |
| 4736 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4737 | -c "Read from server: .* bytes read" |
| 4738 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4739 | run_test "Non-blocking I/O: ticket + client auth" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4740 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4741 | "$P_CLI nbio=2 tickets=1" \ |
| 4742 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4743 | -S "mbedtls_ssl_handshake returned" \ |
| 4744 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4745 | -c "Read from server: .* bytes read" |
| 4746 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4747 | run_test "Non-blocking I/O: ticket + client auth + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4748 | "$P_SRV nbio=2 tickets=1 auth_mode=required" \ |
| 4749 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4750 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4751 | -S "mbedtls_ssl_handshake returned" \ |
| 4752 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4753 | -c "Read from server: .* bytes read" |
| 4754 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4755 | run_test "Non-blocking I/O: ticket + resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4756 | "$P_SRV nbio=2 tickets=1 auth_mode=none" \ |
| 4757 | "$P_CLI nbio=2 tickets=1 reconnect=1" \ |
| 4758 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4759 | -S "mbedtls_ssl_handshake returned" \ |
| 4760 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4761 | -c "Read from server: .* bytes read" |
| 4762 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4763 | run_test "Non-blocking I/O: session-id resume" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4764 | "$P_SRV nbio=2 tickets=0 auth_mode=none" \ |
| 4765 | "$P_CLI nbio=2 tickets=0 reconnect=1" \ |
| 4766 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4767 | -S "mbedtls_ssl_handshake returned" \ |
| 4768 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0b6609b | 2014-02-26 14:45:12 +0100 | [diff] [blame] | 4769 | -c "Read from server: .* bytes read" |
| 4770 | |
Hanno Becker | 0007671 | 2017-11-15 16:39:08 +0000 | [diff] [blame] | 4771 | # Tests for event-driven I/O: exercise a variety of handshake flows |
| 4772 | |
| 4773 | run_test "Event-driven I/O: basic handshake" \ |
| 4774 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4775 | "$P_CLI event=1 tickets=0" \ |
| 4776 | 0 \ |
| 4777 | -S "mbedtls_ssl_handshake returned" \ |
| 4778 | -C "mbedtls_ssl_handshake returned" \ |
| 4779 | -c "Read from server: .* bytes read" |
| 4780 | |
| 4781 | run_test "Event-driven I/O: client auth" \ |
| 4782 | "$P_SRV event=1 tickets=0 auth_mode=required" \ |
| 4783 | "$P_CLI event=1 tickets=0" \ |
| 4784 | 0 \ |
| 4785 | -S "mbedtls_ssl_handshake returned" \ |
| 4786 | -C "mbedtls_ssl_handshake returned" \ |
| 4787 | -c "Read from server: .* bytes read" |
| 4788 | |
| 4789 | run_test "Event-driven I/O: ticket" \ |
| 4790 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4791 | "$P_CLI event=1 tickets=1" \ |
| 4792 | 0 \ |
| 4793 | -S "mbedtls_ssl_handshake returned" \ |
| 4794 | -C "mbedtls_ssl_handshake returned" \ |
| 4795 | -c "Read from server: .* bytes read" |
| 4796 | |
| 4797 | run_test "Event-driven I/O: ticket + client auth" \ |
| 4798 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4799 | "$P_CLI event=1 tickets=1" \ |
| 4800 | 0 \ |
| 4801 | -S "mbedtls_ssl_handshake returned" \ |
| 4802 | -C "mbedtls_ssl_handshake returned" \ |
| 4803 | -c "Read from server: .* bytes read" |
| 4804 | |
| 4805 | run_test "Event-driven I/O: ticket + client auth + resume" \ |
| 4806 | "$P_SRV event=1 tickets=1 auth_mode=required" \ |
| 4807 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4808 | 0 \ |
| 4809 | -S "mbedtls_ssl_handshake returned" \ |
| 4810 | -C "mbedtls_ssl_handshake returned" \ |
| 4811 | -c "Read from server: .* bytes read" |
| 4812 | |
| 4813 | run_test "Event-driven I/O: ticket + resume" \ |
| 4814 | "$P_SRV event=1 tickets=1 auth_mode=none" \ |
| 4815 | "$P_CLI event=1 tickets=1 reconnect=1" \ |
| 4816 | 0 \ |
| 4817 | -S "mbedtls_ssl_handshake returned" \ |
| 4818 | -C "mbedtls_ssl_handshake returned" \ |
| 4819 | -c "Read from server: .* bytes read" |
| 4820 | |
| 4821 | run_test "Event-driven I/O: session-id resume" \ |
| 4822 | "$P_SRV event=1 tickets=0 auth_mode=none" \ |
| 4823 | "$P_CLI event=1 tickets=0 reconnect=1" \ |
| 4824 | 0 \ |
| 4825 | -S "mbedtls_ssl_handshake returned" \ |
| 4826 | -C "mbedtls_ssl_handshake returned" \ |
| 4827 | -c "Read from server: .* bytes read" |
| 4828 | |
Hanno Becker | 6a33f59 | 2018-03-13 11:38:46 +0000 | [diff] [blame] | 4829 | run_test "Event-driven I/O, DTLS: basic handshake" \ |
| 4830 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=none" \ |
| 4831 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4832 | 0 \ |
| 4833 | -c "Read from server: .* bytes read" |
| 4834 | |
| 4835 | run_test "Event-driven I/O, DTLS: client auth" \ |
| 4836 | "$P_SRV dtls=1 event=1 tickets=0 auth_mode=required" \ |
| 4837 | "$P_CLI dtls=1 event=1 tickets=0" \ |
| 4838 | 0 \ |
| 4839 | -c "Read from server: .* bytes read" |
| 4840 | |
| 4841 | run_test "Event-driven I/O, DTLS: ticket" \ |
| 4842 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=none" \ |
| 4843 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4844 | 0 \ |
| 4845 | -c "Read from server: .* bytes read" |
| 4846 | |
| 4847 | run_test "Event-driven I/O, DTLS: ticket + client auth" \ |
| 4848 | "$P_SRV dtls=1 event=1 tickets=1 auth_mode=required" \ |
| 4849 | "$P_CLI dtls=1 event=1 tickets=1" \ |
| 4850 | 0 \ |
| 4851 | -c "Read from server: .* bytes read" |
| 4852 | |
| 4853 | run_test "Event-driven I/O, DTLS: ticket + client auth + resume" \ |
| 4854 | "$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] | 4855 | "$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] | 4856 | 0 \ |
| 4857 | -c "Read from server: .* bytes read" |
| 4858 | |
| 4859 | run_test "Event-driven I/O, DTLS: ticket + resume" \ |
| 4860 | "$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] | 4861 | "$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] | 4862 | 0 \ |
| 4863 | -c "Read from server: .* bytes read" |
| 4864 | |
| 4865 | run_test "Event-driven I/O, DTLS: session-id resume" \ |
| 4866 | "$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] | 4867 | "$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] | 4868 | 0 \ |
| 4869 | -c "Read from server: .* bytes read" |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4870 | |
| 4871 | # This test demonstrates the need for the mbedtls_ssl_check_pending function. |
| 4872 | # During session resumption, the client will send its ApplicationData record |
| 4873 | # within the same datagram as the Finished messages. In this situation, the |
| 4874 | # server MUST NOT idle on the underlying transport after handshake completion, |
| 4875 | # because the ApplicationData request has already been queued internally. |
| 4876 | run_test "Event-driven I/O, DTLS: session-id resume, UDP packing" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 4877 | -p "$P_PXY pack=50" \ |
Hanno Becker | bc6c110 | 2018-03-13 11:39:40 +0000 | [diff] [blame] | 4878 | "$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] | 4879 | "$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] | 4880 | 0 \ |
| 4881 | -c "Read from server: .* bytes read" |
| 4882 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4883 | # Tests for version negotiation |
| 4884 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4885 | run_test "Version check: all -> 1.2" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4886 | "$P_SRV" \ |
| 4887 | "$P_CLI" \ |
| 4888 | 0 \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 4889 | -S "mbedtls_ssl_handshake returned" \ |
| 4890 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | a3d808e | 2014-02-26 16:33:03 +0100 | [diff] [blame] | 4891 | -s "Protocol is TLSv1.2" \ |
| 4892 | -c "Protocol is TLSv1.2" |
| 4893 | |
TRodziewicz | 2abf03c | 2021-06-25 14:40:09 +0200 | [diff] [blame] | 4894 | run_test "Not supported version check: cli TLS 1.0" \ |
| 4895 | "$P_SRV" \ |
| 4896 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.0" \ |
| 4897 | 1 \ |
| 4898 | -s "Handshake protocol not within min/max boundaries" \ |
| 4899 | -c "Error in protocol version" \ |
| 4900 | -S "Protocol is TLSv1.0" \ |
| 4901 | -C "Handshake was completed" |
| 4902 | |
| 4903 | run_test "Not supported version check: cli TLS 1.1" \ |
| 4904 | "$P_SRV" \ |
| 4905 | "$G_CLI localhost --priority=NORMAL:-VERS-ALL:+VERS-TLS1.1" \ |
| 4906 | 1 \ |
| 4907 | -s "Handshake protocol not within min/max boundaries" \ |
| 4908 | -c "Error in protocol version" \ |
| 4909 | -S "Protocol is TLSv1.1" \ |
| 4910 | -C "Handshake was completed" |
| 4911 | |
| 4912 | run_test "Not supported version check: srv max TLS 1.0" \ |
| 4913 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.0" \ |
| 4914 | "$P_CLI" \ |
| 4915 | 1 \ |
| 4916 | -s "Error in protocol version" \ |
| 4917 | -c "Handshake protocol not within min/max boundaries" \ |
| 4918 | -S "Version: TLS1.0" \ |
| 4919 | -C "Protocol is TLSv1.0" |
| 4920 | |
| 4921 | run_test "Not supported version check: srv max TLS 1.1" \ |
| 4922 | "$G_SRV --priority=NORMAL:-VERS-TLS-ALL:+VERS-TLS1.1" \ |
| 4923 | "$P_CLI" \ |
| 4924 | 1 \ |
| 4925 | -s "Error in protocol version" \ |
| 4926 | -c "Handshake protocol not within min/max boundaries" \ |
| 4927 | -S "Version: TLS1.1" \ |
| 4928 | -C "Protocol is TLSv1.1" |
| 4929 | |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4930 | # Tests for ALPN extension |
| 4931 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4932 | run_test "ALPN: none" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4933 | "$P_SRV debug_level=3" \ |
| 4934 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4935 | 0 \ |
| 4936 | -C "client hello, adding alpn extension" \ |
| 4937 | -S "found alpn extension" \ |
| 4938 | -C "got an alert message, type: \\[2:120]" \ |
| 4939 | -S "server hello, adding alpn extension" \ |
| 4940 | -C "found alpn extension " \ |
| 4941 | -C "Application Layer Protocol is" \ |
| 4942 | -S "Application Layer Protocol is" |
| 4943 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4944 | run_test "ALPN: client only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4945 | "$P_SRV debug_level=3" \ |
| 4946 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4947 | 0 \ |
| 4948 | -c "client hello, adding alpn extension" \ |
| 4949 | -s "found alpn extension" \ |
| 4950 | -C "got an alert message, type: \\[2:120]" \ |
| 4951 | -S "server hello, adding alpn extension" \ |
| 4952 | -C "found alpn extension " \ |
| 4953 | -c "Application Layer Protocol is (none)" \ |
| 4954 | -S "Application Layer Protocol is" |
| 4955 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4956 | run_test "ALPN: server only" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4957 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4958 | "$P_CLI debug_level=3" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4959 | 0 \ |
| 4960 | -C "client hello, adding alpn extension" \ |
| 4961 | -S "found alpn extension" \ |
| 4962 | -C "got an alert message, type: \\[2:120]" \ |
| 4963 | -S "server hello, adding alpn extension" \ |
| 4964 | -C "found alpn extension " \ |
| 4965 | -C "Application Layer Protocol is" \ |
| 4966 | -s "Application Layer Protocol is (none)" |
| 4967 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4968 | run_test "ALPN: both, common cli1-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4969 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4970 | "$P_CLI debug_level=3 alpn=abc,1234" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4971 | 0 \ |
| 4972 | -c "client hello, adding alpn extension" \ |
| 4973 | -s "found alpn extension" \ |
| 4974 | -C "got an alert message, type: \\[2:120]" \ |
| 4975 | -s "server hello, adding alpn extension" \ |
| 4976 | -c "found alpn extension" \ |
| 4977 | -c "Application Layer Protocol is abc" \ |
| 4978 | -s "Application Layer Protocol is abc" |
| 4979 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4980 | run_test "ALPN: both, common cli2-srv1" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4981 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4982 | "$P_CLI debug_level=3 alpn=1234,abc" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4983 | 0 \ |
| 4984 | -c "client hello, adding alpn extension" \ |
| 4985 | -s "found alpn extension" \ |
| 4986 | -C "got an alert message, type: \\[2:120]" \ |
| 4987 | -s "server hello, adding alpn extension" \ |
| 4988 | -c "found alpn extension" \ |
| 4989 | -c "Application Layer Protocol is abc" \ |
| 4990 | -s "Application Layer Protocol is abc" |
| 4991 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 4992 | run_test "ALPN: both, common cli1-srv2" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 4993 | "$P_SRV debug_level=3 alpn=abc,1234" \ |
| 4994 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 4995 | 0 \ |
| 4996 | -c "client hello, adding alpn extension" \ |
| 4997 | -s "found alpn extension" \ |
| 4998 | -C "got an alert message, type: \\[2:120]" \ |
| 4999 | -s "server hello, adding alpn extension" \ |
| 5000 | -c "found alpn extension" \ |
| 5001 | -c "Application Layer Protocol is 1234" \ |
| 5002 | -s "Application Layer Protocol is 1234" |
| 5003 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5004 | run_test "ALPN: both, no common" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5005 | "$P_SRV debug_level=3 alpn=abc,123" \ |
| 5006 | "$P_CLI debug_level=3 alpn=1234,abcde" \ |
Manuel Pégourié-Gonnard | f6521de | 2014-04-07 12:42:04 +0200 | [diff] [blame] | 5007 | 1 \ |
| 5008 | -c "client hello, adding alpn extension" \ |
| 5009 | -s "found alpn extension" \ |
| 5010 | -c "got an alert message, type: \\[2:120]" \ |
| 5011 | -S "server hello, adding alpn extension" \ |
| 5012 | -C "found alpn extension" \ |
| 5013 | -C "Application Layer Protocol is 1234" \ |
| 5014 | -S "Application Layer Protocol is 1234" |
| 5015 | |
Manuel Pégourié-Gonnard | 83d8c73 | 2014-04-07 13:24:21 +0200 | [diff] [blame] | 5016 | |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5017 | # Tests for keyUsage in leaf certificates, part 1: |
| 5018 | # server-side certificate/suite selection |
| 5019 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5020 | run_test "keyUsage srv: RSA, digitalSignature -> (EC)DHE-RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5021 | "$P_SRV key_file=data_files/server2.key \ |
| 5022 | crt_file=data_files/server2.ku-ds.crt" \ |
| 5023 | "$P_CLI" \ |
| 5024 | 0 \ |
Manuel Pégourié-Gonnard | 17cde5f | 2014-05-22 14:42:39 +0200 | [diff] [blame] | 5025 | -c "Ciphersuite is TLS-[EC]*DHE-RSA-WITH-" |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5026 | |
| 5027 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5028 | run_test "keyUsage srv: RSA, keyEncipherment -> RSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5029 | "$P_SRV key_file=data_files/server2.key \ |
| 5030 | crt_file=data_files/server2.ku-ke.crt" \ |
| 5031 | "$P_CLI" \ |
| 5032 | 0 \ |
| 5033 | -c "Ciphersuite is TLS-RSA-WITH-" |
| 5034 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5035 | run_test "keyUsage srv: RSA, keyAgreement -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5036 | "$P_SRV key_file=data_files/server2.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5037 | crt_file=data_files/server2.ku-ka.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5038 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5039 | 1 \ |
| 5040 | -C "Ciphersuite is " |
| 5041 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5042 | run_test "keyUsage srv: ECDSA, digitalSignature -> ECDHE-ECDSA" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5043 | "$P_SRV key_file=data_files/server5.key \ |
| 5044 | crt_file=data_files/server5.ku-ds.crt" \ |
| 5045 | "$P_CLI" \ |
| 5046 | 0 \ |
| 5047 | -c "Ciphersuite is TLS-ECDHE-ECDSA-WITH-" |
| 5048 | |
| 5049 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5050 | run_test "keyUsage srv: ECDSA, keyAgreement -> ECDH-" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5051 | "$P_SRV key_file=data_files/server5.key \ |
| 5052 | crt_file=data_files/server5.ku-ka.crt" \ |
| 5053 | "$P_CLI" \ |
| 5054 | 0 \ |
| 5055 | -c "Ciphersuite is TLS-ECDH-" |
| 5056 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5057 | run_test "keyUsage srv: ECDSA, keyEncipherment -> fail" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5058 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5059 | crt_file=data_files/server5.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | f2629b9 | 2014-08-30 14:20:14 +0200 | [diff] [blame] | 5060 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5061 | 1 \ |
| 5062 | -C "Ciphersuite is " |
| 5063 | |
| 5064 | # Tests for keyUsage in leaf certificates, part 2: |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5065 | # client-side checking of server cert |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5066 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5067 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5068 | "$O_SRV -key data_files/server2.key \ |
| 5069 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5070 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5071 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5072 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5073 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5074 | -C "Processing of the Certificate handshake message failed" \ |
| 5075 | -c "Ciphersuite is TLS-" |
| 5076 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5077 | run_test "keyUsage cli: DigitalSignature+KeyEncipherment, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5078 | "$O_SRV -key data_files/server2.key \ |
| 5079 | -cert data_files/server2.ku-ds_ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5080 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5081 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5082 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5083 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5084 | -C "Processing of the Certificate handshake message failed" \ |
| 5085 | -c "Ciphersuite is TLS-" |
| 5086 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5087 | run_test "keyUsage cli: KeyEncipherment, RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5088 | "$O_SRV -key data_files/server2.key \ |
| 5089 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5090 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5091 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5092 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5093 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5094 | -C "Processing of the Certificate handshake message failed" \ |
| 5095 | -c "Ciphersuite is TLS-" |
| 5096 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5097 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5098 | "$O_SRV -key data_files/server2.key \ |
| 5099 | -cert data_files/server2.ku-ke.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5100 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5101 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5102 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5103 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5104 | -c "Processing of the Certificate handshake message failed" \ |
| 5105 | -C "Ciphersuite is TLS-" |
| 5106 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5107 | run_test "keyUsage cli: KeyEncipherment, DHE-RSA: fail, soft" \ |
| 5108 | "$O_SRV -key data_files/server2.key \ |
| 5109 | -cert data_files/server2.ku-ke.crt" \ |
| 5110 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5111 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5112 | 0 \ |
| 5113 | -c "bad certificate (usage extensions)" \ |
| 5114 | -C "Processing of the Certificate handshake message failed" \ |
| 5115 | -c "Ciphersuite is TLS-" \ |
| 5116 | -c "! Usage does not match the keyUsage extension" |
| 5117 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5118 | run_test "keyUsage cli: DigitalSignature, DHE-RSA: OK" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5119 | "$O_SRV -key data_files/server2.key \ |
| 5120 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5121 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5122 | force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA" \ |
| 5123 | 0 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5124 | -C "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5125 | -C "Processing of the Certificate handshake message failed" \ |
| 5126 | -c "Ciphersuite is TLS-" |
| 5127 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5128 | run_test "keyUsage cli: DigitalSignature, RSA: fail" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5129 | "$O_SRV -key data_files/server2.key \ |
| 5130 | -cert data_files/server2.ku-ds.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5131 | "$P_CLI debug_level=1 \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5132 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5133 | 1 \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5134 | -c "bad certificate (usage extensions)" \ |
Manuel Pégourié-Gonnard | 7f2a07d | 2014-04-09 09:50:57 +0200 | [diff] [blame] | 5135 | -c "Processing of the Certificate handshake message failed" \ |
| 5136 | -C "Ciphersuite is TLS-" |
| 5137 | |
Manuel Pégourié-Gonnard | e6efa6f | 2015-04-20 11:01:48 +0100 | [diff] [blame] | 5138 | run_test "keyUsage cli: DigitalSignature, RSA: fail, soft" \ |
| 5139 | "$O_SRV -key data_files/server2.key \ |
| 5140 | -cert data_files/server2.ku-ds.crt" \ |
| 5141 | "$P_CLI debug_level=1 auth_mode=optional \ |
| 5142 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 5143 | 0 \ |
| 5144 | -c "bad certificate (usage extensions)" \ |
| 5145 | -C "Processing of the Certificate handshake message failed" \ |
| 5146 | -c "Ciphersuite is TLS-" \ |
| 5147 | -c "! Usage does not match the keyUsage extension" |
| 5148 | |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5149 | # Tests for keyUsage in leaf certificates, part 3: |
| 5150 | # server-side checking of client cert |
| 5151 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5152 | run_test "keyUsage cli-auth: RSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5153 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5154 | "$O_CLI -key data_files/server2.key \ |
| 5155 | -cert data_files/server2.ku-ds.crt" \ |
| 5156 | 0 \ |
| 5157 | -S "bad certificate (usage extensions)" \ |
| 5158 | -S "Processing of the Certificate handshake message failed" |
| 5159 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5160 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5161 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5162 | "$O_CLI -key data_files/server2.key \ |
| 5163 | -cert data_files/server2.ku-ke.crt" \ |
| 5164 | 0 \ |
| 5165 | -s "bad certificate (usage extensions)" \ |
| 5166 | -S "Processing of the Certificate handshake message failed" |
| 5167 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5168 | run_test "keyUsage cli-auth: RSA, KeyEncipherment: fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5169 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5170 | "$O_CLI -key data_files/server2.key \ |
| 5171 | -cert data_files/server2.ku-ke.crt" \ |
| 5172 | 1 \ |
| 5173 | -s "bad certificate (usage extensions)" \ |
| 5174 | -s "Processing of the Certificate handshake message failed" |
| 5175 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5176 | run_test "keyUsage cli-auth: ECDSA, DigitalSignature: OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5177 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5178 | "$O_CLI -key data_files/server5.key \ |
| 5179 | -cert data_files/server5.ku-ds.crt" \ |
| 5180 | 0 \ |
| 5181 | -S "bad certificate (usage extensions)" \ |
| 5182 | -S "Processing of the Certificate handshake message failed" |
| 5183 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5184 | run_test "keyUsage cli-auth: ECDSA, KeyAgreement: fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5185 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | a9db85d | 2014-04-09 14:53:05 +0200 | [diff] [blame] | 5186 | "$O_CLI -key data_files/server5.key \ |
| 5187 | -cert data_files/server5.ku-ka.crt" \ |
| 5188 | 0 \ |
| 5189 | -s "bad certificate (usage extensions)" \ |
| 5190 | -S "Processing of the Certificate handshake message failed" |
| 5191 | |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5192 | # Tests for extendedKeyUsage, part 1: server-side certificate/suite selection |
| 5193 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5194 | run_test "extKeyUsage srv: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5195 | "$P_SRV key_file=data_files/server5.key \ |
| 5196 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5197 | "$P_CLI" \ |
| 5198 | 0 |
| 5199 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5200 | run_test "extKeyUsage srv: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5201 | "$P_SRV key_file=data_files/server5.key \ |
| 5202 | crt_file=data_files/server5.eku-srv.crt" \ |
| 5203 | "$P_CLI" \ |
| 5204 | 0 |
| 5205 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5206 | run_test "extKeyUsage srv: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5207 | "$P_SRV key_file=data_files/server5.key \ |
| 5208 | crt_file=data_files/server5.eku-cs_any.crt" \ |
| 5209 | "$P_CLI" \ |
| 5210 | 0 |
| 5211 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5212 | run_test "extKeyUsage srv: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5213 | "$P_SRV key_file=data_files/server5.key \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5214 | crt_file=data_files/server5.eku-cli.crt" \ |
Manuel Pégourié-Gonnard | 7eb58cb | 2015-07-07 11:54:14 +0200 | [diff] [blame] | 5215 | "$P_CLI" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5216 | 1 |
| 5217 | |
| 5218 | # Tests for extendedKeyUsage, part 2: client-side checking of server cert |
| 5219 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5220 | run_test "extKeyUsage cli: serverAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5221 | "$O_SRV -key data_files/server5.key \ |
| 5222 | -cert data_files/server5.eku-srv.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5223 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5224 | 0 \ |
| 5225 | -C "bad certificate (usage extensions)" \ |
| 5226 | -C "Processing of the Certificate handshake message failed" \ |
| 5227 | -c "Ciphersuite is TLS-" |
| 5228 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5229 | run_test "extKeyUsage cli: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5230 | "$O_SRV -key data_files/server5.key \ |
| 5231 | -cert data_files/server5.eku-srv_cli.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5232 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5233 | 0 \ |
| 5234 | -C "bad certificate (usage extensions)" \ |
| 5235 | -C "Processing of the Certificate handshake message failed" \ |
| 5236 | -c "Ciphersuite is TLS-" |
| 5237 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5238 | run_test "extKeyUsage cli: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5239 | "$O_SRV -key data_files/server5.key \ |
| 5240 | -cert data_files/server5.eku-cs_any.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5241 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5242 | 0 \ |
| 5243 | -C "bad certificate (usage extensions)" \ |
| 5244 | -C "Processing of the Certificate handshake message failed" \ |
| 5245 | -c "Ciphersuite is TLS-" |
| 5246 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5247 | run_test "extKeyUsage cli: codeSign -> fail" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5248 | "$O_SRV -key data_files/server5.key \ |
| 5249 | -cert data_files/server5.eku-cs.crt" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5250 | "$P_CLI debug_level=1" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5251 | 1 \ |
| 5252 | -c "bad certificate (usage extensions)" \ |
| 5253 | -c "Processing of the Certificate handshake message failed" \ |
| 5254 | -C "Ciphersuite is TLS-" |
| 5255 | |
| 5256 | # Tests for extendedKeyUsage, part 3: server-side checking of client cert |
| 5257 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5258 | run_test "extKeyUsage cli-auth: clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5259 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5260 | "$O_CLI -key data_files/server5.key \ |
| 5261 | -cert data_files/server5.eku-cli.crt" \ |
| 5262 | 0 \ |
| 5263 | -S "bad certificate (usage extensions)" \ |
| 5264 | -S "Processing of the Certificate handshake message failed" |
| 5265 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5266 | run_test "extKeyUsage cli-auth: serverAuth,clientAuth -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5267 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5268 | "$O_CLI -key data_files/server5.key \ |
| 5269 | -cert data_files/server5.eku-srv_cli.crt" \ |
| 5270 | 0 \ |
| 5271 | -S "bad certificate (usage extensions)" \ |
| 5272 | -S "Processing of the Certificate handshake message failed" |
| 5273 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5274 | run_test "extKeyUsage cli-auth: codeSign,anyEKU -> OK" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5275 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5276 | "$O_CLI -key data_files/server5.key \ |
| 5277 | -cert data_files/server5.eku-cs_any.crt" \ |
| 5278 | 0 \ |
| 5279 | -S "bad certificate (usage extensions)" \ |
| 5280 | -S "Processing of the Certificate handshake message failed" |
| 5281 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5282 | run_test "extKeyUsage cli-auth: codeSign -> fail (soft)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5283 | "$P_SRV debug_level=1 auth_mode=optional" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5284 | "$O_CLI -key data_files/server5.key \ |
| 5285 | -cert data_files/server5.eku-cs.crt" \ |
| 5286 | 0 \ |
| 5287 | -s "bad certificate (usage extensions)" \ |
| 5288 | -S "Processing of the Certificate handshake message failed" |
| 5289 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5290 | run_test "extKeyUsage cli-auth: codeSign -> fail (hard)" \ |
Manuel Pégourié-Gonnard | 644e8f3 | 2014-08-30 21:59:31 +0200 | [diff] [blame] | 5291 | "$P_SRV debug_level=1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 0408fd1 | 2014-04-11 11:06:22 +0200 | [diff] [blame] | 5292 | "$O_CLI -key data_files/server5.key \ |
| 5293 | -cert data_files/server5.eku-cs.crt" \ |
| 5294 | 1 \ |
| 5295 | -s "bad certificate (usage extensions)" \ |
| 5296 | -s "Processing of the Certificate handshake message failed" |
| 5297 | |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5298 | # Tests for DHM parameters loading |
| 5299 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5300 | run_test "DHM parameters: reference" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5301 | "$P_SRV" \ |
| 5302 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5303 | debug_level=3" \ |
| 5304 | 0 \ |
| 5305 | -c "value of 'DHM: P ' (2048 bits)" \ |
Hanno Becker | 13be990 | 2017-09-27 17:17:30 +0100 | [diff] [blame] | 5306 | -c "value of 'DHM: G ' (2 bits)" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5307 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5308 | run_test "DHM parameters: other parameters" \ |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5309 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5310 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5311 | debug_level=3" \ |
| 5312 | 0 \ |
| 5313 | -c "value of 'DHM: P ' (1024 bits)" \ |
| 5314 | -c "value of 'DHM: G ' (2 bits)" |
| 5315 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5316 | # Tests for DHM client-side size checking |
| 5317 | |
| 5318 | run_test "DHM size: server default, client default, OK" \ |
| 5319 | "$P_SRV" \ |
| 5320 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5321 | debug_level=1" \ |
| 5322 | 0 \ |
| 5323 | -C "DHM prime too short:" |
| 5324 | |
| 5325 | run_test "DHM size: server default, client 2048, OK" \ |
| 5326 | "$P_SRV" \ |
| 5327 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5328 | debug_level=1 dhmlen=2048" \ |
| 5329 | 0 \ |
| 5330 | -C "DHM prime too short:" |
| 5331 | |
| 5332 | run_test "DHM size: server 1024, client default, OK" \ |
| 5333 | "$P_SRV dhm_file=data_files/dhparams.pem" \ |
| 5334 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5335 | debug_level=1" \ |
| 5336 | 0 \ |
| 5337 | -C "DHM prime too short:" |
| 5338 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5339 | run_test "DHM size: server 999, client 999, OK" \ |
| 5340 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5341 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5342 | debug_level=1 dhmlen=999" \ |
| 5343 | 0 \ |
| 5344 | -C "DHM prime too short:" |
| 5345 | |
| 5346 | run_test "DHM size: server 1000, client 1000, OK" \ |
| 5347 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5348 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5349 | debug_level=1 dhmlen=1000" \ |
| 5350 | 0 \ |
| 5351 | -C "DHM prime too short:" |
| 5352 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5353 | run_test "DHM size: server 1000, client default, rejected" \ |
| 5354 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5355 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5356 | debug_level=1" \ |
| 5357 | 1 \ |
| 5358 | -c "DHM prime too short:" |
| 5359 | |
Gilles Peskine | c6b0d96 | 2020-12-08 22:31:52 +0100 | [diff] [blame] | 5360 | run_test "DHM size: server 1000, client 1001, rejected" \ |
| 5361 | "$P_SRV dhm_file=data_files/dh.1000.pem" \ |
| 5362 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5363 | debug_level=1 dhmlen=1001" \ |
| 5364 | 1 \ |
| 5365 | -c "DHM prime too short:" |
| 5366 | |
| 5367 | run_test "DHM size: server 999, client 1000, rejected" \ |
| 5368 | "$P_SRV dhm_file=data_files/dh.999.pem" \ |
| 5369 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5370 | debug_level=1 dhmlen=1000" \ |
| 5371 | 1 \ |
| 5372 | -c "DHM prime too short:" |
| 5373 | |
| 5374 | run_test "DHM size: server 998, client 999, rejected" \ |
| 5375 | "$P_SRV dhm_file=data_files/dh.998.pem" \ |
| 5376 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5377 | debug_level=1 dhmlen=999" \ |
| 5378 | 1 \ |
| 5379 | -c "DHM prime too short:" |
| 5380 | |
Manuel Pégourié-Gonnard | 7a010aa | 2015-06-12 11:19:10 +0200 | [diff] [blame] | 5381 | run_test "DHM size: server default, client 2049, rejected" \ |
| 5382 | "$P_SRV" \ |
| 5383 | "$P_CLI force_ciphersuite=TLS-DHE-RSA-WITH-AES-128-CBC-SHA \ |
| 5384 | debug_level=1 dhmlen=2049" \ |
| 5385 | 1 \ |
| 5386 | -c "DHM prime too short:" |
| 5387 | |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5388 | # Tests for PSK callback |
| 5389 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5390 | run_test "PSK callback: psk, no callback" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5391 | "$P_SRV psk=abc123 psk_identity=foo" \ |
| 5392 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5393 | psk_identity=foo psk=abc123" \ |
| 5394 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5395 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5396 | -S "SSL - Unknown identity received" \ |
| 5397 | -S "SSL - Verification of the message MAC failed" |
| 5398 | |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5399 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5400 | run_test "PSK callback: opaque psk on client, no callback" \ |
| 5401 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5402 | "$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] | 5403 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5404 | 0 \ |
| 5405 | -c "skip PMS generation for opaque PSK"\ |
| 5406 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5407 | -C "session hash for extended master secret"\ |
| 5408 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5409 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5410 | -S "SSL - Unknown identity received" \ |
| 5411 | -S "SSL - Verification of the message MAC failed" |
| 5412 | |
| 5413 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5414 | run_test "PSK callback: opaque psk on client, no callback, SHA-384" \ |
| 5415 | "$P_SRV extended_ms=0 debug_level=1 psk=abc123 psk_identity=foo" \ |
| 5416 | "$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] | 5417 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5418 | 0 \ |
| 5419 | -c "skip PMS generation for opaque PSK"\ |
| 5420 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5421 | -C "session hash for extended master secret"\ |
| 5422 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5423 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5424 | -S "SSL - Unknown identity received" \ |
| 5425 | -S "SSL - Verification of the message MAC failed" |
| 5426 | |
| 5427 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5428 | run_test "PSK callback: opaque psk on client, no callback, EMS" \ |
| 5429 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5430 | "$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] | 5431 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5432 | 0 \ |
| 5433 | -c "skip PMS generation for opaque PSK"\ |
| 5434 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5435 | -c "session hash for extended master secret"\ |
| 5436 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5437 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5438 | -S "SSL - Unknown identity received" \ |
| 5439 | -S "SSL - Verification of the message MAC failed" |
| 5440 | |
| 5441 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5442 | run_test "PSK callback: opaque psk on client, no callback, SHA-384, EMS" \ |
| 5443 | "$P_SRV extended_ms=1 debug_level=3 psk=abc123 psk_identity=foo" \ |
| 5444 | "$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] | 5445 | psk_identity=foo psk=abc123 psk_opaque=1" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5446 | 0 \ |
| 5447 | -c "skip PMS generation for opaque PSK"\ |
| 5448 | -S "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5449 | -c "session hash for extended master secret"\ |
| 5450 | -s "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5451 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | f702751 | 2018-10-23 15:27:39 +0100 | [diff] [blame] | 5452 | -S "SSL - Unknown identity received" \ |
| 5453 | -S "SSL - Verification of the message MAC failed" |
| 5454 | |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5455 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5456 | 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] | 5457 | "$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] | 5458 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5459 | psk_identity=foo psk=abc123" \ |
| 5460 | 0 \ |
| 5461 | -C "skip PMS generation for opaque PSK"\ |
| 5462 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5463 | -C "session hash for extended master secret"\ |
| 5464 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5465 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5466 | -S "SSL - Unknown identity received" \ |
| 5467 | -S "SSL - Verification of the message MAC failed" |
| 5468 | |
| 5469 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5470 | 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] | 5471 | "$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] | 5472 | "$P_CLI extended_ms=0 debug_level=1 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5473 | psk_identity=foo psk=abc123" \ |
| 5474 | 0 \ |
| 5475 | -C "skip PMS generation for opaque PSK"\ |
| 5476 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5477 | -C "session hash for extended master secret"\ |
| 5478 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5479 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5480 | -S "SSL - Unknown identity received" \ |
| 5481 | -S "SSL - Verification of the message MAC failed" |
| 5482 | |
| 5483 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5484 | 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] | 5485 | "$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] | 5486 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5487 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5488 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5489 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5490 | -c "session hash for extended master secret"\ |
| 5491 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5492 | -C "skip PMS generation for opaque PSK"\ |
| 5493 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5494 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5495 | -S "SSL - Unknown identity received" \ |
| 5496 | -S "SSL - Verification of the message MAC failed" |
| 5497 | |
| 5498 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5499 | 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] | 5500 | "$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] | 5501 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5502 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5503 | psk_identity=foo psk=abc123 extended_ms=1" \ |
| 5504 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5505 | -c "session hash for extended master secret"\ |
| 5506 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5507 | -C "skip PMS generation for opaque PSK"\ |
| 5508 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5509 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5510 | -S "SSL - Unknown identity received" \ |
| 5511 | -S "SSL - Verification of the message MAC failed" |
| 5512 | |
| 5513 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5514 | 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] | 5515 | "$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] | 5516 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5517 | psk_identity=def psk=beef" \ |
| 5518 | 0 \ |
| 5519 | -C "skip PMS generation for opaque PSK"\ |
| 5520 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5521 | -C "session hash for extended master secret"\ |
| 5522 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5523 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5524 | -S "SSL - Unknown identity received" \ |
| 5525 | -S "SSL - Verification of the message MAC failed" |
| 5526 | |
| 5527 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5528 | 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] | 5529 | "$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] | 5530 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5531 | psk_identity=def psk=beef" \ |
| 5532 | 0 \ |
| 5533 | -C "skip PMS generation for opaque PSK"\ |
| 5534 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5535 | -C "session hash for extended master secret"\ |
| 5536 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5537 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5538 | -S "SSL - Unknown identity received" \ |
| 5539 | -S "SSL - Verification of the message MAC failed" |
| 5540 | |
| 5541 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5542 | 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] | 5543 | "$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] | 5544 | force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA extended_ms=1" \ |
| 5545 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5546 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5547 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5548 | -c "session hash for extended master secret"\ |
| 5549 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5550 | -C "skip PMS generation for opaque PSK"\ |
| 5551 | -s "skip PMS generation for opaque PSK"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5552 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5553 | -S "SSL - Unknown identity received" \ |
| 5554 | -S "SSL - Verification of the message MAC failed" |
| 5555 | |
| 5556 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5557 | 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] | 5558 | "$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] | 5559 | force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 extended_ms=1" \ |
| 5560 | "$P_CLI debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-256-CBC-SHA384 \ |
| 5561 | psk_identity=abc psk=dead extended_ms=1" \ |
| 5562 | 0 \ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5563 | -c "session hash for extended master secret"\ |
| 5564 | -s "session hash for extended master secret"\ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5565 | -C "skip PMS generation for opaque PSK"\ |
| 5566 | -s "skip PMS generation for opaque PSK"\ |
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, mismatching static raw PSK on server, opaque PSK from callback" \ |
Hanno Becker | 1d911cd | 2018-11-15 13:06:09 +0000 | [diff] [blame] | 5573 | "$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] | 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 | 0 \ |
| 5577 | -C "skip PMS generation for opaque PSK"\ |
| 5578 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5579 | -C "session hash for extended master secret"\ |
| 5580 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5581 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5582 | -S "SSL - Unknown identity received" \ |
| 5583 | -S "SSL - Verification of the message MAC failed" |
| 5584 | |
| 5585 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5586 | 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] | 5587 | "$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] | 5588 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5589 | psk_identity=def psk=beef" \ |
| 5590 | 0 \ |
| 5591 | -C "skip PMS generation for opaque PSK"\ |
| 5592 | -s "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5593 | -C "session hash for extended master secret"\ |
| 5594 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5595 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5596 | -S "SSL - Unknown identity received" \ |
| 5597 | -S "SSL - Verification of the message MAC failed" |
| 5598 | |
| 5599 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5600 | 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] | 5601 | "$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] | 5602 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5603 | psk_identity=def psk=beef" \ |
| 5604 | 0 \ |
| 5605 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5606 | -C "session hash for extended master secret"\ |
| 5607 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5608 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5609 | -S "SSL - Unknown identity received" \ |
| 5610 | -S "SSL - Verification of the message MAC failed" |
| 5611 | |
| 5612 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5613 | 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] | 5614 | "$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] | 5615 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5616 | psk_identity=def psk=beef" \ |
| 5617 | 0 \ |
| 5618 | -C "skip PMS generation for opaque PSK"\ |
Manuel Pégourié-Gonnard | 8faa70e | 2019-05-20 12:09:50 +0200 | [diff] [blame] | 5619 | -C "session hash for extended master secret"\ |
| 5620 | -S "session hash for extended master secret"\ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5621 | -S "SSL - The handshake negotiation failed" \ |
Hanno Becker | 28c79dc | 2018-10-26 13:15:08 +0100 | [diff] [blame] | 5622 | -S "SSL - Unknown identity received" \ |
| 5623 | -S "SSL - Verification of the message MAC failed" |
| 5624 | |
| 5625 | requires_config_enabled MBEDTLS_USE_PSA_CRYPTO |
| 5626 | 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] | 5627 | "$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] | 5628 | "$P_CLI extended_ms=0 debug_level=3 min_version=tls1_2 force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5629 | psk_identity=def psk=beef" \ |
| 5630 | 1 \ |
| 5631 | -s "SSL - Verification of the message MAC failed" |
| 5632 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5633 | run_test "PSK callback: no psk, no callback" \ |
Manuel Pégourié-Gonnard | 10c3c9f | 2014-06-10 15:28:52 +0200 | [diff] [blame] | 5634 | "$P_SRV" \ |
| 5635 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5636 | psk_identity=foo psk=abc123" \ |
| 5637 | 1 \ |
Dave Rodgman | 6ce10be | 2021-06-29 14:20:31 +0100 | [diff] [blame] | 5638 | -s "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5639 | -S "SSL - Unknown identity received" \ |
| 5640 | -S "SSL - Verification of the message MAC failed" |
| 5641 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5642 | run_test "PSK callback: callback overrides other settings" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5643 | "$P_SRV psk=abc123 psk_identity=foo psk_list=abc,dead,def,beef" \ |
| 5644 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5645 | psk_identity=foo psk=abc123" \ |
| 5646 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5647 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5648 | -s "SSL - Unknown identity received" \ |
| 5649 | -S "SSL - Verification of the message MAC failed" |
| 5650 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5651 | run_test "PSK callback: first id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5652 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5653 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5654 | psk_identity=abc psk=dead" \ |
| 5655 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5656 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5657 | -S "SSL - Unknown identity received" \ |
| 5658 | -S "SSL - Verification of the message MAC failed" |
| 5659 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5660 | run_test "PSK callback: second id matches" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5661 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5662 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5663 | psk_identity=def psk=beef" \ |
| 5664 | 0 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5665 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5666 | -S "SSL - Unknown identity received" \ |
| 5667 | -S "SSL - Verification of the message MAC failed" |
| 5668 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5669 | run_test "PSK callback: no match" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5670 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5671 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5672 | psk_identity=ghi psk=beef" \ |
| 5673 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5674 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5675 | -s "SSL - Unknown identity received" \ |
| 5676 | -S "SSL - Verification of the message MAC failed" |
| 5677 | |
Manuel Pégourié-Gonnard | 8e03c71 | 2014-08-30 21:42:40 +0200 | [diff] [blame] | 5678 | run_test "PSK callback: wrong key" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5679 | "$P_SRV psk_list=abc,dead,def,beef" \ |
| 5680 | "$P_CLI force_ciphersuite=TLS-PSK-WITH-AES-128-CBC-SHA \ |
| 5681 | psk_identity=abc psk=beef" \ |
| 5682 | 1 \ |
Dave Rodgman | e5b828c | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5683 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | a6781c9 | 2014-06-10 15:00:46 +0200 | [diff] [blame] | 5684 | -S "SSL - Unknown identity received" \ |
| 5685 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 0cc7e31 | 2014-06-09 11:36:47 +0200 | [diff] [blame] | 5686 | |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5687 | # Tests for EC J-PAKE |
| 5688 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5689 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5690 | run_test "ECJPAKE: client not configured" \ |
| 5691 | "$P_SRV debug_level=3" \ |
| 5692 | "$P_CLI debug_level=3" \ |
| 5693 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5694 | -C "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5695 | -C "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5696 | -S "found ecjpake kkpp extension" \ |
| 5697 | -S "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5698 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5699 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5700 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5701 | -S "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5702 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5703 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5704 | run_test "ECJPAKE: server not configured" \ |
| 5705 | "$P_SRV debug_level=3" \ |
| 5706 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5707 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5708 | 1 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5709 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5710 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5711 | -s "found ecjpake kkpp extension" \ |
| 5712 | -s "skip ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5713 | -s "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5714 | -S "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5715 | -C "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5716 | -s "SSL - The handshake negotiation failed" |
Manuel Pégourié-Gonnard | e511b4e | 2015-09-16 14:11:09 +0200 | [diff] [blame] | 5717 | |
Hanno Becker | fa452c4 | 2020-08-14 15:42:49 +0100 | [diff] [blame] | 5718 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5719 | run_test "ECJPAKE: working, TLS" \ |
| 5720 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5721 | "$P_CLI debug_level=3 ecjpake_pw=bla \ |
| 5722 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
Manuel Pégourié-Gonnard | 0f1660a | 2015-09-16 22:41:06 +0200 | [diff] [blame] | 5723 | 0 \ |
Hanno Becker | ee63af6 | 2020-08-14 15:41:23 +0100 | [diff] [blame] | 5724 | -c "add ciphersuite: 0xc0ff" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5725 | -c "adding ecjpake_kkpp extension" \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5726 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5727 | -s "found ecjpake kkpp extension" \ |
| 5728 | -S "skip ecjpake kkpp extension" \ |
| 5729 | -S "ciphersuite mismatch: ecjpake not configured" \ |
Manuel Pégourié-Gonnard | 55c7f99 | 2015-09-16 15:35:27 +0200 | [diff] [blame] | 5730 | -s "server hello, ecjpake kkpp extension" \ |
Manuel Pégourié-Gonnard | 0a1324a | 2015-09-16 16:01:00 +0200 | [diff] [blame] | 5731 | -c "found ecjpake_kkpp extension" \ |
Dave Rodgman | 737237f | 2021-06-29 19:07:57 +0100 | [diff] [blame] | 5732 | -S "SSL - The handshake negotiation failed" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5733 | -S "SSL - Verification of the message MAC failed" |
| 5734 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5735 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5736 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5737 | run_test "ECJPAKE: password mismatch, TLS" \ |
| 5738 | "$P_SRV debug_level=3 ecjpake_pw=bla" \ |
| 5739 | "$P_CLI debug_level=3 ecjpake_pw=bad \ |
| 5740 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5741 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5742 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5743 | -s "SSL - Verification of the message MAC failed" |
| 5744 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5745 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5746 | run_test "ECJPAKE: working, DTLS" \ |
| 5747 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5748 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5749 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5750 | 0 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5751 | -c "re-using cached ecjpake parameters" \ |
| 5752 | -S "SSL - Verification of the message MAC failed" |
| 5753 | |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5754 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5755 | run_test "ECJPAKE: working, DTLS, no cookie" \ |
| 5756 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla cookies=0" \ |
| 5757 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bla \ |
| 5758 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5759 | 0 \ |
| 5760 | -C "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5761 | -S "SSL - Verification of the message MAC failed" |
| 5762 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 5763 | server_needs_more_time 1 |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5764 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5765 | run_test "ECJPAKE: password mismatch, DTLS" \ |
| 5766 | "$P_SRV debug_level=3 dtls=1 ecjpake_pw=bla" \ |
| 5767 | "$P_CLI debug_level=3 dtls=1 ecjpake_pw=bad \ |
| 5768 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5769 | 1 \ |
Manuel Pégourié-Gonnard | d0d8cb3 | 2015-09-17 14:16:30 +0200 | [diff] [blame] | 5770 | -c "re-using cached ecjpake parameters" \ |
Manuel Pégourié-Gonnard | 921f2d0 | 2015-09-16 22:52:18 +0200 | [diff] [blame] | 5771 | -s "SSL - Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | bf57be6 | 2015-09-16 15:04:01 +0200 | [diff] [blame] | 5772 | |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5773 | # for tests with configs/config-thread.h |
Dave Rodgman | bec7caf | 2021-06-29 19:05:34 +0100 | [diff] [blame] | 5774 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
Manuel Pégourié-Gonnard | ca700b2 | 2015-10-20 14:47:00 +0200 | [diff] [blame] | 5775 | run_test "ECJPAKE: working, DTLS, nolog" \ |
| 5776 | "$P_SRV dtls=1 ecjpake_pw=bla" \ |
| 5777 | "$P_CLI dtls=1 ecjpake_pw=bla \ |
| 5778 | force_ciphersuite=TLS-ECJPAKE-WITH-AES-128-CCM-8" \ |
| 5779 | 0 |
| 5780 | |
Manuel Pégourié-Gonnard | 4cc8c63 | 2015-07-23 12:24:03 +0200 | [diff] [blame] | 5781 | # Test for ClientHello without extensions |
| 5782 | |
Manuel Pégourié-Gonnard | d55bc20 | 2015-08-04 16:22:30 +0200 | [diff] [blame] | 5783 | requires_gnutls |
Manuel Pégourié-Gonnard | bc4da29 | 2020-01-30 12:45:14 +0100 | [diff] [blame] | 5784 | run_test "ClientHello without extensions" \ |
Manuel Pégourié-Gonnard | 77cbeff | 2020-01-30 10:58:57 +0100 | [diff] [blame] | 5785 | "$P_SRV debug_level=3" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 5786 | "$G_CLI --priority=NORMAL:%NO_EXTENSIONS:%DISABLE_SAFE_RENEGOTIATION localhost" \ |
Gilles Peskine | 5d2511c | 2017-05-12 13:16:40 +0200 | [diff] [blame] | 5787 | 0 \ |
| 5788 | -s "dumping 'client hello extensions' (0 bytes)" |
| 5789 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5790 | # Tests for mbedtls_ssl_get_bytes_avail() |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5791 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5792 | run_test "mbedtls_ssl_get_bytes_avail: no extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5793 | "$P_SRV" \ |
| 5794 | "$P_CLI request_size=100" \ |
| 5795 | 0 \ |
| 5796 | -s "Read from client: 100 bytes read$" |
| 5797 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 5798 | run_test "mbedtls_ssl_get_bytes_avail: extra data" \ |
Manuel Pégourié-Gonnard | 95c0a63 | 2014-06-11 18:32:36 +0200 | [diff] [blame] | 5799 | "$P_SRV" \ |
| 5800 | "$P_CLI request_size=500" \ |
| 5801 | 0 \ |
| 5802 | -s "Read from client: 500 bytes read (.*+.*)" |
Manuel Pégourié-Gonnard | 90805a8 | 2014-06-11 14:06:01 +0200 | [diff] [blame] | 5803 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5804 | # Tests for small client packets |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5805 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5806 | run_test "Small client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5807 | "$P_SRV" \ |
| 5808 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5809 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5810 | 0 \ |
| 5811 | -s "Read from client: 1 bytes read" |
| 5812 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5813 | 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] | 5814 | "$P_SRV" \ |
Hanno Becker | 8501f98 | 2017-11-10 08:59:04 +0000 | [diff] [blame] | 5815 | "$P_CLI request_size=1 force_version=tls1_2 \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5816 | 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] | 5817 | 0 \ |
| 5818 | -s "Read from client: 1 bytes read" |
| 5819 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5820 | 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] | 5821 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5822 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5823 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5824 | 0 \ |
| 5825 | -s "Read from client: 1 bytes read" |
| 5826 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5827 | run_test "Small client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | ee41503 | 2014-06-18 15:08:56 +0200 | [diff] [blame] | 5828 | "$P_SRV" \ |
| 5829 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5830 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5831 | 0 \ |
| 5832 | -s "Read from client: 1 bytes read" |
| 5833 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5834 | 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] | 5835 | "$P_SRV" \ |
| 5836 | "$P_CLI request_size=1 force_version=tls1_2 \ |
| 5837 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5838 | 0 \ |
| 5839 | -s "Read from client: 1 bytes read" |
| 5840 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5841 | # Tests for small client packets in DTLS |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5842 | |
| 5843 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5844 | run_test "Small client packet DTLS 1.2" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5845 | "$P_SRV dtls=1 force_version=dtls1_2" \ |
| 5846 | "$P_CLI dtls=1 request_size=1 \ |
| 5847 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5848 | 0 \ |
| 5849 | -s "Read from client: 1 bytes read" |
| 5850 | |
| 5851 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5852 | run_test "Small client packet DTLS 1.2, without EtM" \ |
Hanno Becker | 909f9a3 | 2017-11-21 17:10:12 +0000 | [diff] [blame] | 5853 | "$P_SRV dtls=1 force_version=dtls1_2 etm=0" \ |
Hanno Becker | e214804 | 2017-11-10 08:59:18 +0000 | [diff] [blame] | 5854 | "$P_CLI dtls=1 request_size=1 \ |
| 5855 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5856 | 0 \ |
| 5857 | -s "Read from client: 1 bytes read" |
| 5858 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5859 | # Tests for small server packets |
| 5860 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5861 | run_test "Small server packet TLS 1.2 BlockCipher" \ |
| 5862 | "$P_SRV response_size=1" \ |
| 5863 | "$P_CLI force_version=tls1_2 \ |
| 5864 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5865 | 0 \ |
| 5866 | -c "Read from server: 1 bytes read" |
| 5867 | |
| 5868 | run_test "Small server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5869 | "$P_SRV response_size=1" \ |
| 5870 | "$P_CLI force_version=tls1_2 \ |
| 5871 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA etm=0" \ |
| 5872 | 0 \ |
| 5873 | -c "Read from server: 1 bytes read" |
| 5874 | |
| 5875 | run_test "Small server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5876 | "$P_SRV response_size=1" \ |
| 5877 | "$P_CLI force_version=tls1_2 \ |
| 5878 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5879 | 0 \ |
| 5880 | -c "Read from server: 1 bytes read" |
| 5881 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5882 | run_test "Small server packet TLS 1.2 AEAD" \ |
| 5883 | "$P_SRV response_size=1" \ |
| 5884 | "$P_CLI force_version=tls1_2 \ |
| 5885 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5886 | 0 \ |
| 5887 | -c "Read from server: 1 bytes read" |
| 5888 | |
| 5889 | run_test "Small server packet TLS 1.2 AEAD shorter tag" \ |
| 5890 | "$P_SRV response_size=1" \ |
| 5891 | "$P_CLI force_version=tls1_2 \ |
| 5892 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5893 | 0 \ |
| 5894 | -c "Read from server: 1 bytes read" |
| 5895 | |
| 5896 | # Tests for small server packets in DTLS |
| 5897 | |
| 5898 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5899 | run_test "Small server packet DTLS 1.2" \ |
| 5900 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2" \ |
| 5901 | "$P_CLI dtls=1 \ |
| 5902 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5903 | 0 \ |
| 5904 | -c "Read from server: 1 bytes read" |
| 5905 | |
| 5906 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 5907 | run_test "Small server packet DTLS 1.2, without EtM" \ |
| 5908 | "$P_SRV dtls=1 response_size=1 force_version=dtls1_2 etm=0" \ |
| 5909 | "$P_CLI dtls=1 \ |
| 5910 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5911 | 0 \ |
| 5912 | -c "Read from server: 1 bytes read" |
| 5913 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5914 | # Test for large client packets |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5915 | |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5916 | # How many fragments do we expect to write $1 bytes? |
| 5917 | fragments_for_write() { |
| 5918 | echo "$(( ( $1 + $MAX_OUT_LEN - 1 ) / $MAX_OUT_LEN ))" |
| 5919 | } |
| 5920 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5921 | run_test "Large client packet TLS 1.2 BlockCipher" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5922 | "$P_SRV" \ |
| 5923 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5924 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5925 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5926 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5927 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5928 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5929 | run_test "Large client packet TLS 1.2 BlockCipher, without EtM" \ |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5930 | "$P_SRV" \ |
| 5931 | "$P_CLI request_size=16384 force_version=tls1_2 etm=0 \ |
| 5932 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5933 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5934 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Hanno Becker | 278fc7a | 2017-11-10 09:16:28 +0000 | [diff] [blame] | 5935 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5936 | 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] | 5937 | "$P_SRV" \ |
Manuel Pégourié-Gonnard | c82ee35 | 2015-01-07 16:35:25 +0100 | [diff] [blame] | 5938 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5939 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5940 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5941 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5942 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5943 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5944 | run_test "Large client packet TLS 1.2 AEAD" \ |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5945 | "$P_SRV" \ |
| 5946 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5947 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5948 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5949 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5950 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5951 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5952 | 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] | 5953 | "$P_SRV" \ |
| 5954 | "$P_CLI request_size=16384 force_version=tls1_2 \ |
| 5955 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 5956 | 0 \ |
Angus Gratton | c4dd073 | 2018-04-11 16:28:39 +1000 | [diff] [blame] | 5957 | -c "16384 bytes written in $(fragments_for_write 16384) fragments" \ |
| 5958 | -s "Read from client: $MAX_CONTENT_LEN bytes read" |
Manuel Pégourié-Gonnard | 8920f69 | 2014-06-18 22:05:08 +0200 | [diff] [blame] | 5959 | |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 5960 | # 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] | 5961 | run_test "Large server packet TLS 1.2 BlockCipher" \ |
| 5962 | "$P_SRV response_size=16384" \ |
| 5963 | "$P_CLI force_version=tls1_2 \ |
| 5964 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5965 | 0 \ |
| 5966 | -c "Read from server: 16384 bytes read" |
| 5967 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5968 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM" \ |
| 5969 | "$P_SRV response_size=16384" \ |
| 5970 | "$P_CLI force_version=tls1_2 etm=0 \ |
| 5971 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA" \ |
| 5972 | 0 \ |
| 5973 | -s "16384 bytes written in 1 fragments" \ |
| 5974 | -c "Read from server: 16384 bytes read" |
| 5975 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5976 | run_test "Large server packet TLS 1.2 BlockCipher larger MAC" \ |
| 5977 | "$P_SRV response_size=16384" \ |
| 5978 | "$P_CLI force_version=tls1_2 \ |
| 5979 | force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384" \ |
| 5980 | 0 \ |
| 5981 | -c "Read from server: 16384 bytes read" |
| 5982 | |
Andrzej Kurek | c19fc55 | 2018-06-19 09:37:30 -0400 | [diff] [blame] | 5983 | run_test "Large server packet TLS 1.2 BlockCipher, without EtM, truncated MAC" \ |
| 5984 | "$P_SRV response_size=16384 trunc_hmac=1" \ |
| 5985 | "$P_CLI force_version=tls1_2 \ |
| 5986 | force_ciphersuite=TLS-RSA-WITH-AES-256-CBC-SHA trunc_hmac=1 etm=0" \ |
| 5987 | 0 \ |
| 5988 | -s "16384 bytes written in 1 fragments" \ |
| 5989 | -c "Read from server: 16384 bytes read" |
| 5990 | |
Andrzej Kurek | 30e731d | 2017-10-12 13:50:29 +0200 | [diff] [blame] | 5991 | run_test "Large server packet TLS 1.2 AEAD" \ |
| 5992 | "$P_SRV response_size=16384" \ |
| 5993 | "$P_CLI force_version=tls1_2 \ |
| 5994 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM" \ |
| 5995 | 0 \ |
| 5996 | -c "Read from server: 16384 bytes read" |
| 5997 | |
| 5998 | run_test "Large server packet TLS 1.2 AEAD shorter tag" \ |
| 5999 | "$P_SRV response_size=16384" \ |
| 6000 | "$P_CLI force_version=tls1_2 \ |
| 6001 | force_ciphersuite=TLS-RSA-WITH-AES-256-CCM-8" \ |
| 6002 | 0 \ |
| 6003 | -c "Read from server: 16384 bytes read" |
| 6004 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6005 | # Tests for restartable ECC |
| 6006 | |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6007 | # Force the use of a curve that supports restartable ECC (secp256r1). |
| 6008 | |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6009 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6010 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6011 | run_test "EC restart: TLS, default" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6012 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6013 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 862cde5 | 2017-05-17 11:56:15 +0200 | [diff] [blame] | 6014 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6015 | debug_level=1" \ |
| 6016 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6017 | -C "x509_verify_cert.*4b00" \ |
| 6018 | -C "mbedtls_pk_verify.*4b00" \ |
| 6019 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6020 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6021 | |
| 6022 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6023 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6024 | run_test "EC restart: TLS, max_ops=0" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6025 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6026 | "$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] | 6027 | 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] | 6028 | debug_level=1 ec_max_ops=0" \ |
| 6029 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6030 | -C "x509_verify_cert.*4b00" \ |
| 6031 | -C "mbedtls_pk_verify.*4b00" \ |
| 6032 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6033 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6034 | |
| 6035 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6036 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6037 | run_test "EC restart: TLS, max_ops=65535" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6038 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6039 | "$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] | 6040 | 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] | 6041 | debug_level=1 ec_max_ops=65535" \ |
| 6042 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6043 | -C "x509_verify_cert.*4b00" \ |
| 6044 | -C "mbedtls_pk_verify.*4b00" \ |
| 6045 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6046 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6047 | |
| 6048 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6049 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6050 | run_test "EC restart: TLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6051 | "$P_SRV curves=secp256r1 auth_mode=required" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6052 | "$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] | 6053 | 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] | 6054 | debug_level=1 ec_max_ops=1000" \ |
| 6055 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6056 | -c "x509_verify_cert.*4b00" \ |
| 6057 | -c "mbedtls_pk_verify.*4b00" \ |
| 6058 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6059 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 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 | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6063 | run_test "EC restart: TLS, max_ops=1000, badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6064 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6065 | crt_file=data_files/server5-badsign.crt \ |
| 6066 | key_file=data_files/server5.key" \ |
| 6067 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6068 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6069 | debug_level=1 ec_max_ops=1000" \ |
| 6070 | 1 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6071 | -c "x509_verify_cert.*4b00" \ |
| 6072 | -C "mbedtls_pk_verify.*4b00" \ |
| 6073 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6074 | -C "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6075 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6076 | -c "! mbedtls_ssl_handshake returned" \ |
| 6077 | -c "X509 - Certificate verification failed" |
| 6078 | |
| 6079 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6080 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6081 | run_test "EC restart: TLS, max_ops=1000, auth_mode=optional badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6082 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6083 | crt_file=data_files/server5-badsign.crt \ |
| 6084 | key_file=data_files/server5.key" \ |
| 6085 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6086 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6087 | debug_level=1 ec_max_ops=1000 auth_mode=optional" \ |
| 6088 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6089 | -c "x509_verify_cert.*4b00" \ |
| 6090 | -c "mbedtls_pk_verify.*4b00" \ |
| 6091 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6092 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6093 | -c "! The certificate is not correctly signed by the trusted CA" \ |
| 6094 | -C "! mbedtls_ssl_handshake returned" \ |
| 6095 | -C "X509 - Certificate verification failed" |
| 6096 | |
| 6097 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6098 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6099 | run_test "EC restart: TLS, max_ops=1000, auth_mode=none badsign" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6100 | "$P_SRV curves=secp256r1 auth_mode=required \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6101 | crt_file=data_files/server5-badsign.crt \ |
| 6102 | key_file=data_files/server5.key" \ |
| 6103 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6104 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6105 | debug_level=1 ec_max_ops=1000 auth_mode=none" \ |
| 6106 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6107 | -C "x509_verify_cert.*4b00" \ |
| 6108 | -c "mbedtls_pk_verify.*4b00" \ |
| 6109 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6110 | -c "mbedtls_pk_sign.*4b00" \ |
Manuel Pégourié-Gonnard | 3bf49c4 | 2017-08-15 13:47:06 +0200 | [diff] [blame] | 6111 | -C "! The certificate is not correctly signed by the trusted CA" \ |
| 6112 | -C "! mbedtls_ssl_handshake returned" \ |
| 6113 | -C "X509 - Certificate verification failed" |
| 6114 | |
| 6115 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6116 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6117 | run_test "EC restart: DTLS, max_ops=1000" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6118 | "$P_SRV curves=secp256r1 auth_mode=required dtls=1" \ |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6119 | "$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] | 6120 | 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] | 6121 | dtls=1 debug_level=1 ec_max_ops=1000" \ |
| 6122 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6123 | -c "x509_verify_cert.*4b00" \ |
| 6124 | -c "mbedtls_pk_verify.*4b00" \ |
| 6125 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6126 | -c "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 2350b4e | 2017-05-16 09:26:48 +0200 | [diff] [blame] | 6127 | |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6128 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6129 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6130 | run_test "EC restart: TLS, max_ops=1000 no client auth" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6131 | "$P_SRV curves=secp256r1" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6132 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 6133 | debug_level=1 ec_max_ops=1000" \ |
| 6134 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6135 | -c "x509_verify_cert.*4b00" \ |
| 6136 | -c "mbedtls_pk_verify.*4b00" \ |
| 6137 | -c "mbedtls_ecdh_make_public.*4b00" \ |
| 6138 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6139 | |
| 6140 | requires_config_enabled MBEDTLS_ECP_RESTARTABLE |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6141 | requires_config_enabled MBEDTLS_ECP_DP_SECP256R1_ENABLED |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6142 | run_test "EC restart: TLS, max_ops=1000, ECDHE-PSK" \ |
Gilles Peskine | 4a02cef | 2021-06-03 11:12:40 +0200 | [diff] [blame] | 6143 | "$P_SRV curves=secp256r1 psk=abc123" \ |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6144 | "$P_CLI force_ciphersuite=TLS-ECDHE-PSK-WITH-AES-128-CBC-SHA256 \ |
| 6145 | psk=abc123 debug_level=1 ec_max_ops=1000" \ |
| 6146 | 0 \ |
Manuel Pégourié-Gonnard | b5d668a | 2018-06-13 11:22:01 +0200 | [diff] [blame] | 6147 | -C "x509_verify_cert.*4b00" \ |
| 6148 | -C "mbedtls_pk_verify.*4b00" \ |
| 6149 | -C "mbedtls_ecdh_make_public.*4b00" \ |
| 6150 | -C "mbedtls_pk_sign.*4b00" |
Manuel Pégourié-Gonnard | 32033da | 2017-05-18 12:49:27 +0200 | [diff] [blame] | 6151 | |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6152 | # Tests of asynchronous private key support in SSL |
| 6153 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6154 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6155 | run_test "SSL async private: sign, delay=0" \ |
| 6156 | "$P_SRV \ |
| 6157 | async_operations=s async_private_delay1=0 async_private_delay2=0" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6158 | "$P_CLI" \ |
| 6159 | 0 \ |
| 6160 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6161 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6162 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6163 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6164 | run_test "SSL async private: sign, delay=1" \ |
| 6165 | "$P_SRV \ |
| 6166 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6167 | "$P_CLI" \ |
| 6168 | 0 \ |
| 6169 | -s "Async sign callback: using key slot " \ |
| 6170 | -s "Async resume (slot [0-9]): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6171 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6172 | |
Gilles Peskine | 12d0cc1 | 2018-04-26 15:06:56 +0200 | [diff] [blame] | 6173 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6174 | run_test "SSL async private: sign, delay=2" \ |
| 6175 | "$P_SRV \ |
| 6176 | async_operations=s async_private_delay1=2 async_private_delay2=2" \ |
| 6177 | "$P_CLI" \ |
| 6178 | 0 \ |
| 6179 | -s "Async sign callback: using key slot " \ |
| 6180 | -U "Async sign callback: using key slot " \ |
| 6181 | -s "Async resume (slot [0-9]): call 1 more times." \ |
| 6182 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6183 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6184 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6185 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Hanno Becker | c5722d1 | 2020-10-09 11:10:42 +0100 | [diff] [blame] | 6186 | requires_config_disabled MBEDTLS_X509_REMOVE_INFO |
Gilles Peskine | 807d74a | 2018-04-30 10:30:49 +0200 | [diff] [blame] | 6187 | run_test "SSL async private: sign, SNI" \ |
| 6188 | "$P_SRV debug_level=3 \ |
| 6189 | async_operations=s async_private_delay1=0 async_private_delay2=0 \ |
| 6190 | crt_file=data_files/server5.crt key_file=data_files/server5.key \ |
| 6191 | sni=localhost,data_files/server2.crt,data_files/server2.key,-,-,-,polarssl.example,data_files/server1-nospace.crt,data_files/server1.key,-,-,-" \ |
| 6192 | "$P_CLI server_name=polarssl.example" \ |
| 6193 | 0 \ |
| 6194 | -s "Async sign callback: using key slot " \ |
| 6195 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6196 | -s "parse ServerName extension" \ |
| 6197 | -c "issuer name *: C=NL, O=PolarSSL, CN=PolarSSL Test CA" \ |
| 6198 | -c "subject name *: C=NL, O=PolarSSL, CN=polarssl.example" |
| 6199 | |
| 6200 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6201 | run_test "SSL async private: decrypt, delay=0" \ |
| 6202 | "$P_SRV \ |
| 6203 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6204 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6205 | 0 \ |
| 6206 | -s "Async decrypt callback: using key slot " \ |
| 6207 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6208 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6209 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6210 | run_test "SSL async private: decrypt, delay=1" \ |
| 6211 | "$P_SRV \ |
| 6212 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6213 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6214 | 0 \ |
| 6215 | -s "Async decrypt callback: using key slot " \ |
| 6216 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6217 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6218 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6219 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6220 | run_test "SSL async private: decrypt RSA-PSK, delay=0" \ |
| 6221 | "$P_SRV psk=abc123 \ |
| 6222 | async_operations=d async_private_delay1=0 async_private_delay2=0" \ |
| 6223 | "$P_CLI psk=abc123 \ |
| 6224 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6225 | 0 \ |
| 6226 | -s "Async decrypt callback: using key slot " \ |
| 6227 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6228 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6229 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6230 | run_test "SSL async private: decrypt RSA-PSK, delay=1" \ |
| 6231 | "$P_SRV psk=abc123 \ |
| 6232 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6233 | "$P_CLI psk=abc123 \ |
| 6234 | force_ciphersuite=TLS-RSA-PSK-WITH-AES-128-CBC-SHA256" \ |
| 6235 | 0 \ |
| 6236 | -s "Async decrypt callback: using key slot " \ |
| 6237 | -s "Async resume (slot [0-9]): call 0 more times." \ |
| 6238 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6239 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6240 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6241 | run_test "SSL async private: sign callback not present" \ |
| 6242 | "$P_SRV \ |
| 6243 | async_operations=d async_private_delay1=1 async_private_delay2=1" \ |
| 6244 | "$P_CLI; [ \$? -eq 1 ] && |
| 6245 | $P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6246 | 0 \ |
| 6247 | -S "Async sign callback" \ |
| 6248 | -s "! mbedtls_ssl_handshake returned" \ |
| 6249 | -s "The own private key or pre-shared key is not set, but needed" \ |
| 6250 | -s "Async resume (slot [0-9]): decrypt done, status=0" \ |
| 6251 | -s "Successful connection" |
| 6252 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6253 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6254 | run_test "SSL async private: decrypt callback not present" \ |
| 6255 | "$P_SRV debug_level=1 \ |
| 6256 | async_operations=s async_private_delay1=1 async_private_delay2=1" \ |
| 6257 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA; |
| 6258 | [ \$? -eq 1 ] && $P_CLI" \ |
| 6259 | 0 \ |
| 6260 | -S "Async decrypt callback" \ |
| 6261 | -s "! mbedtls_ssl_handshake returned" \ |
| 6262 | -s "got no RSA private key" \ |
| 6263 | -s "Async resume (slot [0-9]): sign done, status=0" \ |
| 6264 | -s "Successful connection" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6265 | |
| 6266 | # key1: ECDSA, key2: RSA; use key1 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6267 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6268 | run_test "SSL async private: slot 0 used with key1" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6269 | "$P_SRV \ |
| 6270 | async_operations=s async_private_delay1=1 \ |
| 6271 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6272 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6273 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6274 | 0 \ |
| 6275 | -s "Async sign callback: using key slot 0," \ |
| 6276 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6277 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6278 | |
| 6279 | # key1: ECDSA, key2: RSA; use key2 from slot 0 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6280 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6281 | run_test "SSL async private: slot 0 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6282 | "$P_SRV \ |
| 6283 | async_operations=s async_private_delay2=1 \ |
| 6284 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6285 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6286 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6287 | 0 \ |
| 6288 | -s "Async sign callback: using key slot 0," \ |
| 6289 | -s "Async resume (slot 0): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6290 | -s "Async resume (slot 0): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6291 | |
| 6292 | # key1: ECDSA, key2: RSA; use key2 from slot 1 |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6293 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | ad28bf0 | 2018-04-26 00:19:16 +0200 | [diff] [blame] | 6294 | run_test "SSL async private: slot 1 used with key2" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6295 | "$P_SRV \ |
Gilles Peskine | 168dae8 | 2018-04-25 23:35:42 +0200 | [diff] [blame] | 6296 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6297 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6298 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6299 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6300 | 0 \ |
| 6301 | -s "Async sign callback: using key slot 1," \ |
| 6302 | -s "Async resume (slot 1): call 0 more times." \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6303 | -s "Async resume (slot 1): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6304 | |
| 6305 | # key1: ECDSA, key2: RSA; use key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6306 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6307 | run_test "SSL async private: fall back to transparent key" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6308 | "$P_SRV \ |
| 6309 | async_operations=s async_private_delay1=1 \ |
| 6310 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6311 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt " \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6312 | "$P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6313 | 0 \ |
| 6314 | -s "Async sign callback: no key matches this certificate." |
| 6315 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6316 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6317 | run_test "SSL async private: sign, error in start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6318 | "$P_SRV \ |
| 6319 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6320 | async_private_error=1" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6321 | "$P_CLI" \ |
| 6322 | 1 \ |
| 6323 | -s "Async sign callback: injected error" \ |
| 6324 | -S "Async resume" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6325 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6326 | -s "! mbedtls_ssl_handshake returned" |
| 6327 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6328 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6329 | run_test "SSL async private: sign, cancel after start" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6330 | "$P_SRV \ |
| 6331 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6332 | async_private_error=2" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6333 | "$P_CLI" \ |
| 6334 | 1 \ |
| 6335 | -s "Async sign callback: using key slot " \ |
| 6336 | -S "Async resume" \ |
| 6337 | -s "Async cancel" |
| 6338 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6339 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6340 | run_test "SSL async private: sign, error in resume" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6341 | "$P_SRV \ |
| 6342 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6343 | async_private_error=3" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6344 | "$P_CLI" \ |
| 6345 | 1 \ |
| 6346 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6347 | -s "Async resume callback: sign done but injected error" \ |
Gilles Peskine | 37289cd | 2018-04-27 11:50:14 +0200 | [diff] [blame] | 6348 | -S "Async cancel" \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6349 | -s "! mbedtls_ssl_handshake returned" |
| 6350 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6351 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6352 | run_test "SSL async private: decrypt, error in start" \ |
| 6353 | "$P_SRV \ |
| 6354 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6355 | async_private_error=1" \ |
| 6356 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6357 | 1 \ |
| 6358 | -s "Async decrypt callback: injected error" \ |
| 6359 | -S "Async resume" \ |
| 6360 | -S "Async cancel" \ |
| 6361 | -s "! mbedtls_ssl_handshake returned" |
| 6362 | |
| 6363 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6364 | run_test "SSL async private: decrypt, cancel after start" \ |
| 6365 | "$P_SRV \ |
| 6366 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6367 | async_private_error=2" \ |
| 6368 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6369 | 1 \ |
| 6370 | -s "Async decrypt callback: using key slot " \ |
| 6371 | -S "Async resume" \ |
| 6372 | -s "Async cancel" |
| 6373 | |
| 6374 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
| 6375 | run_test "SSL async private: decrypt, error in resume" \ |
| 6376 | "$P_SRV \ |
| 6377 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6378 | async_private_error=3" \ |
| 6379 | "$P_CLI force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6380 | 1 \ |
| 6381 | -s "Async decrypt callback: using key slot " \ |
| 6382 | -s "Async resume callback: decrypt done but injected error" \ |
| 6383 | -S "Async cancel" \ |
| 6384 | -s "! mbedtls_ssl_handshake returned" |
| 6385 | |
| 6386 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6387 | run_test "SSL async private: cancel after start then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6388 | "$P_SRV \ |
| 6389 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6390 | async_private_error=-2" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6391 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6392 | 0 \ |
| 6393 | -s "Async cancel" \ |
| 6394 | -s "! mbedtls_ssl_handshake returned" \ |
| 6395 | -s "Async resume" \ |
| 6396 | -s "Successful connection" |
| 6397 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6398 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6399 | run_test "SSL async private: error in resume then operate correctly" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6400 | "$P_SRV \ |
| 6401 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
| 6402 | async_private_error=-3" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6403 | "$P_CLI; [ \$? -eq 1 ] && $P_CLI" \ |
| 6404 | 0 \ |
| 6405 | -s "! mbedtls_ssl_handshake returned" \ |
| 6406 | -s "Async resume" \ |
| 6407 | -s "Successful connection" |
| 6408 | |
| 6409 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6410 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6411 | 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] | 6412 | "$P_SRV \ |
| 6413 | async_operations=s async_private_delay1=1 async_private_error=-2 \ |
| 6414 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6415 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6416 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6417 | [ \$? -eq 1 ] && |
| 6418 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6419 | 0 \ |
Gilles Peskine | deda75a | 2018-04-30 10:02:45 +0200 | [diff] [blame] | 6420 | -s "Async sign callback: using key slot 0" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6421 | -S "Async resume" \ |
| 6422 | -s "Async cancel" \ |
| 6423 | -s "! mbedtls_ssl_handshake returned" \ |
| 6424 | -s "Async sign callback: no key matches this certificate." \ |
| 6425 | -s "Successful connection" |
| 6426 | |
| 6427 | # key1: ECDSA, key2: RSA; use key1 through async, then key2 directly |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6428 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 725f1cb | 2018-06-12 15:06:40 +0200 | [diff] [blame] | 6429 | 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] | 6430 | "$P_SRV \ |
| 6431 | async_operations=s async_private_delay1=1 async_private_error=-3 \ |
| 6432 | key_file=data_files/server5.key crt_file=data_files/server5.crt \ |
| 6433 | key_file2=data_files/server2.key crt_file2=data_files/server2.crt" \ |
Gilles Peskine | 60ee4ca | 2018-01-08 11:28:05 +0100 | [diff] [blame] | 6434 | "$P_CLI force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256; |
| 6435 | [ \$? -eq 1 ] && |
| 6436 | $P_CLI force_ciphersuite=TLS-ECDHE-RSA-WITH-AES-128-CBC-SHA256" \ |
| 6437 | 0 \ |
| 6438 | -s "Async resume" \ |
| 6439 | -s "! mbedtls_ssl_handshake returned" \ |
| 6440 | -s "Async sign callback: no key matches this certificate." \ |
| 6441 | -s "Successful connection" |
| 6442 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6443 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6444 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6445 | run_test "SSL async private: renegotiation: client-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6446 | "$P_SRV \ |
| 6447 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6448 | exchanges=2 renegotiation=1" \ |
| 6449 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6450 | 0 \ |
| 6451 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6452 | -s "Async resume (slot [0-9]): sign done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6453 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6454 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6455 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6456 | run_test "SSL async private: renegotiation: server-initiated, sign" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6457 | "$P_SRV \ |
| 6458 | async_operations=s async_private_delay1=1 async_private_delay2=1 \ |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6459 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6460 | "$P_CLI exchanges=2 renegotiation=1" \ |
| 6461 | 0 \ |
| 6462 | -s "Async sign callback: using key slot " \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6463 | -s "Async resume (slot [0-9]): sign done, status=0" |
| 6464 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6465 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6466 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6467 | run_test "SSL async private: renegotiation: client-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6468 | "$P_SRV \ |
| 6469 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6470 | exchanges=2 renegotiation=1" \ |
| 6471 | "$P_CLI exchanges=2 renegotiation=1 renegotiate=1 \ |
| 6472 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6473 | 0 \ |
| 6474 | -s "Async decrypt callback: using key slot " \ |
| 6475 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
| 6476 | |
Gilles Peskine | b74a1c7 | 2018-04-24 13:09:22 +0200 | [diff] [blame] | 6477 | requires_config_enabled MBEDTLS_SSL_ASYNC_PRIVATE |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6478 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Gilles Peskine | 654bab7 | 2019-09-16 15:19:20 +0200 | [diff] [blame] | 6479 | run_test "SSL async private: renegotiation: server-initiated, decrypt" \ |
Gilles Peskine | fcca9d8 | 2018-01-12 13:47:48 +0100 | [diff] [blame] | 6480 | "$P_SRV \ |
| 6481 | async_operations=d async_private_delay1=1 async_private_delay2=1 \ |
| 6482 | exchanges=2 renegotiation=1 renegotiate=1" \ |
| 6483 | "$P_CLI exchanges=2 renegotiation=1 \ |
| 6484 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 6485 | 0 \ |
| 6486 | -s "Async decrypt callback: using key slot " \ |
| 6487 | -s "Async resume (slot [0-9]): decrypt done, status=0" |
Gilles Peskine | 3665f1d | 2018-01-05 21:22:12 +0100 | [diff] [blame] | 6488 | |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6489 | # Tests for ECC extensions (rfc 4492) |
| 6490 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6491 | requires_config_enabled MBEDTLS_AES_C |
| 6492 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6493 | requires_config_enabled MBEDTLS_SHA256_C |
| 6494 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6495 | run_test "Force a non ECC ciphersuite in the client side" \ |
| 6496 | "$P_SRV debug_level=3" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6497 | "$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] | 6498 | 0 \ |
| 6499 | -C "client hello, adding supported_elliptic_curves extension" \ |
| 6500 | -C "client hello, adding supported_point_formats extension" \ |
| 6501 | -S "found supported elliptic curves extension" \ |
| 6502 | -S "found supported point formats extension" |
| 6503 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6504 | requires_config_enabled MBEDTLS_AES_C |
| 6505 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6506 | requires_config_enabled MBEDTLS_SHA256_C |
| 6507 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6508 | run_test "Force a non ECC ciphersuite in the server side" \ |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6509 | "$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] | 6510 | "$P_CLI debug_level=3" \ |
| 6511 | 0 \ |
| 6512 | -C "found supported_point_formats extension" \ |
| 6513 | -S "server hello, supported_point_formats extension" |
| 6514 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6515 | requires_config_enabled MBEDTLS_AES_C |
| 6516 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6517 | requires_config_enabled MBEDTLS_SHA256_C |
| 6518 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6519 | run_test "Force an ECC ciphersuite in the client side" \ |
| 6520 | "$P_SRV debug_level=3" \ |
| 6521 | "$P_CLI debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6522 | 0 \ |
| 6523 | -c "client hello, adding supported_elliptic_curves extension" \ |
| 6524 | -c "client hello, adding supported_point_formats extension" \ |
| 6525 | -s "found supported elliptic curves extension" \ |
| 6526 | -s "found supported point formats extension" |
| 6527 | |
Ron Eldor | 643df7c | 2018-06-28 16:17:00 +0300 | [diff] [blame] | 6528 | requires_config_enabled MBEDTLS_AES_C |
| 6529 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 6530 | requires_config_enabled MBEDTLS_SHA256_C |
| 6531 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Ron Eldor | 58093c8 | 2018-06-28 13:22:05 +0300 | [diff] [blame] | 6532 | run_test "Force an ECC ciphersuite in the server side" \ |
| 6533 | "$P_SRV debug_level=3 force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256" \ |
| 6534 | "$P_CLI debug_level=3" \ |
| 6535 | 0 \ |
| 6536 | -c "found supported_point_formats extension" \ |
| 6537 | -s "server hello, supported_point_formats extension" |
| 6538 | |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6539 | # Tests for DTLS HelloVerifyRequest |
| 6540 | |
| 6541 | run_test "DTLS cookie: enabled" \ |
| 6542 | "$P_SRV dtls=1 debug_level=2" \ |
| 6543 | "$P_CLI dtls=1 debug_level=2" \ |
| 6544 | 0 \ |
| 6545 | -s "cookie verification failed" \ |
| 6546 | -s "cookie verification passed" \ |
| 6547 | -S "cookie verification skipped" \ |
| 6548 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6549 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6550 | -S "SSL - The requested feature is not available" |
| 6551 | |
| 6552 | run_test "DTLS cookie: disabled" \ |
| 6553 | "$P_SRV dtls=1 debug_level=2 cookies=0" \ |
| 6554 | "$P_CLI dtls=1 debug_level=2" \ |
| 6555 | 0 \ |
| 6556 | -S "cookie verification failed" \ |
| 6557 | -S "cookie verification passed" \ |
| 6558 | -s "cookie verification skipped" \ |
| 6559 | -C "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6560 | -S "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6561 | -S "SSL - The requested feature is not available" |
| 6562 | |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6563 | run_test "DTLS cookie: default (failing)" \ |
| 6564 | "$P_SRV dtls=1 debug_level=2 cookies=-1" \ |
| 6565 | "$P_CLI dtls=1 debug_level=2 hs_timeout=100-400" \ |
| 6566 | 1 \ |
| 6567 | -s "cookie verification failed" \ |
| 6568 | -S "cookie verification passed" \ |
| 6569 | -S "cookie verification skipped" \ |
| 6570 | -C "received hello verify request" \ |
| 6571 | -S "hello verification requested" \ |
| 6572 | -s "SSL - The requested feature is not available" |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6573 | |
| 6574 | requires_ipv6 |
| 6575 | run_test "DTLS cookie: enabled, IPv6" \ |
| 6576 | "$P_SRV dtls=1 debug_level=2 server_addr=::1" \ |
| 6577 | "$P_CLI dtls=1 debug_level=2 server_addr=::1" \ |
| 6578 | 0 \ |
| 6579 | -s "cookie verification failed" \ |
| 6580 | -s "cookie verification passed" \ |
| 6581 | -S "cookie verification skipped" \ |
| 6582 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6583 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 0eb6cab | 2014-07-23 20:17:47 +0200 | [diff] [blame] | 6584 | -S "SSL - The requested feature is not available" |
| 6585 | |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6586 | run_test "DTLS cookie: enabled, nbio" \ |
| 6587 | "$P_SRV dtls=1 nbio=2 debug_level=2" \ |
| 6588 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6589 | 0 \ |
| 6590 | -s "cookie verification failed" \ |
| 6591 | -s "cookie verification passed" \ |
| 6592 | -S "cookie verification skipped" \ |
| 6593 | -c "received hello verify request" \ |
Manuel Pégourié-Gonnard | caecdae | 2014-10-13 19:04:37 +0200 | [diff] [blame] | 6594 | -s "hello verification requested" \ |
Manuel Pégourié-Gonnard | 579950c | 2014-09-29 17:47:33 +0200 | [diff] [blame] | 6595 | -S "SSL - The requested feature is not available" |
| 6596 | |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6597 | # Tests for client reconnecting from the same port with DTLS |
| 6598 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6599 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6600 | run_test "DTLS client reconnect from same port: reference" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6601 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6602 | "$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] | 6603 | 0 \ |
| 6604 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6605 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6606 | -S "Client initiated reconnection from same port" |
| 6607 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6608 | not_with_valgrind # spurious resend |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6609 | run_test "DTLS client reconnect from same port: reconnect" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 6610 | "$P_SRV dtls=1 exchanges=2 read_timeout=20000 hs_timeout=10000-20000" \ |
| 6611 | "$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] | 6612 | 0 \ |
| 6613 | -C "resend" \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6614 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6615 | -s "Client initiated reconnection from same port" |
| 6616 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6617 | not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) |
| 6618 | 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] | 6619 | "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ |
| 6620 | "$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] | 6621 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6622 | -S "The operation timed out" \ |
Manuel Pégourié-Gonnard | d745a1a | 2015-09-08 12:40:43 +0200 | [diff] [blame] | 6623 | -s "Client initiated reconnection from same port" |
| 6624 | |
Paul Bakker | 362689d | 2016-05-13 10:33:25 +0100 | [diff] [blame] | 6625 | only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout |
| 6626 | run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ |
| 6627 | "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ |
| 6628 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ |
| 6629 | 0 \ |
| 6630 | -S "The operation timed out" \ |
| 6631 | -s "Client initiated reconnection from same port" |
| 6632 | |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6633 | run_test "DTLS client reconnect from same port: no cookies" \ |
| 6634 | "$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] | 6635 | "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ |
| 6636 | 0 \ |
Manuel Pégourié-Gonnard | 259db91 | 2015-09-09 11:37:17 +0200 | [diff] [blame] | 6637 | -s "The operation timed out" \ |
| 6638 | -S "Client initiated reconnection from same port" |
| 6639 | |
Manuel Pégourié-Gonnard | baad2de | 2020-03-13 11:11:02 +0100 | [diff] [blame] | 6640 | run_test "DTLS client reconnect from same port: attacker-injected" \ |
| 6641 | -p "$P_PXY inject_clihlo=1" \ |
| 6642 | "$P_SRV dtls=1 exchanges=2 debug_level=1" \ |
| 6643 | "$P_CLI dtls=1 exchanges=2" \ |
| 6644 | 0 \ |
| 6645 | -s "possible client reconnect from the same port" \ |
| 6646 | -S "Client initiated reconnection from same port" |
| 6647 | |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6648 | # Tests for various cases of client authentication with DTLS |
| 6649 | # (focused on handshake flows and message parsing) |
| 6650 | |
| 6651 | run_test "DTLS client auth: required" \ |
| 6652 | "$P_SRV dtls=1 auth_mode=required" \ |
| 6653 | "$P_CLI dtls=1" \ |
| 6654 | 0 \ |
| 6655 | -s "Verifying peer X.509 certificate... ok" |
| 6656 | |
| 6657 | run_test "DTLS client auth: optional, client has no cert" \ |
| 6658 | "$P_SRV dtls=1 auth_mode=optional" \ |
| 6659 | "$P_CLI dtls=1 crt_file=none key_file=none" \ |
| 6660 | 0 \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6661 | -s "! Certificate was missing" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6662 | |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6663 | run_test "DTLS client auth: none, client has no cert" \ |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6664 | "$P_SRV dtls=1 auth_mode=none" \ |
| 6665 | "$P_CLI dtls=1 crt_file=none key_file=none debug_level=2" \ |
| 6666 | 0 \ |
| 6667 | -c "skip write certificate$" \ |
Manuel Pégourié-Gonnard | 89addc4 | 2015-04-20 10:56:18 +0100 | [diff] [blame] | 6668 | -s "! Certificate verification was skipped" |
Manuel Pégourié-Gonnard | 08a1d4b | 2014-09-26 10:35:50 +0200 | [diff] [blame] | 6669 | |
Manuel Pégourié-Gonnard | 0a88574 | 2015-08-04 12:08:35 +0200 | [diff] [blame] | 6670 | run_test "DTLS wrong PSK: badmac alert" \ |
| 6671 | "$P_SRV dtls=1 psk=abc123 force_ciphersuite=TLS-PSK-WITH-AES-128-GCM-SHA256" \ |
| 6672 | "$P_CLI dtls=1 psk=abc124" \ |
| 6673 | 1 \ |
| 6674 | -s "SSL - Verification of the message MAC failed" \ |
| 6675 | -c "SSL - A fatal alert message was received from our peer" |
| 6676 | |
Manuel Pégourié-Gonnard | 502bf30 | 2014-08-20 13:12:58 +0200 | [diff] [blame] | 6677 | # Tests for receiving fragmented handshake messages with DTLS |
| 6678 | |
| 6679 | requires_gnutls |
| 6680 | run_test "DTLS reassembly: no fragmentation (gnutls server)" \ |
| 6681 | "$G_SRV -u --mtu 2048 -a" \ |
| 6682 | "$P_CLI dtls=1 debug_level=2" \ |
| 6683 | 0 \ |
| 6684 | -C "found fragmented DTLS handshake message" \ |
| 6685 | -C "error" |
| 6686 | |
| 6687 | requires_gnutls |
| 6688 | run_test "DTLS reassembly: some fragmentation (gnutls server)" \ |
| 6689 | "$G_SRV -u --mtu 512" \ |
| 6690 | "$P_CLI dtls=1 debug_level=2" \ |
| 6691 | 0 \ |
| 6692 | -c "found fragmented DTLS handshake message" \ |
| 6693 | -C "error" |
| 6694 | |
| 6695 | requires_gnutls |
| 6696 | run_test "DTLS reassembly: more fragmentation (gnutls server)" \ |
| 6697 | "$G_SRV -u --mtu 128" \ |
| 6698 | "$P_CLI dtls=1 debug_level=2" \ |
| 6699 | 0 \ |
| 6700 | -c "found fragmented DTLS handshake message" \ |
| 6701 | -C "error" |
| 6702 | |
| 6703 | requires_gnutls |
| 6704 | run_test "DTLS reassembly: more fragmentation, nbio (gnutls server)" \ |
| 6705 | "$G_SRV -u --mtu 128" \ |
| 6706 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6707 | 0 \ |
| 6708 | -c "found fragmented DTLS handshake message" \ |
| 6709 | -C "error" |
| 6710 | |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6711 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6712 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6713 | run_test "DTLS reassembly: fragmentation, renego (gnutls server)" \ |
| 6714 | "$G_SRV -u --mtu 256" \ |
| 6715 | "$P_CLI debug_level=3 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6716 | 0 \ |
| 6717 | -c "found fragmented DTLS handshake message" \ |
| 6718 | -c "client hello, adding renegotiation extension" \ |
| 6719 | -c "found renegotiation extension" \ |
| 6720 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6721 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6722 | -C "error" \ |
| 6723 | -s "Extra-header:" |
| 6724 | |
| 6725 | requires_gnutls |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 6726 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6727 | run_test "DTLS reassembly: fragmentation, nbio, renego (gnutls server)" \ |
| 6728 | "$G_SRV -u --mtu 256" \ |
| 6729 | "$P_CLI debug_level=3 nbio=2 dtls=1 renegotiation=1 renegotiate=1" \ |
| 6730 | 0 \ |
| 6731 | -c "found fragmented DTLS handshake message" \ |
| 6732 | -c "client hello, adding renegotiation extension" \ |
| 6733 | -c "found renegotiation extension" \ |
| 6734 | -c "=> renegotiate" \ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 6735 | -C "mbedtls_ssl_handshake returned" \ |
Manuel Pégourié-Gonnard | 0c4cbc7 | 2014-09-02 14:47:31 +0200 | [diff] [blame] | 6736 | -C "error" \ |
| 6737 | -s "Extra-header:" |
| 6738 | |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 6739 | run_test "DTLS reassembly: no fragmentation (openssl server)" \ |
| 6740 | "$O_SRV -dtls -mtu 2048" \ |
| 6741 | "$P_CLI dtls=1 debug_level=2" \ |
| 6742 | 0 \ |
| 6743 | -C "found fragmented DTLS handshake message" \ |
| 6744 | -C "error" |
| 6745 | |
| 6746 | run_test "DTLS reassembly: some fragmentation (openssl server)" \ |
| 6747 | "$O_SRV -dtls -mtu 768" \ |
| 6748 | "$P_CLI dtls=1 debug_level=2" \ |
| 6749 | 0 \ |
| 6750 | -c "found fragmented DTLS handshake message" \ |
| 6751 | -C "error" |
| 6752 | |
| 6753 | run_test "DTLS reassembly: more fragmentation (openssl server)" \ |
| 6754 | "$O_SRV -dtls -mtu 256" \ |
| 6755 | "$P_CLI dtls=1 debug_level=2" \ |
| 6756 | 0 \ |
| 6757 | -c "found fragmented DTLS handshake message" \ |
| 6758 | -C "error" |
| 6759 | |
| 6760 | run_test "DTLS reassembly: fragmentation, nbio (openssl server)" \ |
| 6761 | "$O_SRV -dtls -mtu 256" \ |
| 6762 | "$P_CLI dtls=1 nbio=2 debug_level=2" \ |
| 6763 | 0 \ |
| 6764 | -c "found fragmented DTLS handshake message" \ |
| 6765 | -C "error" |
| 6766 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6767 | # Tests for sending fragmented handshake messages with DTLS |
| 6768 | # |
| 6769 | # Use client auth when we need the client to send large messages, |
| 6770 | # and use large cert chains on both sides too (the long chains we have all use |
| 6771 | # both RSA and ECDSA, but ideally we should have long chains with either). |
| 6772 | # Sizes reached (UDP payload): |
| 6773 | # - 2037B for server certificate |
| 6774 | # - 1542B for client certificate |
| 6775 | # - 1013B for newsessionticket |
| 6776 | # - all others below 512B |
| 6777 | # All those tests assume MAX_CONTENT_LEN is at least 2048 |
| 6778 | |
| 6779 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6780 | requires_config_enabled MBEDTLS_RSA_C |
| 6781 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6782 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6783 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6784 | run_test "DTLS fragmenting: none (for reference)" \ |
| 6785 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6786 | crt_file=data_files/server7_int-ca.crt \ |
| 6787 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6788 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6789 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6790 | "$P_CLI dtls=1 debug_level=2 \ |
| 6791 | crt_file=data_files/server8_int-ca2.crt \ |
| 6792 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6793 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6794 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6795 | 0 \ |
| 6796 | -S "found fragmented DTLS handshake message" \ |
| 6797 | -C "found fragmented DTLS handshake message" \ |
| 6798 | -C "error" |
| 6799 | |
| 6800 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6801 | requires_config_enabled MBEDTLS_RSA_C |
| 6802 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6803 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6804 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6805 | run_test "DTLS fragmenting: server only (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6806 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6807 | crt_file=data_files/server7_int-ca.crt \ |
| 6808 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6809 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6810 | max_frag_len=1024" \ |
| 6811 | "$P_CLI dtls=1 debug_level=2 \ |
| 6812 | crt_file=data_files/server8_int-ca2.crt \ |
| 6813 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6814 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6815 | max_frag_len=2048" \ |
| 6816 | 0 \ |
| 6817 | -S "found fragmented DTLS handshake message" \ |
| 6818 | -c "found fragmented DTLS handshake message" \ |
| 6819 | -C "error" |
| 6820 | |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6821 | # With the MFL extension, the server has no way of forcing |
| 6822 | # the client to not exceed a certain MTU; hence, the following |
| 6823 | # test can't be replicated with an MTU proxy such as the one |
| 6824 | # `client-initiated, server only (max_frag_len)` below. |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6825 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6826 | requires_config_enabled MBEDTLS_RSA_C |
| 6827 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6828 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6829 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6830 | run_test "DTLS fragmenting: server only (more) (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6831 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6832 | crt_file=data_files/server7_int-ca.crt \ |
| 6833 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6834 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6835 | max_frag_len=512" \ |
| 6836 | "$P_CLI dtls=1 debug_level=2 \ |
| 6837 | crt_file=data_files/server8_int-ca2.crt \ |
| 6838 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6839 | hs_timeout=2500-60000 \ |
Hanno Becker | 69ca0ad | 2018-08-24 12:11:35 +0100 | [diff] [blame] | 6840 | max_frag_len=4096" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6841 | 0 \ |
| 6842 | -S "found fragmented DTLS handshake message" \ |
| 6843 | -c "found fragmented DTLS handshake message" \ |
| 6844 | -C "error" |
| 6845 | |
| 6846 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6847 | requires_config_enabled MBEDTLS_RSA_C |
| 6848 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6849 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6850 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6851 | 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] | 6852 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6853 | crt_file=data_files/server7_int-ca.crt \ |
| 6854 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6855 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6856 | max_frag_len=2048" \ |
| 6857 | "$P_CLI dtls=1 debug_level=2 \ |
| 6858 | crt_file=data_files/server8_int-ca2.crt \ |
| 6859 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6860 | hs_timeout=2500-60000 \ |
| 6861 | max_frag_len=1024" \ |
| 6862 | 0 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6863 | -S "found fragmented DTLS handshake message" \ |
| 6864 | -c "found fragmented DTLS handshake message" \ |
| 6865 | -C "error" |
| 6866 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6867 | # While not required by the standard defining the MFL extension |
| 6868 | # (according to which it only applies to records, not to datagrams), |
| 6869 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6870 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6871 | # to the peer. |
| 6872 | # The next test checks that no datagrams significantly larger than the |
| 6873 | # negotiated MFL are sent. |
| 6874 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6875 | requires_config_enabled MBEDTLS_RSA_C |
| 6876 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6877 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6878 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6879 | 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] | 6880 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6881 | "$P_SRV dtls=1 debug_level=2 auth_mode=none \ |
| 6882 | crt_file=data_files/server7_int-ca.crt \ |
| 6883 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6884 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6885 | max_frag_len=2048" \ |
| 6886 | "$P_CLI dtls=1 debug_level=2 \ |
| 6887 | crt_file=data_files/server8_int-ca2.crt \ |
| 6888 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6889 | hs_timeout=2500-60000 \ |
| 6890 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6891 | 0 \ |
| 6892 | -S "found fragmented DTLS handshake message" \ |
| 6893 | -c "found fragmented DTLS handshake message" \ |
| 6894 | -C "error" |
| 6895 | |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6896 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6897 | requires_config_enabled MBEDTLS_RSA_C |
| 6898 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6899 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6900 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6901 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len)" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6902 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6903 | crt_file=data_files/server7_int-ca.crt \ |
| 6904 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6905 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6906 | max_frag_len=2048" \ |
| 6907 | "$P_CLI dtls=1 debug_level=2 \ |
| 6908 | crt_file=data_files/server8_int-ca2.crt \ |
| 6909 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6910 | hs_timeout=2500-60000 \ |
| 6911 | max_frag_len=1024" \ |
Manuel Pégourié-Gonnard | 2cb17e2 | 2017-09-19 13:00:47 +0200 | [diff] [blame] | 6912 | 0 \ |
| 6913 | -s "found fragmented DTLS handshake message" \ |
| 6914 | -c "found fragmented DTLS handshake message" \ |
| 6915 | -C "error" |
| 6916 | |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6917 | # While not required by the standard defining the MFL extension |
| 6918 | # (according to which it only applies to records, not to datagrams), |
| 6919 | # Mbed TLS will never send datagrams larger than MFL + { Max record expansion }, |
| 6920 | # as otherwise there wouldn't be any means to communicate MTU restrictions |
| 6921 | # to the peer. |
| 6922 | # The next test checks that no datagrams significantly larger than the |
| 6923 | # negotiated MFL are sent. |
| 6924 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6925 | requires_config_enabled MBEDTLS_RSA_C |
| 6926 | requires_config_enabled MBEDTLS_ECDSA_C |
| 6927 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6928 | requires_max_content_len 2048 |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6929 | run_test "DTLS fragmenting: client-initiated, both (max_frag_len), proxy MTU" \ |
Andrzej Kurek | 0fc9cf4 | 2018-10-09 03:09:41 -0400 | [diff] [blame] | 6930 | -p "$P_PXY mtu=1110" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6931 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6932 | crt_file=data_files/server7_int-ca.crt \ |
| 6933 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6934 | hs_timeout=2500-60000 \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6935 | max_frag_len=2048" \ |
| 6936 | "$P_CLI dtls=1 debug_level=2 \ |
| 6937 | crt_file=data_files/server8_int-ca2.crt \ |
| 6938 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6939 | hs_timeout=2500-60000 \ |
| 6940 | max_frag_len=1024" \ |
Hanno Becker | c92b5c8 | 2018-08-24 11:48:01 +0100 | [diff] [blame] | 6941 | 0 \ |
| 6942 | -s "found fragmented DTLS handshake message" \ |
| 6943 | -c "found fragmented DTLS handshake message" \ |
| 6944 | -C "error" |
| 6945 | |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6946 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6947 | requires_config_enabled MBEDTLS_RSA_C |
| 6948 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6949 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6950 | run_test "DTLS fragmenting: none (for reference) (MTU)" \ |
| 6951 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6952 | crt_file=data_files/server7_int-ca.crt \ |
| 6953 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6954 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6955 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6956 | "$P_CLI dtls=1 debug_level=2 \ |
| 6957 | crt_file=data_files/server8_int-ca2.crt \ |
| 6958 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6959 | hs_timeout=2500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6960 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6961 | 0 \ |
| 6962 | -S "found fragmented DTLS handshake message" \ |
| 6963 | -C "found fragmented DTLS handshake message" \ |
| 6964 | -C "error" |
| 6965 | |
| 6966 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6967 | requires_config_enabled MBEDTLS_RSA_C |
| 6968 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6969 | requires_max_content_len 4096 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6970 | run_test "DTLS fragmenting: client (MTU)" \ |
| 6971 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6972 | crt_file=data_files/server7_int-ca.crt \ |
| 6973 | key_file=data_files/server7.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6974 | hs_timeout=3500-60000 \ |
Hanno Becker | 12405e7 | 2018-08-13 16:45:46 +0100 | [diff] [blame] | 6975 | mtu=4096" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6976 | "$P_CLI dtls=1 debug_level=2 \ |
| 6977 | crt_file=data_files/server8_int-ca2.crt \ |
| 6978 | key_file=data_files/server8.key \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 6979 | hs_timeout=3500-60000 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6980 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6981 | 0 \ |
| 6982 | -s "found fragmented DTLS handshake message" \ |
| 6983 | -C "found fragmented DTLS handshake message" \ |
| 6984 | -C "error" |
| 6985 | |
| 6986 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 6987 | requires_config_enabled MBEDTLS_RSA_C |
| 6988 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 6989 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6990 | run_test "DTLS fragmenting: server (MTU)" \ |
| 6991 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 6992 | crt_file=data_files/server7_int-ca.crt \ |
| 6993 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6994 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 6995 | mtu=512" \ |
| 6996 | "$P_CLI dtls=1 debug_level=2 \ |
| 6997 | crt_file=data_files/server8_int-ca2.crt \ |
| 6998 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 6999 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7000 | mtu=2048" \ |
| 7001 | 0 \ |
| 7002 | -S "found fragmented DTLS handshake message" \ |
| 7003 | -c "found fragmented DTLS handshake message" \ |
| 7004 | -C "error" |
| 7005 | |
| 7006 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7007 | requires_config_enabled MBEDTLS_RSA_C |
| 7008 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7009 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7010 | run_test "DTLS fragmenting: both (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7011 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7012 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7013 | crt_file=data_files/server7_int-ca.crt \ |
| 7014 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7015 | hs_timeout=2500-60000 \ |
Andrzej Kurek | 9580528 | 2018-10-11 08:55:37 -0400 | [diff] [blame] | 7016 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7017 | "$P_CLI dtls=1 debug_level=2 \ |
| 7018 | crt_file=data_files/server8_int-ca2.crt \ |
| 7019 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7020 | hs_timeout=2500-60000 \ |
| 7021 | mtu=1024" \ |
Manuel Pégourié-Gonnard | b747c6c | 2018-08-12 13:28:53 +0200 | [diff] [blame] | 7022 | 0 \ |
| 7023 | -s "found fragmented DTLS handshake message" \ |
| 7024 | -c "found fragmented DTLS handshake message" \ |
| 7025 | -C "error" |
| 7026 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7027 | # 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] | 7028 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7029 | requires_config_enabled MBEDTLS_RSA_C |
| 7030 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7031 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7032 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7033 | requires_config_enabled MBEDTLS_AES_C |
| 7034 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7035 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7036 | run_test "DTLS fragmenting: both (MTU=512)" \ |
Hanno Becker | 8d83218 | 2018-03-15 10:14:19 +0000 | [diff] [blame] | 7037 | -p "$P_PXY mtu=512" \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7038 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7039 | crt_file=data_files/server7_int-ca.crt \ |
| 7040 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7041 | hs_timeout=2500-60000 \ |
Hanno Becker | 72a4f03 | 2017-11-15 16:39:20 +0000 | [diff] [blame] | 7042 | mtu=512" \ |
| 7043 | "$P_CLI dtls=1 debug_level=2 \ |
| 7044 | crt_file=data_files/server8_int-ca2.crt \ |
| 7045 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7046 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7047 | hs_timeout=2500-60000 \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7048 | mtu=512" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 7049 | 0 \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 7050 | -s "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 7051 | -c "found fragmented DTLS handshake message" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 7052 | -C "error" |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 7053 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7054 | # Test for automatic MTU reduction on repeated resend. |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7055 | # 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] | 7056 | # The ratio of max/min timeout should ideally equal 4 to accept two |
| 7057 | # retransmissions, but in some cases (like both the server and client using |
| 7058 | # fragmentation and auto-reduction) an extra retransmission might occur, |
| 7059 | # hence the ratio of 8. |
Hanno Becker | 37029eb | 2018-08-29 17:01:40 +0100 | [diff] [blame] | 7060 | not_with_valgrind |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7061 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7062 | requires_config_enabled MBEDTLS_RSA_C |
| 7063 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7064 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7065 | requires_config_enabled MBEDTLS_AES_C |
| 7066 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7067 | requires_max_content_len 2048 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7068 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (not valgrind)" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7069 | -p "$P_PXY mtu=508" \ |
| 7070 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7071 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7072 | key_file=data_files/server7.key \ |
| 7073 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7074 | "$P_CLI dtls=1 debug_level=2 \ |
| 7075 | crt_file=data_files/server8_int-ca2.crt \ |
| 7076 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7077 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7078 | hs_timeout=400-3200" \ |
Manuel Pégourié-Gonnard | b8eec19 | 2018-08-20 09:34:02 +0200 | [diff] [blame] | 7079 | 0 \ |
| 7080 | -s "found fragmented DTLS handshake message" \ |
| 7081 | -c "found fragmented DTLS handshake message" \ |
| 7082 | -C "error" |
| 7083 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7084 | # 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] | 7085 | only_with_valgrind |
| 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 |
Gilles Peskine | 0d8b86a | 2019-09-20 18:03:11 +0200 | [diff] [blame] | 7093 | run_test "DTLS fragmenting: proxy MTU: auto-reduction (with valgrind)" \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7094 | -p "$P_PXY mtu=508" \ |
| 7095 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7096 | crt_file=data_files/server7_int-ca.crt \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7097 | key_file=data_files/server7.key \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7098 | hs_timeout=250-10000" \ |
| 7099 | "$P_CLI dtls=1 debug_level=2 \ |
| 7100 | crt_file=data_files/server8_int-ca2.crt \ |
| 7101 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7102 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Hanno Becker | 108992e | 2018-08-29 17:04:18 +0100 | [diff] [blame] | 7103 | hs_timeout=250-10000" \ |
| 7104 | 0 \ |
| 7105 | -s "found fragmented DTLS handshake message" \ |
| 7106 | -c "found fragmented DTLS handshake message" \ |
| 7107 | -C "error" |
| 7108 | |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7109 | # 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] | 7110 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7111 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7112 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 (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 | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7122 | hs_timeout=10000-60000 \ |
| 7123 | mtu=1024" \ |
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 | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7127 | hs_timeout=10000-60000 \ |
| 7128 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7129 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7130 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 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 | # the proxy shouldn't drop or mess up anything, so we shouldn't need to resend |
| 7137 | # OTOH the client might resend if the server is to slow to reset after sending |
| 7138 | # a HelloVerifyRequest, so only check for no retransmission server-side |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7139 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7140 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7141 | requires_config_enabled MBEDTLS_RSA_C |
| 7142 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7143 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7144 | requires_config_enabled MBEDTLS_AES_C |
| 7145 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7146 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7147 | run_test "DTLS fragmenting: proxy MTU, simple handshake (MTU=512)" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7148 | -p "$P_PXY mtu=512" \ |
| 7149 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7150 | crt_file=data_files/server7_int-ca.crt \ |
| 7151 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7152 | hs_timeout=10000-60000 \ |
| 7153 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7154 | "$P_CLI dtls=1 debug_level=2 \ |
| 7155 | crt_file=data_files/server8_int-ca2.crt \ |
| 7156 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7157 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7158 | hs_timeout=10000-60000 \ |
| 7159 | mtu=512" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7160 | 0 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7161 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7162 | -s "found fragmented DTLS handshake message" \ |
| 7163 | -c "found fragmented DTLS handshake message" \ |
| 7164 | -C "error" |
| 7165 | |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7166 | not_with_valgrind # spurious autoreduction due to timeout |
| 7167 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7168 | requires_config_enabled MBEDTLS_RSA_C |
| 7169 | requires_config_enabled MBEDTLS_ECDSA_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7170 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7171 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=1024)" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7172 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7173 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7174 | crt_file=data_files/server7_int-ca.crt \ |
| 7175 | key_file=data_files/server7.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7176 | hs_timeout=10000-60000 \ |
| 7177 | mtu=1024 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7178 | "$P_CLI dtls=1 debug_level=2 \ |
| 7179 | crt_file=data_files/server8_int-ca2.crt \ |
| 7180 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7181 | hs_timeout=10000-60000 \ |
| 7182 | mtu=1024 nbio=2" \ |
| 7183 | 0 \ |
| 7184 | -S "autoreduction" \ |
| 7185 | -s "found fragmented DTLS handshake message" \ |
| 7186 | -c "found fragmented DTLS handshake message" \ |
| 7187 | -C "error" |
| 7188 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7189 | # 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] | 7190 | not_with_valgrind # spurious autoreduction due to timeout |
| 7191 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7192 | requires_config_enabled MBEDTLS_RSA_C |
| 7193 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7194 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7195 | requires_config_enabled MBEDTLS_AES_C |
| 7196 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7197 | requires_max_content_len 2048 |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7198 | run_test "DTLS fragmenting: proxy MTU, simple handshake, nbio (MTU=512)" \ |
| 7199 | -p "$P_PXY mtu=512" \ |
| 7200 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7201 | crt_file=data_files/server7_int-ca.crt \ |
| 7202 | key_file=data_files/server7.key \ |
| 7203 | hs_timeout=10000-60000 \ |
| 7204 | mtu=512 nbio=2" \ |
| 7205 | "$P_CLI dtls=1 debug_level=2 \ |
| 7206 | crt_file=data_files/server8_int-ca2.crt \ |
| 7207 | key_file=data_files/server8.key \ |
| 7208 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
| 7209 | hs_timeout=10000-60000 \ |
| 7210 | mtu=512 nbio=2" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7211 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7212 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7213 | -s "found fragmented DTLS handshake message" \ |
| 7214 | -c "found fragmented DTLS handshake message" \ |
| 7215 | -C "error" |
| 7216 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7217 | # 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] | 7218 | # This ensures things still work after session_reset(). |
| 7219 | # It also exercises the "resumed handshake" flow. |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7220 | # Since we don't support reading fragmented ClientHello yet, |
| 7221 | # up the MTU to 1450 (larger than ClientHello with session ticket, |
| 7222 | # but still smaller than client's Certificate to ensure fragmentation). |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7223 | # An autoreduction on the client-side might happen if the server is |
| 7224 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
Manuel Pégourié-Gonnard | 2f2d902 | 2018-08-21 12:17:54 +0200 | [diff] [blame] | 7225 | # reco_delay avoids races where the client reconnects before the server has |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7226 | # resumed listening, which would result in a spurious autoreduction. |
| 7227 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7228 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7229 | requires_config_enabled MBEDTLS_RSA_C |
| 7230 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7231 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7232 | requires_config_enabled MBEDTLS_AES_C |
| 7233 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7234 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7235 | run_test "DTLS fragmenting: proxy MTU, resumed handshake" \ |
| 7236 | -p "$P_PXY mtu=1450" \ |
| 7237 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7238 | crt_file=data_files/server7_int-ca.crt \ |
| 7239 | key_file=data_files/server7.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7240 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7241 | mtu=1450" \ |
| 7242 | "$P_CLI dtls=1 debug_level=2 \ |
| 7243 | crt_file=data_files/server8_int-ca2.crt \ |
| 7244 | key_file=data_files/server8.key \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7245 | hs_timeout=10000-60000 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7246 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 56941fe | 2020-02-17 11:04:33 +0100 | [diff] [blame] | 7247 | 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] | 7248 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7249 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 19c62f9 | 2018-08-16 10:50:39 +0200 | [diff] [blame] | 7250 | -s "found fragmented DTLS handshake message" \ |
| 7251 | -c "found fragmented DTLS handshake message" \ |
| 7252 | -C "error" |
| 7253 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7254 | # An autoreduction on the client-side might happen if the server is |
| 7255 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7256 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7257 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7258 | requires_config_enabled MBEDTLS_RSA_C |
| 7259 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7260 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7261 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7262 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7263 | requires_config_enabled MBEDTLS_CHACHAPOLY_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7264 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7265 | run_test "DTLS fragmenting: proxy MTU, ChachaPoly renego" \ |
| 7266 | -p "$P_PXY mtu=512" \ |
| 7267 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7268 | crt_file=data_files/server7_int-ca.crt \ |
| 7269 | key_file=data_files/server7.key \ |
| 7270 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7271 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7272 | mtu=512" \ |
| 7273 | "$P_CLI dtls=1 debug_level=2 \ |
| 7274 | crt_file=data_files/server8_int-ca2.crt \ |
| 7275 | key_file=data_files/server8.key \ |
| 7276 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7277 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7278 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7279 | mtu=512" \ |
| 7280 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7281 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7282 | -s "found fragmented DTLS handshake message" \ |
| 7283 | -c "found fragmented DTLS handshake message" \ |
| 7284 | -C "error" |
| 7285 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7286 | # An autoreduction on the client-side might happen if the server is |
| 7287 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7288 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7289 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7290 | requires_config_enabled MBEDTLS_RSA_C |
| 7291 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7292 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7293 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7294 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7295 | requires_config_enabled MBEDTLS_AES_C |
| 7296 | requires_config_enabled MBEDTLS_GCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7297 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7298 | run_test "DTLS fragmenting: proxy MTU, AES-GCM renego" \ |
| 7299 | -p "$P_PXY mtu=512" \ |
| 7300 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7301 | crt_file=data_files/server7_int-ca.crt \ |
| 7302 | key_file=data_files/server7.key \ |
| 7303 | exchanges=2 renegotiation=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7304 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7305 | mtu=512" \ |
| 7306 | "$P_CLI dtls=1 debug_level=2 \ |
| 7307 | crt_file=data_files/server8_int-ca2.crt \ |
| 7308 | key_file=data_files/server8.key \ |
| 7309 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7310 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7311 | hs_timeout=10000-60000 \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7312 | mtu=512" \ |
| 7313 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7314 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7315 | -s "found fragmented DTLS handshake message" \ |
| 7316 | -c "found fragmented DTLS handshake message" \ |
| 7317 | -C "error" |
| 7318 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7319 | # An autoreduction on the client-side might happen if the server is |
| 7320 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7321 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7322 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7323 | requires_config_enabled MBEDTLS_RSA_C |
| 7324 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7325 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7326 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7327 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7328 | requires_config_enabled MBEDTLS_AES_C |
| 7329 | requires_config_enabled MBEDTLS_CCM_C |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7330 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7331 | run_test "DTLS fragmenting: proxy MTU, AES-CCM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7332 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7333 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7334 | crt_file=data_files/server7_int-ca.crt \ |
| 7335 | key_file=data_files/server7.key \ |
| 7336 | exchanges=2 renegotiation=1 \ |
| 7337 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CCM-8 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7338 | hs_timeout=10000-60000 \ |
| 7339 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7340 | "$P_CLI dtls=1 debug_level=2 \ |
| 7341 | crt_file=data_files/server8_int-ca2.crt \ |
| 7342 | key_file=data_files/server8.key \ |
| 7343 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7344 | hs_timeout=10000-60000 \ |
| 7345 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7346 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7347 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7348 | -s "found fragmented DTLS handshake message" \ |
| 7349 | -c "found fragmented DTLS handshake message" \ |
| 7350 | -C "error" |
| 7351 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7352 | # An autoreduction on the client-side might happen if the server is |
| 7353 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7354 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7355 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7356 | requires_config_enabled MBEDTLS_RSA_C |
| 7357 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7358 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7359 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7360 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7361 | requires_config_enabled MBEDTLS_AES_C |
| 7362 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
| 7363 | requires_config_enabled MBEDTLS_SSL_ENCRYPT_THEN_MAC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7364 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7365 | run_test "DTLS fragmenting: proxy MTU, AES-CBC EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7366 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7367 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7368 | crt_file=data_files/server7_int-ca.crt \ |
| 7369 | key_file=data_files/server7.key \ |
| 7370 | exchanges=2 renegotiation=1 \ |
| 7371 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7372 | hs_timeout=10000-60000 \ |
| 7373 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7374 | "$P_CLI dtls=1 debug_level=2 \ |
| 7375 | crt_file=data_files/server8_int-ca2.crt \ |
| 7376 | key_file=data_files/server8.key \ |
| 7377 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7378 | hs_timeout=10000-60000 \ |
| 7379 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7380 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7381 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7382 | -s "found fragmented DTLS handshake message" \ |
| 7383 | -c "found fragmented DTLS handshake message" \ |
| 7384 | -C "error" |
| 7385 | |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7386 | # An autoreduction on the client-side might happen if the server is |
| 7387 | # slow to reset, therefore omitting '-C "autoreduction"' below. |
| 7388 | not_with_valgrind # spurious autoreduction due to timeout |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7389 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7390 | requires_config_enabled MBEDTLS_RSA_C |
| 7391 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7392 | requires_config_enabled MBEDTLS_SHA256_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7393 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7394 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
| 7395 | requires_config_enabled MBEDTLS_AES_C |
| 7396 | requires_config_enabled MBEDTLS_CIPHER_MODE_CBC |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7397 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7398 | run_test "DTLS fragmenting: proxy MTU, AES-CBC non-EtM renego" \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7399 | -p "$P_PXY mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7400 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7401 | crt_file=data_files/server7_int-ca.crt \ |
| 7402 | key_file=data_files/server7.key \ |
| 7403 | exchanges=2 renegotiation=1 \ |
| 7404 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-CBC-SHA256 etm=0 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7405 | hs_timeout=10000-60000 \ |
| 7406 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7407 | "$P_CLI dtls=1 debug_level=2 \ |
| 7408 | crt_file=data_files/server8_int-ca2.crt \ |
| 7409 | key_file=data_files/server8.key \ |
| 7410 | exchanges=2 renegotiation=1 renegotiate=1 \ |
Andrzej Kurek | 52f8491 | 2018-10-05 07:53:40 -0400 | [diff] [blame] | 7411 | hs_timeout=10000-60000 \ |
| 7412 | mtu=1024" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7413 | 0 \ |
Andrzej Kurek | 35f2f30 | 2018-10-09 08:52:14 -0400 | [diff] [blame] | 7414 | -S "autoreduction" \ |
Manuel Pégourié-Gonnard | 72c2707 | 2018-08-13 12:37:51 +0200 | [diff] [blame] | 7415 | -s "found fragmented DTLS handshake message" \ |
| 7416 | -c "found fragmented DTLS handshake message" \ |
| 7417 | -C "error" |
| 7418 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7419 | # 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] | 7420 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7421 | requires_config_enabled MBEDTLS_RSA_C |
| 7422 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7423 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7424 | requires_config_enabled MBEDTLS_AES_C |
| 7425 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7426 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7427 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7428 | run_test "DTLS fragmenting: proxy MTU + 3d" \ |
| 7429 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7430 | "$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] | 7431 | crt_file=data_files/server7_int-ca.crt \ |
| 7432 | key_file=data_files/server7.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7433 | hs_timeout=250-10000 mtu=512" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7434 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7435 | crt_file=data_files/server8_int-ca2.crt \ |
| 7436 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7437 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7438 | hs_timeout=250-10000 mtu=512" \ |
Manuel Pégourié-Gonnard | 2d56f0d | 2018-08-16 11:09:03 +0200 | [diff] [blame] | 7439 | 0 \ |
| 7440 | -s "found fragmented DTLS handshake message" \ |
| 7441 | -c "found fragmented DTLS handshake message" \ |
| 7442 | -C "error" |
| 7443 | |
Andrzej Kurek | 7782605 | 2018-10-11 07:34:08 -0400 | [diff] [blame] | 7444 | # 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] | 7445 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7446 | requires_config_enabled MBEDTLS_RSA_C |
| 7447 | requires_config_enabled MBEDTLS_ECDSA_C |
Gilles Peskine | 6ee3bc0 | 2021-07-13 20:34:55 +0200 | [diff] [blame] | 7448 | requires_config_enabled MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7449 | requires_config_enabled MBEDTLS_AES_C |
| 7450 | requires_config_enabled MBEDTLS_GCM_C |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7451 | client_needs_more_time 2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7452 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7453 | run_test "DTLS fragmenting: proxy MTU + 3d, nbio" \ |
| 7454 | -p "$P_PXY mtu=512 drop=8 delay=8 duplicate=8" \ |
| 7455 | "$P_SRV dtls=1 debug_level=2 auth_mode=required \ |
| 7456 | crt_file=data_files/server7_int-ca.crt \ |
| 7457 | key_file=data_files/server7.key \ |
| 7458 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7459 | "$P_CLI dtls=1 debug_level=2 \ |
| 7460 | crt_file=data_files/server8_int-ca2.crt \ |
| 7461 | key_file=data_files/server8.key \ |
Andrzej Kurek | 7311c78 | 2018-10-11 06:49:41 -0400 | [diff] [blame] | 7462 | force_ciphersuite=TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256 \ |
Manuel Pégourié-Gonnard | c1d54b7 | 2018-08-22 10:02:59 +0200 | [diff] [blame] | 7463 | hs_timeout=250-10000 mtu=512 nbio=2" \ |
| 7464 | 0 \ |
| 7465 | -s "found fragmented DTLS handshake message" \ |
| 7466 | -c "found fragmented DTLS handshake message" \ |
| 7467 | -C "error" |
| 7468 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7469 | # interop tests for DTLS fragmentating with reliable connection |
| 7470 | # |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7471 | # here and below we just want to test that the we fragment in a way that |
| 7472 | # pleases other implementations, so we don't need the peer to fragment |
| 7473 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7474 | requires_config_enabled MBEDTLS_RSA_C |
| 7475 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7476 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7477 | requires_gnutls |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7478 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7479 | run_test "DTLS fragmenting: gnutls server, DTLS 1.2" \ |
| 7480 | "$G_SRV -u" \ |
| 7481 | "$P_CLI dtls=1 debug_level=2 \ |
| 7482 | crt_file=data_files/server8_int-ca2.crt \ |
| 7483 | key_file=data_files/server8.key \ |
| 7484 | mtu=512 force_version=dtls1_2" \ |
| 7485 | 0 \ |
| 7486 | -c "fragmenting handshake message" \ |
| 7487 | -C "error" |
| 7488 | |
Hanno Becker | b9a0086 | 2018-08-28 10:20:22 +0100 | [diff] [blame] | 7489 | # We use --insecure for the GnuTLS client because it expects |
| 7490 | # the hostname / IP it connects to to be the name used in the |
| 7491 | # certificate obtained from the server. Here, however, it |
| 7492 | # connects to 127.0.0.1 while our test certificates use 'localhost' |
| 7493 | # as the server name in the certificate. This will make the |
| 7494 | # certifiate validation fail, but passing --insecure makes |
| 7495 | # GnuTLS continue the connection nonetheless. |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7496 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7497 | requires_config_enabled MBEDTLS_RSA_C |
| 7498 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7499 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 6151298 | 2018-08-21 09:40:07 +0200 | [diff] [blame] | 7500 | requires_gnutls |
Andrzej Kurek | b459346 | 2018-10-11 08:43:30 -0400 | [diff] [blame] | 7501 | requires_not_i686 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7502 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7503 | run_test "DTLS fragmenting: gnutls client, DTLS 1.2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7504 | "$P_SRV dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7505 | crt_file=data_files/server7_int-ca.crt \ |
| 7506 | key_file=data_files/server7.key \ |
| 7507 | mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 34aa187 | 2018-08-23 19:07:15 +0200 | [diff] [blame] | 7508 | "$G_CLI -u --insecure 127.0.0.1" \ |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7509 | 0 \ |
| 7510 | -s "fragmenting handshake message" |
| 7511 | |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7512 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7513 | requires_config_enabled MBEDTLS_RSA_C |
| 7514 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7515 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7516 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7517 | run_test "DTLS fragmenting: openssl server, DTLS 1.2" \ |
| 7518 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7519 | "$P_CLI dtls=1 debug_level=2 \ |
| 7520 | crt_file=data_files/server8_int-ca2.crt \ |
| 7521 | key_file=data_files/server8.key \ |
| 7522 | mtu=512 force_version=dtls1_2" \ |
| 7523 | 0 \ |
| 7524 | -c "fragmenting handshake message" \ |
| 7525 | -C "error" |
| 7526 | |
| 7527 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7528 | requires_config_enabled MBEDTLS_RSA_C |
| 7529 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7530 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7531 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 1218bc0 | 2018-08-17 10:51:26 +0200 | [diff] [blame] | 7532 | run_test "DTLS fragmenting: openssl client, DTLS 1.2" \ |
| 7533 | "$P_SRV dtls=1 debug_level=2 \ |
| 7534 | crt_file=data_files/server7_int-ca.crt \ |
| 7535 | key_file=data_files/server7.key \ |
| 7536 | mtu=512 force_version=dtls1_2" \ |
| 7537 | "$O_CLI -dtls1_2" \ |
| 7538 | 0 \ |
| 7539 | -s "fragmenting handshake message" |
| 7540 | |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7541 | # interop tests for DTLS fragmentating with unreliable connection |
| 7542 | # |
| 7543 | # again we just want to test that the we fragment in a way that |
| 7544 | # pleases other implementations, so we don't need the peer to fragment |
| 7545 | requires_gnutls_next |
| 7546 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7547 | requires_config_enabled MBEDTLS_RSA_C |
| 7548 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7549 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7550 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7551 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7552 | run_test "DTLS fragmenting: 3d, gnutls server, DTLS 1.2" \ |
| 7553 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7554 | "$G_NEXT_SRV -u" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 7555 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7556 | crt_file=data_files/server8_int-ca2.crt \ |
| 7557 | key_file=data_files/server8.key \ |
Manuel Pégourié-Gonnard | 02f3a8a | 2018-08-20 10:49:28 +0200 | [diff] [blame] | 7558 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7559 | 0 \ |
| 7560 | -c "fragmenting handshake message" \ |
| 7561 | -C "error" |
| 7562 | |
| 7563 | requires_gnutls_next |
| 7564 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7565 | requires_config_enabled MBEDTLS_RSA_C |
| 7566 | requires_config_enabled MBEDTLS_ECDSA_C |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7567 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7568 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7569 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7570 | run_test "DTLS fragmenting: 3d, gnutls client, DTLS 1.2" \ |
| 7571 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7572 | "$P_SRV dtls=1 debug_level=2 \ |
| 7573 | crt_file=data_files/server7_int-ca.crt \ |
| 7574 | key_file=data_files/server7.key \ |
| 7575 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 7576 | "$G_NEXT_CLI -u --insecure 127.0.0.1" \ |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7577 | 0 \ |
| 7578 | -s "fragmenting handshake message" |
| 7579 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7580 | ## Interop test with OpenSSL might trigger a bug in recent versions (including |
| 7581 | ## all versions installed on the CI machines), reported here: |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7582 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7583 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 7584 | ## (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] | 7585 | skip_next_test |
| 7586 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7587 | requires_config_enabled MBEDTLS_RSA_C |
| 7588 | requires_config_enabled MBEDTLS_ECDSA_C |
| 7589 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7590 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7591 | requires_max_content_len 2048 |
Hanno Becker | 3b8b40c | 2018-08-28 10:25:41 +0100 | [diff] [blame] | 7592 | run_test "DTLS fragmenting: 3d, openssl server, DTLS 1.2" \ |
| 7593 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7594 | "$O_SRV -dtls1_2 -verify 10" \ |
| 7595 | "$P_CLI dtls=1 debug_level=2 \ |
| 7596 | crt_file=data_files/server8_int-ca2.crt \ |
| 7597 | key_file=data_files/server8.key \ |
| 7598 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7599 | 0 \ |
| 7600 | -c "fragmenting handshake message" \ |
| 7601 | -C "error" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7602 | |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7603 | skip_next_test |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7604 | requires_config_enabled MBEDTLS_SSL_PROTO_DTLS |
| 7605 | requires_config_enabled MBEDTLS_RSA_C |
| 7606 | requires_config_enabled MBEDTLS_ECDSA_C |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7607 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 7608 | client_needs_more_time 4 |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 7609 | requires_max_content_len 2048 |
Manuel Pégourié-Gonnard | c1eda67 | 2018-09-03 10:41:49 +0200 | [diff] [blame] | 7610 | run_test "DTLS fragmenting: 3d, openssl client, DTLS 1.2" \ |
| 7611 | -p "$P_PXY drop=8 delay=8 duplicate=8" \ |
| 7612 | "$P_SRV dtls=1 debug_level=2 \ |
| 7613 | crt_file=data_files/server7_int-ca.crt \ |
| 7614 | key_file=data_files/server7.key \ |
| 7615 | hs_timeout=250-60000 mtu=512 force_version=dtls1_2" \ |
| 7616 | "$O_CLI -dtls1_2" \ |
| 7617 | 0 \ |
| 7618 | -s "fragmenting handshake message" |
Manuel Pégourié-Gonnard | 38110df | 2018-08-17 12:44:54 +0200 | [diff] [blame] | 7619 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7620 | # Tests for DTLS-SRTP (RFC 5764) |
| 7621 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7622 | run_test "DTLS-SRTP all profiles supported" \ |
| 7623 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7624 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7625 | 0 \ |
| 7626 | -s "found use_srtp extension" \ |
| 7627 | -s "found srtp profile" \ |
| 7628 | -s "selected srtp profile" \ |
| 7629 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7630 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7631 | -c "client hello, adding use_srtp extension" \ |
| 7632 | -c "found use_srtp extension" \ |
| 7633 | -c "found srtp profile" \ |
| 7634 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7635 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7636 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7637 | -C "error" |
| 7638 | |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7639 | |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7640 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7641 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile." \ |
| 7642 | "$P_SRV dtls=1 use_srtp=1 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=5 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_80" \ |
| 7647 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 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" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7652 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7653 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7654 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7655 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7656 | -C "error" |
| 7657 | |
| 7658 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7659 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7660 | "$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] | 7661 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7662 | 0 \ |
| 7663 | -s "found use_srtp extension" \ |
| 7664 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7665 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7666 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7667 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7668 | -c "client hello, adding use_srtp extension" \ |
| 7669 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7670 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7671 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7672 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7673 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7674 | -C "error" |
| 7675 | |
| 7676 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7677 | run_test "DTLS-SRTP server and Client support only one matching profile." \ |
| 7678 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7679 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7680 | 0 \ |
| 7681 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7682 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7683 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7684 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7685 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7686 | -c "client hello, adding use_srtp extension" \ |
| 7687 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7688 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7689 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7690 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7691 | -g "find_in_both '^ *Keying material: [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 server and Client support only one different profile." \ |
| 7696 | "$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] | 7697 | "$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] | 7698 | 0 \ |
| 7699 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7700 | -s "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 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"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7704 | -c "client hello, adding use_srtp extension" \ |
| 7705 | -C "found use_srtp extension" \ |
| 7706 | -C "found srtp profile" \ |
| 7707 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7708 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7709 | -C "error" |
| 7710 | |
| 7711 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7712 | run_test "DTLS-SRTP server doesn't support use_srtp extension." \ |
| 7713 | "$P_SRV dtls=1 debug_level=3" \ |
| 7714 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7715 | 0 \ |
| 7716 | -s "found use_srtp extension" \ |
| 7717 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7718 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7719 | -c "client hello, adding use_srtp extension" \ |
| 7720 | -C "found use_srtp extension" \ |
| 7721 | -C "found srtp profile" \ |
| 7722 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7723 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7724 | -C "error" |
| 7725 | |
| 7726 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7727 | run_test "DTLS-SRTP all profiles supported. mki used" \ |
| 7728 | "$P_SRV dtls=1 use_srtp=1 support_mki=1 debug_level=3" \ |
| 7729 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7730 | 0 \ |
| 7731 | -s "found use_srtp extension" \ |
| 7732 | -s "found srtp profile" \ |
| 7733 | -s "selected srtp profile" \ |
| 7734 | -s "server hello, adding use_srtp extension" \ |
| 7735 | -s "dumping 'using mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7736 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7737 | -c "client hello, adding use_srtp extension" \ |
| 7738 | -c "found use_srtp extension" \ |
| 7739 | -c "found srtp profile" \ |
| 7740 | -c "selected srtp profile" \ |
| 7741 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7742 | -c "dumping 'received mki' (8 bytes)" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7743 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7744 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 7745 | -g "find_in_both '^ *DTLS-SRTP mki value: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7746 | -C "error" |
| 7747 | |
| 7748 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7749 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki." \ |
| 7750 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7751 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7752 | 0 \ |
| 7753 | -s "found use_srtp extension" \ |
| 7754 | -s "found srtp profile" \ |
| 7755 | -s "selected srtp profile" \ |
| 7756 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7757 | -s "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7758 | -s "DTLS-SRTP no mki value negotiated"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7759 | -S "dumping 'using mki' (8 bytes)" \ |
| 7760 | -c "client hello, adding use_srtp extension" \ |
| 7761 | -c "found use_srtp extension" \ |
| 7762 | -c "found srtp profile" \ |
| 7763 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7764 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 5ef72d2 | 2020-10-28 17:05:47 +0100 | [diff] [blame] | 7765 | -c "DTLS-SRTP no mki value negotiated"\ |
Johan Pascal | 9bc50b0 | 2020-09-24 12:01:13 +0200 | [diff] [blame] | 7766 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
Ron Eldor | b465539 | 2018-07-05 18:25:39 +0300 | [diff] [blame] | 7767 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7768 | -C "dumping 'received mki' (8 bytes)" \ |
| 7769 | -C "error" |
| 7770 | |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7771 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
TRodziewicz | 4ca18aa | 2021-05-20 14:46:20 +0200 | [diff] [blame] | 7772 | run_test "DTLS-SRTP all profiles supported. openssl client." \ |
| 7773 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7774 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7775 | 0 \ |
| 7776 | -s "found use_srtp extension" \ |
| 7777 | -s "found srtp profile" \ |
| 7778 | -s "selected srtp profile" \ |
| 7779 | -s "server hello, adding use_srtp extension" \ |
| 7780 | -s "DTLS-SRTP key material is"\ |
| 7781 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7782 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_80" |
| 7783 | |
| 7784 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7785 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl client." \ |
| 7786 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7787 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7788 | 0 \ |
| 7789 | -s "found use_srtp extension" \ |
| 7790 | -s "found srtp profile" \ |
| 7791 | -s "selected srtp profile" \ |
| 7792 | -s "server hello, adding use_srtp extension" \ |
| 7793 | -s "DTLS-SRTP key material is"\ |
| 7794 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7795 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7796 | |
| 7797 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7798 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl client." \ |
| 7799 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7800 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7801 | 0 \ |
| 7802 | -s "found use_srtp extension" \ |
| 7803 | -s "found srtp profile" \ |
| 7804 | -s "selected srtp profile" \ |
| 7805 | -s "server hello, adding use_srtp extension" \ |
| 7806 | -s "DTLS-SRTP key material is"\ |
| 7807 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7808 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7809 | |
| 7810 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7811 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl client." \ |
| 7812 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7813 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7814 | 0 \ |
| 7815 | -s "found use_srtp extension" \ |
| 7816 | -s "found srtp profile" \ |
| 7817 | -s "selected srtp profile" \ |
| 7818 | -s "server hello, adding use_srtp extension" \ |
| 7819 | -s "DTLS-SRTP key material is"\ |
| 7820 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7821 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7822 | |
| 7823 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7824 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl client." \ |
| 7825 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7826 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7827 | 0 \ |
| 7828 | -s "found use_srtp extension" \ |
| 7829 | -s "found srtp profile" \ |
| 7830 | -s "selected srtp profile" \ |
| 7831 | -s "server hello, adding use_srtp extension" \ |
| 7832 | -s "DTLS-SRTP key material is"\ |
| 7833 | -g "find_in_both '^ *Keying material: [0-9A-F]*$'"\ |
| 7834 | -c "SRTP Extension negotiated, profile=SRTP_AES128_CM_SHA1_32" |
| 7835 | |
| 7836 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7837 | run_test "DTLS-SRTP server and Client support only one different profile. openssl client." \ |
| 7838 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 7839 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7840 | 0 \ |
| 7841 | -s "found use_srtp extension" \ |
| 7842 | -s "found srtp profile" \ |
| 7843 | -S "selected srtp profile" \ |
| 7844 | -S "server hello, adding use_srtp extension" \ |
| 7845 | -S "DTLS-SRTP key material is"\ |
| 7846 | -C "SRTP Extension negotiated, profile" |
| 7847 | |
| 7848 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7849 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl client" \ |
| 7850 | "$P_SRV dtls=1 debug_level=3" \ |
| 7851 | "$O_CLI -dtls -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7852 | 0 \ |
| 7853 | -s "found use_srtp extension" \ |
| 7854 | -S "server hello, adding use_srtp extension" \ |
| 7855 | -S "DTLS-SRTP key material is"\ |
| 7856 | -C "SRTP Extension negotiated, profile" |
| 7857 | |
| 7858 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7859 | run_test "DTLS-SRTP all profiles supported. openssl server" \ |
| 7860 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7861 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7862 | 0 \ |
| 7863 | -c "client hello, adding use_srtp extension" \ |
| 7864 | -c "found use_srtp extension" \ |
| 7865 | -c "found srtp profile" \ |
| 7866 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
| 7867 | -c "DTLS-SRTP key material is"\ |
| 7868 | -C "error" |
| 7869 | |
| 7870 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7871 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. openssl server." \ |
| 7872 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32:SRTP_AES128_CM_SHA1_80 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7873 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7874 | 0 \ |
| 7875 | -c "client hello, adding use_srtp extension" \ |
| 7876 | -c "found use_srtp extension" \ |
| 7877 | -c "found srtp profile" \ |
| 7878 | -c "selected srtp profile" \ |
| 7879 | -c "DTLS-SRTP key material is"\ |
| 7880 | -C "error" |
| 7881 | |
| 7882 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7883 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. openssl server." \ |
| 7884 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7885 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7886 | 0 \ |
| 7887 | -c "client hello, adding use_srtp extension" \ |
| 7888 | -c "found use_srtp extension" \ |
| 7889 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7890 | -c "selected srtp profile" \ |
| 7891 | -c "DTLS-SRTP key material is"\ |
| 7892 | -C "error" |
| 7893 | |
| 7894 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7895 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. openssl server." \ |
| 7896 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7897 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7898 | 0 \ |
| 7899 | -c "client hello, adding use_srtp extension" \ |
| 7900 | -c "found use_srtp extension" \ |
| 7901 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7902 | -c "selected srtp profile" \ |
| 7903 | -c "DTLS-SRTP key material is"\ |
| 7904 | -C "error" |
| 7905 | |
| 7906 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7907 | run_test "DTLS-SRTP server and Client support only one matching profile. openssl server." \ |
| 7908 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7909 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 7910 | 0 \ |
| 7911 | -c "client hello, adding use_srtp extension" \ |
| 7912 | -c "found use_srtp extension" \ |
| 7913 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7914 | -c "selected srtp profile" \ |
| 7915 | -c "DTLS-SRTP key material is"\ |
| 7916 | -C "error" |
| 7917 | |
| 7918 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7919 | run_test "DTLS-SRTP server and Client support only one different profile. openssl server." \ |
| 7920 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7921 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=6 debug_level=3" \ |
| 7922 | 0 \ |
| 7923 | -c "client hello, adding use_srtp extension" \ |
| 7924 | -C "found use_srtp extension" \ |
| 7925 | -C "found srtp profile" \ |
| 7926 | -C "selected srtp profile" \ |
| 7927 | -C "DTLS-SRTP key material is"\ |
| 7928 | -C "error" |
| 7929 | |
| 7930 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7931 | run_test "DTLS-SRTP server doesn't support use_srtp extension. openssl server" \ |
| 7932 | "$O_SRV -dtls" \ |
| 7933 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 7934 | 0 \ |
| 7935 | -c "client hello, adding use_srtp extension" \ |
| 7936 | -C "found use_srtp extension" \ |
| 7937 | -C "found srtp profile" \ |
| 7938 | -C "selected srtp profile" \ |
| 7939 | -C "DTLS-SRTP key material is"\ |
| 7940 | -C "error" |
| 7941 | |
| 7942 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
| 7943 | run_test "DTLS-SRTP all profiles supported. server doesn't support mki. openssl server." \ |
| 7944 | "$O_SRV -dtls -verify 0 -use_srtp SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32 -keymatexport 'EXTRACTOR-dtls_srtp' -keymatexportlen 60" \ |
| 7945 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 7946 | 0 \ |
| 7947 | -c "client hello, adding use_srtp extension" \ |
| 7948 | -c "found use_srtp extension" \ |
| 7949 | -c "found srtp profile" \ |
| 7950 | -c "selected srtp profile" \ |
| 7951 | -c "DTLS-SRTP key material is"\ |
| 7952 | -c "DTLS-SRTP no mki value negotiated"\ |
| 7953 | -c "dumping 'sending mki' (8 bytes)" \ |
| 7954 | -C "dumping 'received mki' (8 bytes)" \ |
| 7955 | -C "error" |
| 7956 | |
| 7957 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7958 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7959 | run_test "DTLS-SRTP all profiles supported. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7960 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7961 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7962 | 0 \ |
| 7963 | -s "found use_srtp extension" \ |
| 7964 | -s "found srtp profile" \ |
| 7965 | -s "selected srtp profile" \ |
| 7966 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7967 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7968 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_80" |
| 7969 | |
| 7970 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7971 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7972 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7973 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7974 | "$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] | 7975 | 0 \ |
| 7976 | -s "found use_srtp extension" \ |
| 7977 | -s "found srtp profile" \ |
| 7978 | -s "selected srtp profile" \ |
| 7979 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7980 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7981 | -c "SRTP profile: SRTP_NULL_HMAC_SHA1_80" |
| 7982 | |
| 7983 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7984 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7985 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls client." \ |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7986 | "$P_SRV dtls=1 use_srtp=1 debug_level=3" \ |
| 7987 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7988 | 0 \ |
| 7989 | -s "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7990 | -s "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 7991 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7992 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 7993 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7994 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 7995 | |
| 7996 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 7997 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 7998 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls client." \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 7999 | "$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] | 8000 | "$G_CLI -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_80:SRTP_AES128_CM_HMAC_SHA1_32:SRTP_NULL_HMAC_SHA1_80:SRTP_NULL_SHA1_32 --insecure 127.0.0.1" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8001 | 0 \ |
| 8002 | -s "found use_srtp extension" \ |
| 8003 | -s "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8004 | -s "selected srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8005 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8006 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8007 | -c "SRTP profile: SRTP_NULL_SHA1_32" |
| 8008 | |
| 8009 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8010 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8011 | 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] | 8012 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8013 | "$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] | 8014 | 0 \ |
| 8015 | -s "found use_srtp extension" \ |
| 8016 | -s "found srtp profile" \ |
| 8017 | -s "selected srtp profile" \ |
| 8018 | -s "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8019 | -s "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8020 | -c "SRTP profile: SRTP_AES128_CM_HMAC_SHA1_32" |
| 8021 | |
| 8022 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8023 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8024 | 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] | 8025 | "$P_SRV dtls=1 use_srtp=1 srtp_force_profile=1 debug_level=3" \ |
| 8026 | "$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] | 8027 | 0 \ |
| 8028 | -s "found use_srtp extension" \ |
| 8029 | -s "found srtp profile" \ |
| 8030 | -S "selected srtp profile" \ |
| 8031 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8032 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8033 | -C "SRTP profile:" |
| 8034 | |
| 8035 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8036 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8037 | 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] | 8038 | "$P_SRV dtls=1 debug_level=3" \ |
| 8039 | "$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] | 8040 | 0 \ |
| 8041 | -s "found use_srtp extension" \ |
| 8042 | -S "server hello, adding use_srtp extension" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8043 | -S "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8044 | -C "SRTP profile:" |
| 8045 | |
| 8046 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8047 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8048 | run_test "DTLS-SRTP all profiles supported. gnutls server" \ |
| 8049 | "$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" \ |
| 8050 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8051 | 0 \ |
| 8052 | -c "client hello, adding use_srtp extension" \ |
| 8053 | -c "found use_srtp extension" \ |
| 8054 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8055 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8056 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8057 | -C "error" |
| 8058 | |
| 8059 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8060 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8061 | run_test "DTLS-SRTP server supports all profiles. Client supports all profiles, in different order. gnutls server." \ |
| 8062 | "$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" \ |
| 8063 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8064 | 0 \ |
| 8065 | -c "client hello, adding use_srtp extension" \ |
| 8066 | -c "found use_srtp extension" \ |
| 8067 | -c "found srtp profile" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8068 | -c "selected srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8069 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8070 | -C "error" |
| 8071 | |
| 8072 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8073 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8074 | run_test "DTLS-SRTP server supports all profiles. Client supports one profile. gnutls server." \ |
| 8075 | "$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" \ |
| 8076 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8077 | 0 \ |
| 8078 | -c "client hello, adding use_srtp extension" \ |
| 8079 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8080 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8081 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8082 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8083 | -C "error" |
| 8084 | |
| 8085 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8086 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8087 | run_test "DTLS-SRTP server supports one profile. Client supports all profiles. gnutls server." \ |
| 8088 | "$G_SRV -u --srtp-profiles=SRTP_NULL_HMAC_SHA1_80" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8089 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8090 | 0 \ |
| 8091 | -c "client hello, adding use_srtp extension" \ |
| 8092 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8093 | -c "found srtp profile: MBEDTLS_TLS_SRTP_NULL_HMAC_SHA1_80" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8094 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8095 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8096 | -C "error" |
| 8097 | |
| 8098 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8099 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8100 | run_test "DTLS-SRTP server and Client support only one matching profile. gnutls server." \ |
| 8101 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
| 8102 | "$P_CLI dtls=1 use_srtp=1 srtp_force_profile=2 debug_level=3" \ |
| 8103 | 0 \ |
| 8104 | -c "client hello, adding use_srtp extension" \ |
| 8105 | -c "found use_srtp extension" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8106 | -c "found srtp profile: MBEDTLS_TLS_SRTP_AES128_CM_HMAC_SHA1_32" \ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8107 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8108 | -c "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8109 | -C "error" |
| 8110 | |
| 8111 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8112 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8113 | run_test "DTLS-SRTP server and Client support only one different profile. gnutls server." \ |
| 8114 | "$G_SRV -u --srtp-profiles=SRTP_AES128_CM_HMAC_SHA1_32" \ |
Johan Pascal | 43f9490 | 2020-09-22 12:25:52 +0200 | [diff] [blame] | 8115 | "$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] | 8116 | 0 \ |
| 8117 | -c "client hello, adding use_srtp extension" \ |
| 8118 | -C "found use_srtp extension" \ |
| 8119 | -C "found srtp profile" \ |
| 8120 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8121 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8122 | -C "error" |
| 8123 | |
| 8124 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8125 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8126 | run_test "DTLS-SRTP server doesn't support use_srtp extension. gnutls server" \ |
| 8127 | "$G_SRV -u" \ |
| 8128 | "$P_CLI dtls=1 use_srtp=1 debug_level=3" \ |
| 8129 | 0 \ |
| 8130 | -c "client hello, adding use_srtp extension" \ |
| 8131 | -C "found use_srtp extension" \ |
| 8132 | -C "found srtp profile" \ |
| 8133 | -C "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8134 | -C "DTLS-SRTP key material is"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8135 | -C "error" |
| 8136 | |
| 8137 | requires_config_enabled MBEDTLS_SSL_DTLS_SRTP |
Ron Eldor | 5d991c9 | 2019-01-15 18:54:03 +0200 | [diff] [blame] | 8138 | requires_gnutls |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8139 | run_test "DTLS-SRTP all profiles supported. mki used. gnutls server." \ |
| 8140 | "$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" \ |
| 8141 | "$P_CLI dtls=1 use_srtp=1 mki=542310ab34290481 debug_level=3" \ |
| 8142 | 0 \ |
| 8143 | -c "client hello, adding use_srtp extension" \ |
| 8144 | -c "found use_srtp extension" \ |
| 8145 | -c "found srtp profile" \ |
| 8146 | -c "selected srtp profile" \ |
Johan Pascal | 9bc97ca | 2020-09-21 23:44:45 +0200 | [diff] [blame] | 8147 | -c "DTLS-SRTP key material is"\ |
Johan Pascal | 20c7db3 | 2020-10-26 22:45:58 +0100 | [diff] [blame] | 8148 | -c "DTLS-SRTP mki value:"\ |
Ron Eldor | 3c6a44b | 2018-07-10 10:32:10 +0300 | [diff] [blame] | 8149 | -c "dumping 'sending mki' (8 bytes)" \ |
| 8150 | -c "dumping 'received mki' (8 bytes)" \ |
| 8151 | -C "error" |
| 8152 | |
Manuel Pégourié-Gonnard | 64dffc5 | 2014-09-02 13:39:16 +0200 | [diff] [blame] | 8153 | # Tests for specific things with "unreliable" UDP connection |
| 8154 | |
| 8155 | not_with_valgrind # spurious resend due to timeout |
| 8156 | run_test "DTLS proxy: reference" \ |
| 8157 | -p "$P_PXY" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8158 | "$P_SRV dtls=1 debug_level=2 hs_timeout=10000-20000" \ |
| 8159 | "$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] | 8160 | 0 \ |
| 8161 | -C "replayed record" \ |
| 8162 | -S "replayed record" \ |
Hanno Becker | b2a86c3 | 2019-07-19 15:43:09 +0100 | [diff] [blame] | 8163 | -C "Buffer record from epoch" \ |
| 8164 | -S "Buffer record from epoch" \ |
| 8165 | -C "ssl_buffer_message" \ |
| 8166 | -S "ssl_buffer_message" \ |
Manuel Pégourié-Gonnard | a775617 | 2014-08-31 18:37:01 +0200 | [diff] [blame] | 8167 | -C "discarding invalid record" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8168 | -S "discarding invalid record" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8169 | -S "resend" \ |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8170 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | be9eb87 | 2014-09-05 17:45:19 +0200 | [diff] [blame] | 8171 | -c "HTTP/1.0 200 OK" |
| 8172 | |
| 8173 | not_with_valgrind # spurious resend due to timeout |
Manuel Pégourié-Gonnard | 990f9e4 | 2014-09-06 12:27:02 +0200 | [diff] [blame] | 8174 | run_test "DTLS proxy: duplicate every packet" \ |
| 8175 | -p "$P_PXY duplicate=1" \ |
Manuel Pégourié-Gonnard | b692989 | 2019-09-09 11:14:37 +0200 | [diff] [blame] | 8176 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 hs_timeout=10000-20000" \ |
| 8177 | "$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] | 8178 | 0 \ |
| 8179 | -c "replayed record" \ |
| 8180 | -s "replayed record" \ |
| 8181 | -c "record from another epoch" \ |
| 8182 | -s "record from another epoch" \ |
| 8183 | -S "resend" \ |
| 8184 | -s "Extra-header:" \ |
| 8185 | -c "HTTP/1.0 200 OK" |
| 8186 | |
| 8187 | run_test "DTLS proxy: duplicate every packet, server anti-replay off" \ |
| 8188 | -p "$P_PXY duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8189 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2 anti_replay=0" \ |
| 8190 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8191 | 0 \ |
| 8192 | -c "replayed record" \ |
| 8193 | -S "replayed record" \ |
| 8194 | -c "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8195 | -s "record from another epoch" \ |
| 8196 | -c "resend" \ |
| 8197 | -s "resend" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8198 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8199 | -c "HTTP/1.0 200 OK" |
| 8200 | |
| 8201 | run_test "DTLS proxy: multiple records in same datagram" \ |
| 8202 | -p "$P_PXY pack=50" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8203 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8204 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 63eca93 | 2014-09-08 16:39:08 +0200 | [diff] [blame] | 8205 | 0 \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8206 | -c "next record in same datagram" \ |
| 8207 | -s "next record in same datagram" |
| 8208 | |
| 8209 | run_test "DTLS proxy: multiple records in same datagram, duplicate every packet" \ |
| 8210 | -p "$P_PXY pack=50 duplicate=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8211 | "$P_SRV dtls=1 dgram_packing=0 debug_level=2" \ |
| 8212 | "$P_CLI dtls=1 dgram_packing=0 debug_level=2" \ |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8213 | 0 \ |
| 8214 | -c "next record in same datagram" \ |
| 8215 | -s "next record in same datagram" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8216 | |
Manuel Pégourié-Gonnard | 246c13a | 2014-09-24 13:56:09 +0200 | [diff] [blame] | 8217 | run_test "DTLS proxy: inject invalid AD record, default badmac_limit" \ |
| 8218 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8219 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1" \ |
| 8220 | "$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] | 8221 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8222 | -c "discarding invalid record (mac)" \ |
| 8223 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8224 | -s "Extra-header:" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8225 | -c "HTTP/1.0 200 OK" \ |
| 8226 | -S "too many records with bad MAC" \ |
| 8227 | -S "Verification of the message MAC failed" |
| 8228 | |
| 8229 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 1" \ |
| 8230 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8231 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=1" \ |
| 8232 | "$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] | 8233 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8234 | -C "discarding invalid record (mac)" \ |
| 8235 | -S "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8236 | -S "Extra-header:" \ |
| 8237 | -C "HTTP/1.0 200 OK" \ |
| 8238 | -s "too many records with bad MAC" \ |
| 8239 | -s "Verification of the message MAC failed" |
| 8240 | |
| 8241 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2" \ |
| 8242 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8243 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2" \ |
| 8244 | "$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] | 8245 | 0 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8246 | -c "discarding invalid record (mac)" \ |
| 8247 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8248 | -s "Extra-header:" \ |
| 8249 | -c "HTTP/1.0 200 OK" \ |
| 8250 | -S "too many records with bad MAC" \ |
| 8251 | -S "Verification of the message MAC failed" |
| 8252 | |
| 8253 | run_test "DTLS proxy: inject invalid AD record, badmac_limit 2, exchanges 2"\ |
| 8254 | -p "$P_PXY bad_ad=1" \ |
Hanno Becker | 1c9a24c | 2018-08-14 13:46:33 +0100 | [diff] [blame] | 8255 | "$P_SRV dtls=1 dgram_packing=0 debug_level=1 badmac_limit=2 exchanges=2" \ |
| 8256 | "$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] | 8257 | 1 \ |
Manuel Pégourié-Gonnard | 74a1378 | 2014-10-14 22:34:08 +0200 | [diff] [blame] | 8258 | -c "discarding invalid record (mac)" \ |
| 8259 | -s "discarding invalid record (mac)" \ |
Manuel Pégourié-Gonnard | e698f59 | 2014-10-14 19:36:36 +0200 | [diff] [blame] | 8260 | -s "Extra-header:" \ |
| 8261 | -c "HTTP/1.0 200 OK" \ |
| 8262 | -s "too many records with bad MAC" \ |
| 8263 | -s "Verification of the message MAC failed" |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8264 | |
| 8265 | run_test "DTLS proxy: delay ChangeCipherSpec" \ |
| 8266 | -p "$P_PXY delay_ccs=1" \ |
Hanno Becker | c430523 | 2018-08-14 13:41:21 +0100 | [diff] [blame] | 8267 | "$P_SRV dtls=1 debug_level=1 dgram_packing=0" \ |
| 8268 | "$P_CLI dtls=1 debug_level=1 dgram_packing=0" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8269 | 0 \ |
| 8270 | -c "record from another epoch" \ |
| 8271 | -s "record from another epoch" \ |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8272 | -s "Extra-header:" \ |
| 8273 | -c "HTTP/1.0 200 OK" |
| 8274 | |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8275 | # Tests for reordering support with DTLS |
| 8276 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8277 | run_test "DTLS reordering: Buffer out-of-order handshake message on client" \ |
| 8278 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8279 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8280 | hs_timeout=2500-60000" \ |
| 8281 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8282 | hs_timeout=2500-60000" \ |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8283 | 0 \ |
| 8284 | -c "Buffering HS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8285 | -c "Next handshake message has been buffered - load"\ |
| 8286 | -S "Buffering HS message" \ |
| 8287 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8288 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8289 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8290 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8291 | -S "Remember CCS message" |
Hanno Becker | e384221 | 2018-08-16 15:28:59 +0100 | [diff] [blame] | 8292 | |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8293 | run_test "DTLS reordering: Buffer out-of-order handshake message fragment on client" \ |
| 8294 | -p "$P_PXY delay_srv=ServerHello" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8295 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8296 | hs_timeout=2500-60000" \ |
| 8297 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8298 | hs_timeout=2500-60000" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8299 | 0 \ |
| 8300 | -c "Buffering HS message" \ |
| 8301 | -c "found fragmented DTLS handshake message"\ |
| 8302 | -c "Next handshake message 1 not or only partially bufffered" \ |
| 8303 | -c "Next handshake message has been buffered - load"\ |
| 8304 | -S "Buffering HS message" \ |
| 8305 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8306 | -C "Injecting buffered CCS message" \ |
Hanno Becker | dc1e950 | 2018-08-28 16:02:33 +0100 | [diff] [blame] | 8307 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8308 | -S "Injecting buffered CCS message" \ |
Hanno Becker | aa5d0c4 | 2018-08-16 13:15:19 +0100 | [diff] [blame] | 8309 | -S "Remember CCS message" |
| 8310 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8311 | # The client buffers the ServerKeyExchange before receiving the fragmented |
| 8312 | # Certificate message; at the time of writing, together these are aroudn 1200b |
| 8313 | # in size, so that the bound below ensures that the certificate can be reassembled |
| 8314 | # while keeping the ServerKeyExchange. |
| 8315 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1300 |
| 8316 | 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] | 8317 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8318 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8319 | hs_timeout=2500-60000" \ |
| 8320 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8321 | hs_timeout=2500-60000" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8322 | 0 \ |
| 8323 | -c "Buffering HS message" \ |
| 8324 | -c "Next handshake message has been buffered - load"\ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8325 | -C "attempt to make space by freeing buffered messages" \ |
| 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 | a1adcca | 2018-08-24 14:41:07 +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 | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8331 | -S "Remember CCS message" |
| 8332 | |
| 8333 | # The size constraints ensure that the delayed certificate message can't |
| 8334 | # be reassembled while keeping the ServerKeyExchange message, but it can |
| 8335 | # when dropping it first. |
| 8336 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 900 |
| 8337 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 1299 |
| 8338 | run_test "DTLS reordering: Buffer out-of-order hs msg before reassembling next, free buffered msg" \ |
| 8339 | -p "$P_PXY delay_srv=Certificate delay_srv=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8340 | "$P_SRV mtu=512 dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8341 | hs_timeout=2500-60000" \ |
| 8342 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8343 | hs_timeout=2500-60000" \ |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8344 | 0 \ |
| 8345 | -c "Buffering HS message" \ |
| 8346 | -c "attempt to make space by freeing buffered future messages" \ |
| 8347 | -c "Enough space available after freeing buffered HS messages" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8348 | -S "Buffering HS message" \ |
| 8349 | -S "Next handshake message has been buffered - load"\ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8350 | -C "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8351 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8352 | -S "Injecting buffered CCS message" \ |
Hanno Becker | e356705 | 2018-08-21 16:50:43 +0100 | [diff] [blame] | 8353 | -S "Remember CCS message" |
| 8354 | |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8355 | run_test "DTLS reordering: Buffer out-of-order handshake message on server" \ |
| 8356 | -p "$P_PXY delay_cli=Certificate" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8357 | "$P_SRV dgram_packing=0 auth_mode=required cookies=0 dtls=1 debug_level=2 \ |
| 8358 | hs_timeout=2500-60000" \ |
| 8359 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8360 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8361 | 0 \ |
| 8362 | -C "Buffering HS message" \ |
| 8363 | -C "Next handshake message has been buffered - load"\ |
| 8364 | -s "Buffering HS message" \ |
| 8365 | -s "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8366 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8367 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8368 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8369 | -S "Remember CCS message" |
| 8370 | |
| 8371 | run_test "DTLS reordering: Buffer out-of-order CCS message on client"\ |
| 8372 | -p "$P_PXY delay_srv=NewSessionTicket" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8373 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8374 | hs_timeout=2500-60000" \ |
| 8375 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8376 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8377 | 0 \ |
| 8378 | -C "Buffering HS message" \ |
| 8379 | -C "Next handshake message has been buffered - load"\ |
| 8380 | -S "Buffering HS message" \ |
| 8381 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8382 | -c "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8383 | -c "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8384 | -S "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8385 | -S "Remember CCS message" |
| 8386 | |
| 8387 | run_test "DTLS reordering: Buffer out-of-order CCS message on server"\ |
| 8388 | -p "$P_PXY delay_cli=ClientKeyExchange" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8389 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8390 | hs_timeout=2500-60000" \ |
| 8391 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8392 | hs_timeout=2500-60000" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8393 | 0 \ |
| 8394 | -C "Buffering HS message" \ |
| 8395 | -C "Next handshake message has been buffered - load"\ |
| 8396 | -S "Buffering HS message" \ |
| 8397 | -S "Next handshake message has been buffered - load" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8398 | -C "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8399 | -C "Remember CCS message" \ |
Hanno Becker | 39b8bc9 | 2018-08-28 17:17:13 +0100 | [diff] [blame] | 8400 | -s "Injecting buffered CCS message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8401 | -s "Remember CCS message" |
| 8402 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8403 | run_test "DTLS reordering: Buffer encrypted Finished message" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8404 | -p "$P_PXY delay_ccs=1" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8405 | "$P_SRV dgram_packing=0 cookies=0 dtls=1 debug_level=2 \ |
| 8406 | hs_timeout=2500-60000" \ |
| 8407 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 \ |
| 8408 | hs_timeout=2500-60000" \ |
Hanno Becker | b34149c | 2018-08-16 15:29:06 +0100 | [diff] [blame] | 8409 | 0 \ |
| 8410 | -s "Buffer record from epoch 1" \ |
Hanno Becker | 56cdfd1 | 2018-08-17 13:42:15 +0100 | [diff] [blame] | 8411 | -s "Found buffered record from current epoch - load" \ |
| 8412 | -c "Buffer record from epoch 1" \ |
| 8413 | -c "Found buffered record from current epoch - load" |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8414 | |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8415 | # In this test, both the fragmented NewSessionTicket and the ChangeCipherSpec |
| 8416 | # from the server are delayed, so that the encrypted Finished message |
| 8417 | # is received and buffered. When the fragmented NewSessionTicket comes |
| 8418 | # in afterwards, the encrypted Finished message must be freed in order |
| 8419 | # to make space for the NewSessionTicket to be reassembled. |
| 8420 | # This works only in very particular circumstances: |
| 8421 | # - MBEDTLS_SSL_DTLS_MAX_BUFFERING must be large enough to allow buffering |
| 8422 | # of the NewSessionTicket, but small enough to also allow buffering of |
| 8423 | # the encrypted Finished message. |
| 8424 | # - The MTU setting on the server must be so small that the NewSessionTicket |
| 8425 | # needs to be fragmented. |
| 8426 | # - All messages sent by the server must be small enough to be either sent |
| 8427 | # without fragmentation or be reassembled within the bounds of |
| 8428 | # MBEDTLS_SSL_DTLS_MAX_BUFFERING. Achieve this by testing with a PSK-based |
| 8429 | # handshake, omitting CRTs. |
Manuel Pégourié-Gonnard | eef4c75 | 2019-05-28 10:21:30 +0200 | [diff] [blame] | 8430 | requires_config_value_at_least "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 190 |
| 8431 | requires_config_value_at_most "MBEDTLS_SSL_DTLS_MAX_BUFFERING" 230 |
Hanno Becker | a1adcca | 2018-08-24 14:41:07 +0100 | [diff] [blame] | 8432 | run_test "DTLS reordering: Buffer encrypted Finished message, drop for fragmented NewSessionTicket" \ |
| 8433 | -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] | 8434 | "$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] | 8435 | "$P_CLI dgram_packing=0 dtls=1 debug_level=2 force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 psk=abc123 psk_identity=foo" \ |
| 8436 | 0 \ |
| 8437 | -s "Buffer record from epoch 1" \ |
| 8438 | -s "Found buffered record from current epoch - load" \ |
| 8439 | -c "Buffer record from epoch 1" \ |
| 8440 | -C "Found buffered record from current epoch - load" \ |
| 8441 | -c "Enough space available after freeing future epoch record" |
| 8442 | |
Manuel Pégourié-Gonnard | a071972 | 2014-09-20 12:46:27 +0200 | [diff] [blame] | 8443 | # Tests for "randomly unreliable connection": try a variety of flows and peers |
| 8444 | |
| 8445 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 825a49e | 2014-09-23 11:00:37 +0200 | [diff] [blame] | 8446 | run_test "DTLS proxy: 3d (drop, delay, duplicate), \"short\" PSK handshake" \ |
| 8447 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8448 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none \ |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8449 | psk=abc123" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8450 | "$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] | 8451 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8452 | 0 \ |
| 8453 | -s "Extra-header:" \ |
| 8454 | -c "HTTP/1.0 200 OK" |
| 8455 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8456 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8457 | run_test "DTLS proxy: 3d, \"short\" RSA handshake" \ |
| 8458 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8459 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8460 | "$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] | 8461 | force_ciphersuite=TLS-RSA-WITH-AES-128-CBC-SHA" \ |
| 8462 | 0 \ |
| 8463 | -s "Extra-header:" \ |
| 8464 | -c "HTTP/1.0 200 OK" |
| 8465 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8466 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8467 | run_test "DTLS proxy: 3d, \"short\" (no ticket, no cli_auth) FS handshake" \ |
| 8468 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8469 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=none" \ |
| 8470 | "$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] | 8471 | 0 \ |
| 8472 | -s "Extra-header:" \ |
| 8473 | -c "HTTP/1.0 200 OK" |
| 8474 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8475 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8476 | run_test "DTLS proxy: 3d, FS, client auth" \ |
| 8477 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8478 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=0 auth_mode=required" \ |
| 8479 | "$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] | 8480 | 0 \ |
| 8481 | -s "Extra-header:" \ |
| 8482 | -c "HTTP/1.0 200 OK" |
| 8483 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8484 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8485 | run_test "DTLS proxy: 3d, FS, ticket" \ |
| 8486 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8487 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=none" \ |
| 8488 | "$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] | 8489 | 0 \ |
| 8490 | -s "Extra-header:" \ |
| 8491 | -c "HTTP/1.0 200 OK" |
| 8492 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8493 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 18e519a | 2014-09-24 19:09:17 +0200 | [diff] [blame] | 8494 | run_test "DTLS proxy: 3d, max handshake (FS, ticket + client auth)" \ |
| 8495 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8496 | "$P_SRV dtls=1 dgram_packing=0 hs_timeout=500-10000 tickets=1 auth_mode=required" \ |
| 8497 | "$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] | 8498 | 0 \ |
| 8499 | -s "Extra-header:" \ |
| 8500 | -c "HTTP/1.0 200 OK" |
| 8501 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8502 | client_needs_more_time 2 |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8503 | run_test "DTLS proxy: 3d, max handshake, 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 nbio=2 tickets=1 \ |
Manuel Pégourié-Gonnard | 37a4de2 | 2014-10-01 16:38:03 +0200 | [diff] [blame] | 8506 | auth_mode=required" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8507 | "$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] | 8508 | 0 \ |
| 8509 | -s "Extra-header:" \ |
| 8510 | -c "HTTP/1.0 200 OK" |
| 8511 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8512 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 7a26d73 | 2014-10-02 14:50:46 +0200 | [diff] [blame] | 8513 | run_test "DTLS proxy: 3d, min handshake, resumption" \ |
| 8514 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8515 | "$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] | 8516 | psk=abc123 debug_level=3" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8517 | "$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] | 8518 | 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] | 8519 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8520 | 0 \ |
| 8521 | -s "a session has been resumed" \ |
| 8522 | -c "a session has been resumed" \ |
| 8523 | -s "Extra-header:" \ |
| 8524 | -c "HTTP/1.0 200 OK" |
| 8525 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8526 | client_needs_more_time 4 |
Manuel Pégourié-Gonnard | 85beb30 | 2014-10-02 17:59:19 +0200 | [diff] [blame] | 8527 | run_test "DTLS proxy: 3d, min handshake, resumption, nbio" \ |
| 8528 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8529 | "$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] | 8530 | psk=abc123 debug_level=3 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8531 | "$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] | 8532 | 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] | 8533 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8 nbio=2" \ |
| 8534 | 0 \ |
| 8535 | -s "a session has been resumed" \ |
| 8536 | -c "a session has been resumed" \ |
| 8537 | -s "Extra-header:" \ |
| 8538 | -c "HTTP/1.0 200 OK" |
| 8539 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8540 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8541 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8542 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego" \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8543 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8544 | "$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] | 8545 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8546 | "$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] | 8547 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 1b753f1 | 2014-09-25 16:09:36 +0200 | [diff] [blame] | 8548 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8549 | 0 \ |
| 8550 | -c "=> renegotiate" \ |
| 8551 | -s "=> renegotiate" \ |
| 8552 | -s "Extra-header:" \ |
| 8553 | -c "HTTP/1.0 200 OK" |
| 8554 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8555 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8556 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8557 | run_test "DTLS proxy: 3d, min handshake, client-initiated renego, nbio" \ |
| 8558 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8559 | "$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] | 8560 | psk=abc123 renegotiation=1 debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8561 | "$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] | 8562 | renegotiate=1 debug_level=2 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8563 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8564 | 0 \ |
| 8565 | -c "=> renegotiate" \ |
| 8566 | -s "=> renegotiate" \ |
| 8567 | -s "Extra-header:" \ |
| 8568 | -c "HTTP/1.0 200 OK" |
| 8569 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8570 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8571 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8572 | run_test "DTLS proxy: 3d, min handshake, server-initiated renego" \ |
Manuel Pégourié-Gonnard | a6ace04 | 2014-10-15 12:44:41 +0200 | [diff] [blame] | 8573 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8574 | "$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] | 8575 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8576 | debug_level=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8577 | "$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] | 8578 | renegotiation=1 exchanges=4 debug_level=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8579 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8580 | 0 \ |
| 8581 | -c "=> renegotiate" \ |
| 8582 | -s "=> renegotiate" \ |
| 8583 | -s "Extra-header:" \ |
| 8584 | -c "HTTP/1.0 200 OK" |
| 8585 | |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8586 | client_needs_more_time 4 |
Hanno Becker | 6a24364 | 2017-10-12 15:18:45 +0100 | [diff] [blame] | 8587 | requires_config_enabled MBEDTLS_SSL_RENEGOTIATION |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8588 | 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] | 8589 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8590 | "$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] | 8591 | psk=abc123 renegotiate=1 renegotiation=1 exchanges=4 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8592 | debug_level=2 nbio=2" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8593 | "$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] | 8594 | renegotiation=1 exchanges=4 debug_level=2 nbio=2 \ |
Manuel Pégourié-Gonnard | ba958b8 | 2014-10-09 16:13:44 +0200 | [diff] [blame] | 8595 | force_ciphersuite=TLS-PSK-WITH-AES-128-CCM-8" \ |
| 8596 | 0 \ |
| 8597 | -c "=> renegotiate" \ |
| 8598 | -s "=> renegotiate" \ |
| 8599 | -s "Extra-header:" \ |
| 8600 | -c "HTTP/1.0 200 OK" |
| 8601 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8602 | ## Interop tests with OpenSSL might trigger a bug in recent versions (including |
| 8603 | ## all versions installed on the CI machines), reported here: |
| 8604 | ## Bug report: https://github.com/openssl/openssl/issues/6902 |
| 8605 | ## They should be re-enabled once a fixed version of OpenSSL is available |
| 8606 | ## (this should happen in some 1.1.1_ release according to the ticket). |
| 8607 | skip_next_test |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8608 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8609 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8610 | run_test "DTLS proxy: 3d, openssl server" \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8611 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8612 | "$O_SRV -dtls1 -mtu 2048" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8613 | "$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] | 8614 | 0 \ |
Manuel Pégourié-Gonnard | d0fd1da | 2014-09-25 17:00:27 +0200 | [diff] [blame] | 8615 | -c "HTTP/1.0 200 OK" |
| 8616 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8617 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8618 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8619 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8620 | run_test "DTLS proxy: 3d, openssl server, fragmentation" \ |
| 8621 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8622 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8623 | "$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] | 8624 | 0 \ |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8625 | -c "HTTP/1.0 200 OK" |
| 8626 | |
Manuel Pégourié-Gonnard | 82986c1 | 2018-09-03 10:50:21 +0200 | [diff] [blame] | 8627 | skip_next_test # see above |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8628 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8629 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8630 | run_test "DTLS proxy: 3d, openssl server, fragmentation, nbio" \ |
| 8631 | -p "$P_PXY drop=5 delay=5 duplicate=5 protect_hvr=1" \ |
| 8632 | "$O_SRV -dtls1 -mtu 768" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8633 | "$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] | 8634 | 0 \ |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8635 | -c "HTTP/1.0 200 OK" |
| 8636 | |
Manuel Pégourié-Gonnard | 9699996 | 2015-02-17 16:02:37 +0000 | [diff] [blame] | 8637 | requires_gnutls |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8638 | client_needs_more_time 6 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8639 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8640 | run_test "DTLS proxy: 3d, gnutls server" \ |
| 8641 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
| 8642 | "$G_SRV -u --mtu 2048 -a" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8643 | "$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] | 8644 | 0 \ |
| 8645 | -s "Extra-header:" \ |
| 8646 | -c "Extra-header:" |
| 8647 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8648 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8649 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8650 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 9590e0a | 2014-09-26 16:27:59 +0200 | [diff] [blame] | 8651 | run_test "DTLS proxy: 3d, gnutls server, fragmentation" \ |
| 8652 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8653 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8654 | "$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] | 8655 | 0 \ |
| 8656 | -s "Extra-header:" \ |
| 8657 | -c "Extra-header:" |
| 8658 | |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8659 | requires_gnutls_next |
Janos Follath | 74537a6 | 2016-09-02 13:45:28 +0100 | [diff] [blame] | 8660 | client_needs_more_time 8 |
Manuel Pégourié-Gonnard | d68434e | 2015-08-31 12:48:22 +0200 | [diff] [blame] | 8661 | not_with_valgrind # risk of non-mbedtls peer timing out |
Manuel Pégourié-Gonnard | 6093d81 | 2014-09-29 17:52:57 +0200 | [diff] [blame] | 8662 | run_test "DTLS proxy: 3d, gnutls server, fragmentation, nbio" \ |
| 8663 | -p "$P_PXY drop=5 delay=5 duplicate=5" \ |
k-stachowiak | 17a38d3 | 2019-02-18 15:29:56 +0100 | [diff] [blame] | 8664 | "$G_NEXT_SRV -u --mtu 512" \ |
Andrzej Kurek | 948fe80 | 2018-10-05 15:42:44 -0400 | [diff] [blame] | 8665 | "$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] | 8666 | 0 \ |
| 8667 | -s "Extra-header:" \ |
| 8668 | -c "Extra-header:" |
| 8669 | |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8670 | run_test "export keys functionality" \ |
| 8671 | "$P_SRV eap_tls=1 debug_level=3" \ |
| 8672 | "$P_CLI eap_tls=1 debug_level=3" \ |
| 8673 | 0 \ |
Ron Eldor | 65d8c26 | 2019-06-04 13:05:36 +0300 | [diff] [blame] | 8674 | -c "EAP-TLS key material is:"\ |
| 8675 | -s "EAP-TLS key material is:"\ |
| 8676 | -c "EAP-TLS IV is:" \ |
| 8677 | -s "EAP-TLS IV is:" |
Ron Eldor | f75e252 | 2019-05-14 20:38:49 +0300 | [diff] [blame] | 8678 | |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8679 | # openssl feature tests: check if tls1.3 exists. |
| 8680 | requires_openssl_tls1_3 |
| 8681 | run_test "TLS1.3: Test openssl tls1_3 feature" \ |
| 8682 | "$O_NEXT_SRV -tls1_3 -msg" \ |
| 8683 | "$O_NEXT_CLI -tls1_3 -msg" \ |
| 8684 | 0 \ |
| 8685 | -c "TLS 1.3" \ |
| 8686 | -s "TLS 1.3" |
| 8687 | |
Jerry Yu | 75261df | 2021-09-02 17:40:08 +0800 | [diff] [blame] | 8688 | # 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] | 8689 | requires_gnutls_tls1_3 |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8690 | requires_gnutls_next_no_ticket |
| 8691 | requires_gnutls_next_disable_tls13_compat |
Jerry Yu | 0402979 | 2021-08-10 16:45:37 +0800 | [diff] [blame] | 8692 | run_test "TLS1.3: Test gnutls tls1_3 feature" \ |
Jerry Yu | b12d81d | 2021-08-17 10:56:08 +0800 | [diff] [blame] | 8693 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3:%NO_TICKETS:%DISABLE_TLS13_COMPAT_MODE" \ |
| 8694 | "$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] | 8695 | 0 \ |
| 8696 | -s "Version: TLS1.3" \ |
| 8697 | -c "Version: TLS1.3" |
| 8698 | |
Jerry Yu | c46e9b4 | 2021-08-06 11:22:24 +0800 | [diff] [blame] | 8699 | # TLS1.3 test cases |
| 8700 | # TODO: remove or rewrite this test case if #4832 is resolved. |
| 8701 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8702 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8703 | skip_handshake_stage_check |
| 8704 | run_test "TLS1.3: Not supported version check: tls1_2 and tls1_3" \ |
| 8705 | "$P_SRV debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8706 | "$P_CLI debug_level=1 min_version=tls1_2 max_version=tls1_3" \ |
| 8707 | 1 \ |
| 8708 | -s "SSL - The requested feature is not available" \ |
| 8709 | -c "SSL - The requested feature is not available" \ |
| 8710 | -s "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" \ |
| 8711 | -c "Hybrid TLS 1.2 + TLS 1.3 configurations are not yet supported" |
| 8712 | |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8713 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_2 |
| 8714 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8715 | run_test "TLS1.3: handshake dispatch test: tls1_3 only" \ |
Jerry Yu | 3523a3b | 2021-09-14 16:29:49 +0800 | [diff] [blame] | 8716 | "$P_SRV debug_level=2 min_version=tls1_3 max_version=tls1_3" \ |
| 8717 | "$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] | 8718 | 1 \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8719 | -s "tls1_3 server state: 0" \ |
| 8720 | -c "tls1_3 client state: 0" |
Jerry Yu | b9930e7 | 2021-08-06 17:11:51 +0800 | [diff] [blame] | 8721 | |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8722 | requires_openssl_tls1_3 |
| 8723 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8724 | run_test "TLS1.3: Test client hello msg work - openssl" \ |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8725 | "$O_NEXT_SRV -tls1_3 -msg" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8726 | "$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] | 8727 | 1 \ |
| 8728 | -c "SSL - The requested feature is not available" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8729 | -s "ServerHello" \ |
| 8730 | -c "tls1_3 client state: 0" \ |
| 8731 | -c "tls1_3 client state: 2" \ |
| 8732 | -c "tls1_3 client state: 19" \ |
| 8733 | -c "tls1_3 client state: 5" \ |
| 8734 | -c "tls1_3 client state: 3" \ |
| 8735 | -c "tls1_3 client state: 9" \ |
| 8736 | -c "tls1_3 client state: 13" \ |
| 8737 | -c "tls1_3 client state: 7" \ |
| 8738 | -c "tls1_3 client state: 20" \ |
| 8739 | -c "tls1_3 client state: 11" \ |
| 8740 | -c "tls1_3 client state: 14" \ |
| 8741 | -c "tls1_3 client state: 15" |
Jerry Yu | ed2ef2d | 2021-08-19 18:11:43 +0800 | [diff] [blame] | 8742 | |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8743 | requires_gnutls_tls1_3 |
| 8744 | requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL |
| 8745 | run_test "TLS1.3: Test client hello msg work - gnutls" \ |
| 8746 | "$G_NEXT_SRV --priority=NORMAL:-VERS-ALL:+VERS-TLS1.3 --debug=4" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8747 | "$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] | 8748 | 1 \ |
| 8749 | -c "SSL - The requested feature is not available" \ |
Jerry Yu | 6e81b27 | 2021-09-27 11:16:17 +0800 | [diff] [blame] | 8750 | -s "SERVER HELLO was queued" \ |
| 8751 | -c "tls1_3 client state: 0" \ |
| 8752 | -c "tls1_3 client state: 2" \ |
| 8753 | -c "tls1_3 client state: 19" \ |
| 8754 | -c "tls1_3 client state: 5" \ |
| 8755 | -c "tls1_3 client state: 3" \ |
| 8756 | -c "tls1_3 client state: 9" \ |
| 8757 | -c "tls1_3 client state: 13" \ |
| 8758 | -c "tls1_3 client state: 7" \ |
| 8759 | -c "tls1_3 client state: 20" \ |
| 8760 | -c "tls1_3 client state: 11" \ |
| 8761 | -c "tls1_3 client state: 14" \ |
| 8762 | -c "tls1_3 client state: 15" |
Jerry Yu | 76e31ec | 2021-09-22 21:16:27 +0800 | [diff] [blame] | 8763 | |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8764 | # Test heap memory usage after handshake |
| 8765 | requires_config_enabled MBEDTLS_MEMORY_DEBUG |
| 8766 | requires_config_enabled MBEDTLS_MEMORY_BUFFER_ALLOC_C |
| 8767 | requires_config_enabled MBEDTLS_SSL_MAX_FRAGMENT_LENGTH |
Yuto Takano | bc87b1d | 2021-07-08 15:56:33 +0100 | [diff] [blame] | 8768 | requires_max_content_len 16384 |
Piotr Nowicki | 0937ed2 | 2019-11-26 16:32:40 +0100 | [diff] [blame] | 8769 | run_tests_memory_after_hanshake |
| 8770 | |
Manuel Pégourié-Gonnard | 8520dac | 2014-02-21 12:12:23 +0100 | [diff] [blame] | 8771 | # Final report |
| 8772 | |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8773 | echo "------------------------------------------------------------------------" |
| 8774 | |
| 8775 | if [ $FAILS = 0 ]; then |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8776 | printf "PASSED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8777 | else |
Manuel Pégourié-Gonnard | f46f128 | 2014-12-11 11:51:28 +0100 | [diff] [blame] | 8778 | printf "FAILED" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8779 | fi |
Manuel Pégourié-Gonnard | 72e51ee | 2014-08-31 10:22:11 +0200 | [diff] [blame] | 8780 | PASSES=$(( $TESTS - $FAILS )) |
Manuel Pégourié-Gonnard | 6f4fbbb | 2014-08-14 14:31:29 +0200 | [diff] [blame] | 8781 | echo " ($PASSES / $TESTS tests ($SKIPS skipped))" |
Manuel Pégourié-Gonnard | 33a752e | 2014-02-21 09:47:37 +0100 | [diff] [blame] | 8782 | |
| 8783 | exit $FAILS |